
(FPCore (x y z) :precision binary64 (/ (* x y) (* (* z z) (+ z 1.0))))
double code(double x, double y, double z) {
return (x * y) / ((z * z) * (z + 1.0));
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = (x * y) / ((z * z) * (z + 1.0d0))
end function
public static double code(double x, double y, double z) {
return (x * y) / ((z * z) * (z + 1.0));
}
def code(x, y, z): return (x * y) / ((z * z) * (z + 1.0))
function code(x, y, z) return Float64(Float64(x * y) / Float64(Float64(z * z) * Float64(z + 1.0))) end
function tmp = code(x, y, z) tmp = (x * y) / ((z * z) * (z + 1.0)); end
code[x_, y_, z_] := N[(N[(x * y), $MachinePrecision] / N[(N[(z * z), $MachinePrecision] * N[(z + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x \cdot y}{\left(z \cdot z\right) \cdot \left(z + 1\right)}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 15 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z) :precision binary64 (/ (* x y) (* (* z z) (+ z 1.0))))
double code(double x, double y, double z) {
return (x * y) / ((z * z) * (z + 1.0));
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = (x * y) / ((z * z) * (z + 1.0d0))
end function
public static double code(double x, double y, double z) {
return (x * y) / ((z * z) * (z + 1.0));
}
def code(x, y, z): return (x * y) / ((z * z) * (z + 1.0))
function code(x, y, z) return Float64(Float64(x * y) / Float64(Float64(z * z) * Float64(z + 1.0))) end
function tmp = code(x, y, z) tmp = (x * y) / ((z * z) * (z + 1.0)); end
code[x_, y_, z_] := N[(N[(x * y), $MachinePrecision] / N[(N[(z * z), $MachinePrecision] * N[(z + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x \cdot y}{\left(z \cdot z\right) \cdot \left(z + 1\right)}
\end{array}
x_m = (fabs.f64 x)
x_s = (copysign.f64 1 x)
y_m = (fabs.f64 y)
y_s = (copysign.f64 1 y)
NOTE: x_m, y_m, and z should be sorted in increasing order before calling this function.
(FPCore (y_s x_s x_m y_m z)
:precision binary64
(let* ((t_0 (/ (sqrt y_m) (hypot z (pow z 1.5)))))
(*
y_s
(*
x_s
(if (<= z 1e-175)
(- (/ (* (/ y_m z) x_m) (* z (- -1.0 z))))
(* t_0 (* x_m t_0)))))))x_m = fabs(x);
x_s = copysign(1.0, x);
y_m = fabs(y);
y_s = copysign(1.0, y);
assert(x_m < y_m && y_m < z);
double code(double y_s, double x_s, double x_m, double y_m, double z) {
double t_0 = sqrt(y_m) / hypot(z, pow(z, 1.5));
double tmp;
if (z <= 1e-175) {
tmp = -(((y_m / z) * x_m) / (z * (-1.0 - z)));
} else {
tmp = t_0 * (x_m * t_0);
}
return y_s * (x_s * tmp);
}
x_m = Math.abs(x);
x_s = Math.copySign(1.0, x);
y_m = Math.abs(y);
y_s = Math.copySign(1.0, y);
assert x_m < y_m && y_m < z;
public static double code(double y_s, double x_s, double x_m, double y_m, double z) {
double t_0 = Math.sqrt(y_m) / Math.hypot(z, Math.pow(z, 1.5));
double tmp;
if (z <= 1e-175) {
tmp = -(((y_m / z) * x_m) / (z * (-1.0 - z)));
} else {
tmp = t_0 * (x_m * t_0);
}
return y_s * (x_s * tmp);
}
x_m = math.fabs(x) x_s = math.copysign(1.0, x) y_m = math.fabs(y) y_s = math.copysign(1.0, y) [x_m, y_m, z] = sort([x_m, y_m, z]) def code(y_s, x_s, x_m, y_m, z): t_0 = math.sqrt(y_m) / math.hypot(z, math.pow(z, 1.5)) tmp = 0 if z <= 1e-175: tmp = -(((y_m / z) * x_m) / (z * (-1.0 - z))) else: tmp = t_0 * (x_m * t_0) return y_s * (x_s * tmp)
x_m = abs(x) x_s = copysign(1.0, x) y_m = abs(y) y_s = copysign(1.0, y) x_m, y_m, z = sort([x_m, y_m, z]) function code(y_s, x_s, x_m, y_m, z) t_0 = Float64(sqrt(y_m) / hypot(z, (z ^ 1.5))) tmp = 0.0 if (z <= 1e-175) tmp = Float64(-Float64(Float64(Float64(y_m / z) * x_m) / Float64(z * Float64(-1.0 - z)))); else tmp = Float64(t_0 * Float64(x_m * t_0)); end return Float64(y_s * Float64(x_s * tmp)) end
x_m = abs(x);
x_s = sign(x) * abs(1.0);
y_m = abs(y);
y_s = sign(y) * abs(1.0);
x_m, y_m, z = num2cell(sort([x_m, y_m, z])){:}
function tmp_2 = code(y_s, x_s, x_m, y_m, z)
t_0 = sqrt(y_m) / hypot(z, (z ^ 1.5));
tmp = 0.0;
if (z <= 1e-175)
tmp = -(((y_m / z) * x_m) / (z * (-1.0 - z)));
else
tmp = t_0 * (x_m * t_0);
end
tmp_2 = y_s * (x_s * tmp);
end
x_m = N[Abs[x], $MachinePrecision]
x_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
y_m = N[Abs[y], $MachinePrecision]
y_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x_m, y_m, and z should be sorted in increasing order before calling this function.
code[y$95$s_, x$95$s_, x$95$m_, y$95$m_, z_] := Block[{t$95$0 = N[(N[Sqrt[y$95$m], $MachinePrecision] / N[Sqrt[z ^ 2 + N[Power[z, 1.5], $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]}, N[(y$95$s * N[(x$95$s * If[LessEqual[z, 1e-175], (-N[(N[(N[(y$95$m / z), $MachinePrecision] * x$95$m), $MachinePrecision] / N[(z * N[(-1.0 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), N[(t$95$0 * N[(x$95$m * t$95$0), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
x_m = \left|x\right|
\\
x_s = \mathsf{copysign}\left(1, x\right)
\\
y_m = \left|y\right|
\\
y_s = \mathsf{copysign}\left(1, y\right)
\\
[x_m, y_m, z] = \mathsf{sort}([x_m, y_m, z])\\
\\
\begin{array}{l}
t_0 := \frac{\sqrt{y_m}}{\mathsf{hypot}\left(z, {z}^{1.5}\right)}\\
y_s \cdot \left(x_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq 10^{-175}:\\
\;\;\;\;-\frac{\frac{y_m}{z} \cdot x_m}{z \cdot \left(-1 - z\right)}\\
\mathbf{else}:\\
\;\;\;\;t_0 \cdot \left(x_m \cdot t_0\right)\\
\end{array}\right)
\end{array}
\end{array}
if z < 1e-175Initial program 81.7%
*-commutative81.7%
associate-*l/79.9%
*-commutative79.9%
sqr-neg79.9%
*-commutative79.9%
distribute-rgt1-in61.4%
sqr-neg61.4%
fma-def79.9%
sqr-neg79.9%
cube-unmult79.9%
Simplified79.9%
fma-def61.4%
associate-*r/63.9%
*-commutative63.9%
cube-mult64.0%
distribute-rgt1-in81.7%
*-commutative81.7%
frac-times85.4%
associate-/r*93.3%
frac-2neg93.3%
frac-times97.7%
distribute-neg-in97.7%
metadata-eval97.7%
Applied egg-rr97.7%
if 1e-175 < z Initial program 87.6%
*-commutative87.6%
distribute-rgt1-in87.6%
cube-mult87.6%
associate-*r/91.8%
*-commutative91.8%
add-sqr-sqrt62.2%
associate-*l*62.3%
sqrt-div38.5%
sqr-pow38.6%
hypot-def38.6%
metadata-eval38.6%
Applied egg-rr39.8%
Final simplification71.7%
x_m = (fabs.f64 x)
x_s = (copysign.f64 1 x)
y_m = (fabs.f64 y)
y_s = (copysign.f64 1 y)
NOTE: x_m, y_m, and z should be sorted in increasing order before calling this function.
(FPCore (y_s x_s x_m y_m z)
:precision binary64
(*
y_s
(*
x_s
(if (<= (/ (* y_m x_m) (* (* z z) (+ z 1.0))) 1e+308)
(* (/ 1.0 z) (/ (* y_m x_m) (+ z (pow z 2.0))))
(* (/ y_m z) (/ (/ x_m (+ z 1.0)) z))))))x_m = fabs(x);
x_s = copysign(1.0, x);
y_m = fabs(y);
y_s = copysign(1.0, y);
assert(x_m < y_m && y_m < z);
double code(double y_s, double x_s, double x_m, double y_m, double z) {
double tmp;
if (((y_m * x_m) / ((z * z) * (z + 1.0))) <= 1e+308) {
tmp = (1.0 / z) * ((y_m * x_m) / (z + pow(z, 2.0)));
} else {
tmp = (y_m / z) * ((x_m / (z + 1.0)) / z);
}
return y_s * (x_s * tmp);
}
x_m = abs(x)
x_s = copysign(1.0d0, x)
y_m = abs(y)
y_s = copysign(1.0d0, y)
NOTE: x_m, y_m, and z should be sorted in increasing order before calling this function.
real(8) function code(y_s, x_s, x_m, y_m, z)
real(8), intent (in) :: y_s
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y_m
real(8), intent (in) :: z
real(8) :: tmp
if (((y_m * x_m) / ((z * z) * (z + 1.0d0))) <= 1d+308) then
tmp = (1.0d0 / z) * ((y_m * x_m) / (z + (z ** 2.0d0)))
else
tmp = (y_m / z) * ((x_m / (z + 1.0d0)) / z)
end if
code = y_s * (x_s * tmp)
end function
x_m = Math.abs(x);
x_s = Math.copySign(1.0, x);
y_m = Math.abs(y);
y_s = Math.copySign(1.0, y);
assert x_m < y_m && y_m < z;
public static double code(double y_s, double x_s, double x_m, double y_m, double z) {
double tmp;
if (((y_m * x_m) / ((z * z) * (z + 1.0))) <= 1e+308) {
tmp = (1.0 / z) * ((y_m * x_m) / (z + Math.pow(z, 2.0)));
} else {
tmp = (y_m / z) * ((x_m / (z + 1.0)) / z);
}
return y_s * (x_s * tmp);
}
x_m = math.fabs(x) x_s = math.copysign(1.0, x) y_m = math.fabs(y) y_s = math.copysign(1.0, y) [x_m, y_m, z] = sort([x_m, y_m, z]) def code(y_s, x_s, x_m, y_m, z): tmp = 0 if ((y_m * x_m) / ((z * z) * (z + 1.0))) <= 1e+308: tmp = (1.0 / z) * ((y_m * x_m) / (z + math.pow(z, 2.0))) else: tmp = (y_m / z) * ((x_m / (z + 1.0)) / z) return y_s * (x_s * tmp)
x_m = abs(x) x_s = copysign(1.0, x) y_m = abs(y) y_s = copysign(1.0, y) x_m, y_m, z = sort([x_m, y_m, z]) function code(y_s, x_s, x_m, y_m, z) tmp = 0.0 if (Float64(Float64(y_m * x_m) / Float64(Float64(z * z) * Float64(z + 1.0))) <= 1e+308) tmp = Float64(Float64(1.0 / z) * Float64(Float64(y_m * x_m) / Float64(z + (z ^ 2.0)))); else tmp = Float64(Float64(y_m / z) * Float64(Float64(x_m / Float64(z + 1.0)) / z)); end return Float64(y_s * Float64(x_s * tmp)) end
x_m = abs(x);
x_s = sign(x) * abs(1.0);
y_m = abs(y);
y_s = sign(y) * abs(1.0);
x_m, y_m, z = num2cell(sort([x_m, y_m, z])){:}
function tmp_2 = code(y_s, x_s, x_m, y_m, z)
tmp = 0.0;
if (((y_m * x_m) / ((z * z) * (z + 1.0))) <= 1e+308)
tmp = (1.0 / z) * ((y_m * x_m) / (z + (z ^ 2.0)));
else
tmp = (y_m / z) * ((x_m / (z + 1.0)) / z);
end
tmp_2 = y_s * (x_s * tmp);
end
x_m = N[Abs[x], $MachinePrecision]
x_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
y_m = N[Abs[y], $MachinePrecision]
y_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x_m, y_m, and z should be sorted in increasing order before calling this function.
code[y$95$s_, x$95$s_, x$95$m_, y$95$m_, z_] := N[(y$95$s * N[(x$95$s * If[LessEqual[N[(N[(y$95$m * x$95$m), $MachinePrecision] / N[(N[(z * z), $MachinePrecision] * N[(z + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1e+308], N[(N[(1.0 / z), $MachinePrecision] * N[(N[(y$95$m * x$95$m), $MachinePrecision] / N[(z + N[Power[z, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y$95$m / z), $MachinePrecision] * N[(N[(x$95$m / N[(z + 1.0), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
x_m = \left|x\right|
\\
x_s = \mathsf{copysign}\left(1, x\right)
\\
y_m = \left|y\right|
\\
y_s = \mathsf{copysign}\left(1, y\right)
\\
[x_m, y_m, z] = \mathsf{sort}([x_m, y_m, z])\\
\\
y_s \cdot \left(x_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{y_m \cdot x_m}{\left(z \cdot z\right) \cdot \left(z + 1\right)} \leq 10^{+308}:\\
\;\;\;\;\frac{1}{z} \cdot \frac{y_m \cdot x_m}{z + {z}^{2}}\\
\mathbf{else}:\\
\;\;\;\;\frac{y_m}{z} \cdot \frac{\frac{x_m}{z + 1}}{z}\\
\end{array}\right)
\end{array}
if (/.f64 (*.f64 x y) (*.f64 (*.f64 z z) (+.f64 z 1))) < 1e308Initial program 92.1%
associate-*l*92.1%
*-un-lft-identity92.1%
times-frac97.8%
*-commutative97.8%
+-commutative97.8%
distribute-lft-in97.8%
*-rgt-identity97.8%
pow297.8%
Applied egg-rr97.8%
if 1e308 < (/.f64 (*.f64 x y) (*.f64 (*.f64 z z) (+.f64 z 1))) Initial program 58.4%
*-commutative58.4%
frac-times72.4%
associate-*l/72.1%
times-frac99.7%
Applied egg-rr99.7%
Final simplification98.2%
x_m = (fabs.f64 x)
x_s = (copysign.f64 1 x)
y_m = (fabs.f64 y)
y_s = (copysign.f64 1 y)
NOTE: x_m, y_m, and z should be sorted in increasing order before calling this function.
(FPCore (y_s x_s x_m y_m z)
:precision binary64
(*
y_s
(*
x_s
(if (<= (/ (* y_m x_m) (* (* z z) (+ z 1.0))) 2e+195)
(- (/ (* (/ y_m z) x_m) (* z (- -1.0 z))))
(* (/ y_m z) (/ (/ x_m (+ z 1.0)) z))))))x_m = fabs(x);
x_s = copysign(1.0, x);
y_m = fabs(y);
y_s = copysign(1.0, y);
assert(x_m < y_m && y_m < z);
double code(double y_s, double x_s, double x_m, double y_m, double z) {
double tmp;
if (((y_m * x_m) / ((z * z) * (z + 1.0))) <= 2e+195) {
tmp = -(((y_m / z) * x_m) / (z * (-1.0 - z)));
} else {
tmp = (y_m / z) * ((x_m / (z + 1.0)) / z);
}
return y_s * (x_s * tmp);
}
x_m = abs(x)
x_s = copysign(1.0d0, x)
y_m = abs(y)
y_s = copysign(1.0d0, y)
NOTE: x_m, y_m, and z should be sorted in increasing order before calling this function.
real(8) function code(y_s, x_s, x_m, y_m, z)
real(8), intent (in) :: y_s
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y_m
real(8), intent (in) :: z
real(8) :: tmp
if (((y_m * x_m) / ((z * z) * (z + 1.0d0))) <= 2d+195) then
tmp = -(((y_m / z) * x_m) / (z * ((-1.0d0) - z)))
else
tmp = (y_m / z) * ((x_m / (z + 1.0d0)) / z)
end if
code = y_s * (x_s * tmp)
end function
x_m = Math.abs(x);
x_s = Math.copySign(1.0, x);
y_m = Math.abs(y);
y_s = Math.copySign(1.0, y);
assert x_m < y_m && y_m < z;
public static double code(double y_s, double x_s, double x_m, double y_m, double z) {
double tmp;
if (((y_m * x_m) / ((z * z) * (z + 1.0))) <= 2e+195) {
tmp = -(((y_m / z) * x_m) / (z * (-1.0 - z)));
} else {
tmp = (y_m / z) * ((x_m / (z + 1.0)) / z);
}
return y_s * (x_s * tmp);
}
x_m = math.fabs(x) x_s = math.copysign(1.0, x) y_m = math.fabs(y) y_s = math.copysign(1.0, y) [x_m, y_m, z] = sort([x_m, y_m, z]) def code(y_s, x_s, x_m, y_m, z): tmp = 0 if ((y_m * x_m) / ((z * z) * (z + 1.0))) <= 2e+195: tmp = -(((y_m / z) * x_m) / (z * (-1.0 - z))) else: tmp = (y_m / z) * ((x_m / (z + 1.0)) / z) return y_s * (x_s * tmp)
x_m = abs(x) x_s = copysign(1.0, x) y_m = abs(y) y_s = copysign(1.0, y) x_m, y_m, z = sort([x_m, y_m, z]) function code(y_s, x_s, x_m, y_m, z) tmp = 0.0 if (Float64(Float64(y_m * x_m) / Float64(Float64(z * z) * Float64(z + 1.0))) <= 2e+195) tmp = Float64(-Float64(Float64(Float64(y_m / z) * x_m) / Float64(z * Float64(-1.0 - z)))); else tmp = Float64(Float64(y_m / z) * Float64(Float64(x_m / Float64(z + 1.0)) / z)); end return Float64(y_s * Float64(x_s * tmp)) end
x_m = abs(x);
x_s = sign(x) * abs(1.0);
y_m = abs(y);
y_s = sign(y) * abs(1.0);
x_m, y_m, z = num2cell(sort([x_m, y_m, z])){:}
function tmp_2 = code(y_s, x_s, x_m, y_m, z)
tmp = 0.0;
if (((y_m * x_m) / ((z * z) * (z + 1.0))) <= 2e+195)
tmp = -(((y_m / z) * x_m) / (z * (-1.0 - z)));
else
tmp = (y_m / z) * ((x_m / (z + 1.0)) / z);
end
tmp_2 = y_s * (x_s * tmp);
end
x_m = N[Abs[x], $MachinePrecision]
x_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
y_m = N[Abs[y], $MachinePrecision]
y_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x_m, y_m, and z should be sorted in increasing order before calling this function.
code[y$95$s_, x$95$s_, x$95$m_, y$95$m_, z_] := N[(y$95$s * N[(x$95$s * If[LessEqual[N[(N[(y$95$m * x$95$m), $MachinePrecision] / N[(N[(z * z), $MachinePrecision] * N[(z + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2e+195], (-N[(N[(N[(y$95$m / z), $MachinePrecision] * x$95$m), $MachinePrecision] / N[(z * N[(-1.0 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), N[(N[(y$95$m / z), $MachinePrecision] * N[(N[(x$95$m / N[(z + 1.0), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
x_m = \left|x\right|
\\
x_s = \mathsf{copysign}\left(1, x\right)
\\
y_m = \left|y\right|
\\
y_s = \mathsf{copysign}\left(1, y\right)
\\
[x_m, y_m, z] = \mathsf{sort}([x_m, y_m, z])\\
\\
y_s \cdot \left(x_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{y_m \cdot x_m}{\left(z \cdot z\right) \cdot \left(z + 1\right)} \leq 2 \cdot 10^{+195}:\\
\;\;\;\;-\frac{\frac{y_m}{z} \cdot x_m}{z \cdot \left(-1 - z\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{y_m}{z} \cdot \frac{\frac{x_m}{z + 1}}{z}\\
\end{array}\right)
\end{array}
if (/.f64 (*.f64 x y) (*.f64 (*.f64 z z) (+.f64 z 1))) < 1.99999999999999995e195Initial program 91.7%
*-commutative91.7%
associate-*l/91.0%
*-commutative91.0%
sqr-neg91.0%
*-commutative91.0%
distribute-rgt1-in77.7%
sqr-neg77.7%
fma-def91.1%
sqr-neg91.1%
cube-unmult91.1%
Simplified91.1%
fma-def77.7%
associate-*r/78.3%
*-commutative78.3%
cube-mult78.4%
distribute-rgt1-in91.7%
*-commutative91.7%
frac-times94.8%
associate-/r*96.4%
frac-2neg96.4%
frac-times98.0%
distribute-neg-in98.0%
metadata-eval98.0%
Applied egg-rr98.0%
if 1.99999999999999995e195 < (/.f64 (*.f64 x y) (*.f64 (*.f64 z z) (+.f64 z 1))) Initial program 64.4%
*-commutative64.4%
frac-times75.1%
associate-*l/76.1%
times-frac98.5%
Applied egg-rr98.5%
Final simplification98.1%
x_m = (fabs.f64 x)
x_s = (copysign.f64 1 x)
y_m = (fabs.f64 y)
y_s = (copysign.f64 1 y)
NOTE: x_m, y_m, and z should be sorted in increasing order before calling this function.
(FPCore (y_s x_s x_m y_m z)
:precision binary64
(let* ((t_0 (/ x_m (+ z 1.0))))
(*
y_s
(*
x_s
(if (<= (/ (* y_m x_m) (* (* z z) (+ z 1.0))) 1e+308)
(/ (/ (* y_m t_0) z) z)
(* (/ y_m z) (/ t_0 z)))))))x_m = fabs(x);
x_s = copysign(1.0, x);
y_m = fabs(y);
y_s = copysign(1.0, y);
assert(x_m < y_m && y_m < z);
double code(double y_s, double x_s, double x_m, double y_m, double z) {
double t_0 = x_m / (z + 1.0);
double tmp;
if (((y_m * x_m) / ((z * z) * (z + 1.0))) <= 1e+308) {
tmp = ((y_m * t_0) / z) / z;
} else {
tmp = (y_m / z) * (t_0 / z);
}
return y_s * (x_s * tmp);
}
x_m = abs(x)
x_s = copysign(1.0d0, x)
y_m = abs(y)
y_s = copysign(1.0d0, y)
NOTE: x_m, y_m, and z should be sorted in increasing order before calling this function.
real(8) function code(y_s, x_s, x_m, y_m, z)
real(8), intent (in) :: y_s
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y_m
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = x_m / (z + 1.0d0)
if (((y_m * x_m) / ((z * z) * (z + 1.0d0))) <= 1d+308) then
tmp = ((y_m * t_0) / z) / z
else
tmp = (y_m / z) * (t_0 / z)
end if
code = y_s * (x_s * tmp)
end function
x_m = Math.abs(x);
x_s = Math.copySign(1.0, x);
y_m = Math.abs(y);
y_s = Math.copySign(1.0, y);
assert x_m < y_m && y_m < z;
public static double code(double y_s, double x_s, double x_m, double y_m, double z) {
double t_0 = x_m / (z + 1.0);
double tmp;
if (((y_m * x_m) / ((z * z) * (z + 1.0))) <= 1e+308) {
tmp = ((y_m * t_0) / z) / z;
} else {
tmp = (y_m / z) * (t_0 / z);
}
return y_s * (x_s * tmp);
}
x_m = math.fabs(x) x_s = math.copysign(1.0, x) y_m = math.fabs(y) y_s = math.copysign(1.0, y) [x_m, y_m, z] = sort([x_m, y_m, z]) def code(y_s, x_s, x_m, y_m, z): t_0 = x_m / (z + 1.0) tmp = 0 if ((y_m * x_m) / ((z * z) * (z + 1.0))) <= 1e+308: tmp = ((y_m * t_0) / z) / z else: tmp = (y_m / z) * (t_0 / z) return y_s * (x_s * tmp)
x_m = abs(x) x_s = copysign(1.0, x) y_m = abs(y) y_s = copysign(1.0, y) x_m, y_m, z = sort([x_m, y_m, z]) function code(y_s, x_s, x_m, y_m, z) t_0 = Float64(x_m / Float64(z + 1.0)) tmp = 0.0 if (Float64(Float64(y_m * x_m) / Float64(Float64(z * z) * Float64(z + 1.0))) <= 1e+308) tmp = Float64(Float64(Float64(y_m * t_0) / z) / z); else tmp = Float64(Float64(y_m / z) * Float64(t_0 / z)); end return Float64(y_s * Float64(x_s * tmp)) end
x_m = abs(x);
x_s = sign(x) * abs(1.0);
y_m = abs(y);
y_s = sign(y) * abs(1.0);
x_m, y_m, z = num2cell(sort([x_m, y_m, z])){:}
function tmp_2 = code(y_s, x_s, x_m, y_m, z)
t_0 = x_m / (z + 1.0);
tmp = 0.0;
if (((y_m * x_m) / ((z * z) * (z + 1.0))) <= 1e+308)
tmp = ((y_m * t_0) / z) / z;
else
tmp = (y_m / z) * (t_0 / z);
end
tmp_2 = y_s * (x_s * tmp);
end
x_m = N[Abs[x], $MachinePrecision]
x_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
y_m = N[Abs[y], $MachinePrecision]
y_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x_m, y_m, and z should be sorted in increasing order before calling this function.
code[y$95$s_, x$95$s_, x$95$m_, y$95$m_, z_] := Block[{t$95$0 = N[(x$95$m / N[(z + 1.0), $MachinePrecision]), $MachinePrecision]}, N[(y$95$s * N[(x$95$s * If[LessEqual[N[(N[(y$95$m * x$95$m), $MachinePrecision] / N[(N[(z * z), $MachinePrecision] * N[(z + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1e+308], N[(N[(N[(y$95$m * t$95$0), $MachinePrecision] / z), $MachinePrecision] / z), $MachinePrecision], N[(N[(y$95$m / z), $MachinePrecision] * N[(t$95$0 / z), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
x_m = \left|x\right|
\\
x_s = \mathsf{copysign}\left(1, x\right)
\\
y_m = \left|y\right|
\\
y_s = \mathsf{copysign}\left(1, y\right)
\\
[x_m, y_m, z] = \mathsf{sort}([x_m, y_m, z])\\
\\
\begin{array}{l}
t_0 := \frac{x_m}{z + 1}\\
y_s \cdot \left(x_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{y_m \cdot x_m}{\left(z \cdot z\right) \cdot \left(z + 1\right)} \leq 10^{+308}:\\
\;\;\;\;\frac{\frac{y_m \cdot t_0}{z}}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{y_m}{z} \cdot \frac{t_0}{z}\\
\end{array}\right)
\end{array}
\end{array}
if (/.f64 (*.f64 x y) (*.f64 (*.f64 z z) (+.f64 z 1))) < 1e308Initial program 92.1%
*-commutative92.1%
associate-*l/91.0%
*-commutative91.0%
sqr-neg91.0%
*-commutative91.0%
distribute-rgt1-in78.4%
sqr-neg78.4%
fma-def91.1%
sqr-neg91.1%
cube-unmult91.1%
Simplified91.1%
fma-def78.4%
associate-*r/79.4%
*-commutative79.4%
cube-mult79.4%
distribute-rgt1-in92.1%
*-commutative92.1%
frac-times94.6%
associate-*l/95.6%
associate-/r*97.0%
Applied egg-rr97.0%
if 1e308 < (/.f64 (*.f64 x y) (*.f64 (*.f64 z z) (+.f64 z 1))) Initial program 58.4%
*-commutative58.4%
frac-times72.4%
associate-*l/72.1%
times-frac99.7%
Applied egg-rr99.7%
Final simplification97.6%
x_m = (fabs.f64 x)
x_s = (copysign.f64 1 x)
y_m = (fabs.f64 y)
y_s = (copysign.f64 1 y)
NOTE: x_m, y_m, and z should be sorted in increasing order before calling this function.
(FPCore (y_s x_s x_m y_m z)
:precision binary64
(*
y_s
(*
x_s
(if (or (<= z -1.0) (not (<= z 0.058)))
(* (/ y_m z) (/ (/ x_m z) z))
(/ (* y_m (/ x_m z)) z)))))x_m = fabs(x);
x_s = copysign(1.0, x);
y_m = fabs(y);
y_s = copysign(1.0, y);
assert(x_m < y_m && y_m < z);
double code(double y_s, double x_s, double x_m, double y_m, double z) {
double tmp;
if ((z <= -1.0) || !(z <= 0.058)) {
tmp = (y_m / z) * ((x_m / z) / z);
} else {
tmp = (y_m * (x_m / z)) / z;
}
return y_s * (x_s * tmp);
}
x_m = abs(x)
x_s = copysign(1.0d0, x)
y_m = abs(y)
y_s = copysign(1.0d0, y)
NOTE: x_m, y_m, and z should be sorted in increasing order before calling this function.
real(8) function code(y_s, x_s, x_m, y_m, z)
real(8), intent (in) :: y_s
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y_m
real(8), intent (in) :: z
real(8) :: tmp
if ((z <= (-1.0d0)) .or. (.not. (z <= 0.058d0))) then
tmp = (y_m / z) * ((x_m / z) / z)
else
tmp = (y_m * (x_m / z)) / z
end if
code = y_s * (x_s * tmp)
end function
x_m = Math.abs(x);
x_s = Math.copySign(1.0, x);
y_m = Math.abs(y);
y_s = Math.copySign(1.0, y);
assert x_m < y_m && y_m < z;
public static double code(double y_s, double x_s, double x_m, double y_m, double z) {
double tmp;
if ((z <= -1.0) || !(z <= 0.058)) {
tmp = (y_m / z) * ((x_m / z) / z);
} else {
tmp = (y_m * (x_m / z)) / z;
}
return y_s * (x_s * tmp);
}
x_m = math.fabs(x) x_s = math.copysign(1.0, x) y_m = math.fabs(y) y_s = math.copysign(1.0, y) [x_m, y_m, z] = sort([x_m, y_m, z]) def code(y_s, x_s, x_m, y_m, z): tmp = 0 if (z <= -1.0) or not (z <= 0.058): tmp = (y_m / z) * ((x_m / z) / z) else: tmp = (y_m * (x_m / z)) / z return y_s * (x_s * tmp)
x_m = abs(x) x_s = copysign(1.0, x) y_m = abs(y) y_s = copysign(1.0, y) x_m, y_m, z = sort([x_m, y_m, z]) function code(y_s, x_s, x_m, y_m, z) tmp = 0.0 if ((z <= -1.0) || !(z <= 0.058)) tmp = Float64(Float64(y_m / z) * Float64(Float64(x_m / z) / z)); else tmp = Float64(Float64(y_m * Float64(x_m / z)) / z); end return Float64(y_s * Float64(x_s * tmp)) end
x_m = abs(x);
x_s = sign(x) * abs(1.0);
y_m = abs(y);
y_s = sign(y) * abs(1.0);
x_m, y_m, z = num2cell(sort([x_m, y_m, z])){:}
function tmp_2 = code(y_s, x_s, x_m, y_m, z)
tmp = 0.0;
if ((z <= -1.0) || ~((z <= 0.058)))
tmp = (y_m / z) * ((x_m / z) / z);
else
tmp = (y_m * (x_m / z)) / z;
end
tmp_2 = y_s * (x_s * tmp);
end
x_m = N[Abs[x], $MachinePrecision]
x_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
y_m = N[Abs[y], $MachinePrecision]
y_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x_m, y_m, and z should be sorted in increasing order before calling this function.
code[y$95$s_, x$95$s_, x$95$m_, y$95$m_, z_] := N[(y$95$s * N[(x$95$s * If[Or[LessEqual[z, -1.0], N[Not[LessEqual[z, 0.058]], $MachinePrecision]], N[(N[(y$95$m / z), $MachinePrecision] * N[(N[(x$95$m / z), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], N[(N[(y$95$m * N[(x$95$m / z), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
x_m = \left|x\right|
\\
x_s = \mathsf{copysign}\left(1, x\right)
\\
y_m = \left|y\right|
\\
y_s = \mathsf{copysign}\left(1, y\right)
\\
[x_m, y_m, z] = \mathsf{sort}([x_m, y_m, z])\\
\\
y_s \cdot \left(x_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -1 \lor \neg \left(z \leq 0.058\right):\\
\;\;\;\;\frac{y_m}{z} \cdot \frac{\frac{x_m}{z}}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{y_m \cdot \frac{x_m}{z}}{z}\\
\end{array}\right)
\end{array}
if z < -1 or 0.0580000000000000029 < z Initial program 83.2%
*-commutative83.2%
frac-times93.1%
associate-*l/94.3%
times-frac95.2%
Applied egg-rr95.2%
Taylor expanded in z around inf 93.8%
if -1 < z < 0.0580000000000000029Initial program 85.6%
*-commutative85.6%
associate-*l/85.4%
*-commutative85.4%
sqr-neg85.4%
*-commutative85.4%
distribute-rgt1-in85.4%
sqr-neg85.4%
fma-def85.5%
sqr-neg85.5%
cube-unmult85.5%
Simplified85.5%
fma-def85.4%
associate-*r/85.6%
*-commutative85.6%
cube-mult85.6%
distribute-rgt1-in85.6%
*-commutative85.6%
frac-times85.4%
associate-*l/85.7%
associate-/r*94.6%
Applied egg-rr94.6%
Taylor expanded in z around 0 87.6%
associate-*r*87.6%
associate-*l/89.7%
distribute-rgt-out95.5%
+-commutative95.5%
mul-1-neg95.5%
unsub-neg95.5%
Simplified95.5%
Taylor expanded in z around 0 92.6%
associate-*l/94.6%
*-commutative94.6%
Simplified94.6%
Final simplification94.2%
x_m = (fabs.f64 x)
x_s = (copysign.f64 1 x)
y_m = (fabs.f64 y)
y_s = (copysign.f64 1 y)
NOTE: x_m, y_m, and z should be sorted in increasing order before calling this function.
(FPCore (y_s x_s x_m y_m z)
:precision binary64
(*
y_s
(*
x_s
(if (<= z -1.0)
(* (/ x_m z) (/ y_m (* z z)))
(if (<= z 0.058)
(/ (* y_m (/ x_m z)) z)
(* (/ y_m z) (/ (/ x_m z) z)))))))x_m = fabs(x);
x_s = copysign(1.0, x);
y_m = fabs(y);
y_s = copysign(1.0, y);
assert(x_m < y_m && y_m < z);
double code(double y_s, double x_s, double x_m, double y_m, double z) {
double tmp;
if (z <= -1.0) {
tmp = (x_m / z) * (y_m / (z * z));
} else if (z <= 0.058) {
tmp = (y_m * (x_m / z)) / z;
} else {
tmp = (y_m / z) * ((x_m / z) / z);
}
return y_s * (x_s * tmp);
}
x_m = abs(x)
x_s = copysign(1.0d0, x)
y_m = abs(y)
y_s = copysign(1.0d0, y)
NOTE: x_m, y_m, and z should be sorted in increasing order before calling this function.
real(8) function code(y_s, x_s, x_m, y_m, z)
real(8), intent (in) :: y_s
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y_m
real(8), intent (in) :: z
real(8) :: tmp
if (z <= (-1.0d0)) then
tmp = (x_m / z) * (y_m / (z * z))
else if (z <= 0.058d0) then
tmp = (y_m * (x_m / z)) / z
else
tmp = (y_m / z) * ((x_m / z) / z)
end if
code = y_s * (x_s * tmp)
end function
x_m = Math.abs(x);
x_s = Math.copySign(1.0, x);
y_m = Math.abs(y);
y_s = Math.copySign(1.0, y);
assert x_m < y_m && y_m < z;
public static double code(double y_s, double x_s, double x_m, double y_m, double z) {
double tmp;
if (z <= -1.0) {
tmp = (x_m / z) * (y_m / (z * z));
} else if (z <= 0.058) {
tmp = (y_m * (x_m / z)) / z;
} else {
tmp = (y_m / z) * ((x_m / z) / z);
}
return y_s * (x_s * tmp);
}
x_m = math.fabs(x) x_s = math.copysign(1.0, x) y_m = math.fabs(y) y_s = math.copysign(1.0, y) [x_m, y_m, z] = sort([x_m, y_m, z]) def code(y_s, x_s, x_m, y_m, z): tmp = 0 if z <= -1.0: tmp = (x_m / z) * (y_m / (z * z)) elif z <= 0.058: tmp = (y_m * (x_m / z)) / z else: tmp = (y_m / z) * ((x_m / z) / z) return y_s * (x_s * tmp)
x_m = abs(x) x_s = copysign(1.0, x) y_m = abs(y) y_s = copysign(1.0, y) x_m, y_m, z = sort([x_m, y_m, z]) function code(y_s, x_s, x_m, y_m, z) tmp = 0.0 if (z <= -1.0) tmp = Float64(Float64(x_m / z) * Float64(y_m / Float64(z * z))); elseif (z <= 0.058) tmp = Float64(Float64(y_m * Float64(x_m / z)) / z); else tmp = Float64(Float64(y_m / z) * Float64(Float64(x_m / z) / z)); end return Float64(y_s * Float64(x_s * tmp)) end
x_m = abs(x);
x_s = sign(x) * abs(1.0);
y_m = abs(y);
y_s = sign(y) * abs(1.0);
x_m, y_m, z = num2cell(sort([x_m, y_m, z])){:}
function tmp_2 = code(y_s, x_s, x_m, y_m, z)
tmp = 0.0;
if (z <= -1.0)
tmp = (x_m / z) * (y_m / (z * z));
elseif (z <= 0.058)
tmp = (y_m * (x_m / z)) / z;
else
tmp = (y_m / z) * ((x_m / z) / z);
end
tmp_2 = y_s * (x_s * tmp);
end
x_m = N[Abs[x], $MachinePrecision]
x_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
y_m = N[Abs[y], $MachinePrecision]
y_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x_m, y_m, and z should be sorted in increasing order before calling this function.
code[y$95$s_, x$95$s_, x$95$m_, y$95$m_, z_] := N[(y$95$s * N[(x$95$s * If[LessEqual[z, -1.0], N[(N[(x$95$m / z), $MachinePrecision] * N[(y$95$m / N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 0.058], N[(N[(y$95$m * N[(x$95$m / z), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], N[(N[(y$95$m / z), $MachinePrecision] * N[(N[(x$95$m / z), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
x_m = \left|x\right|
\\
x_s = \mathsf{copysign}\left(1, x\right)
\\
y_m = \left|y\right|
\\
y_s = \mathsf{copysign}\left(1, y\right)
\\
[x_m, y_m, z] = \mathsf{sort}([x_m, y_m, z])\\
\\
y_s \cdot \left(x_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -1:\\
\;\;\;\;\frac{x_m}{z} \cdot \frac{y_m}{z \cdot z}\\
\mathbf{elif}\;z \leq 0.058:\\
\;\;\;\;\frac{y_m \cdot \frac{x_m}{z}}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{y_m}{z} \cdot \frac{\frac{x_m}{z}}{z}\\
\end{array}\right)
\end{array}
if z < -1Initial program 81.3%
sqr-neg81.3%
*-commutative81.3%
times-frac92.3%
sqr-neg92.3%
Simplified92.3%
Taylor expanded in z around inf 89.3%
if -1 < z < 0.0580000000000000029Initial program 85.6%
*-commutative85.6%
associate-*l/85.4%
*-commutative85.4%
sqr-neg85.4%
*-commutative85.4%
distribute-rgt1-in85.4%
sqr-neg85.4%
fma-def85.5%
sqr-neg85.5%
cube-unmult85.5%
Simplified85.5%
fma-def85.4%
associate-*r/85.6%
*-commutative85.6%
cube-mult85.6%
distribute-rgt1-in85.6%
*-commutative85.6%
frac-times85.4%
associate-*l/85.7%
associate-/r*94.6%
Applied egg-rr94.6%
Taylor expanded in z around 0 87.6%
associate-*r*87.6%
associate-*l/89.7%
distribute-rgt-out95.5%
+-commutative95.5%
mul-1-neg95.5%
unsub-neg95.5%
Simplified95.5%
Taylor expanded in z around 0 92.6%
associate-*l/94.6%
*-commutative94.6%
Simplified94.6%
if 0.0580000000000000029 < z Initial program 84.8%
*-commutative84.8%
frac-times93.8%
associate-*l/92.3%
times-frac97.8%
Applied egg-rr97.8%
Taylor expanded in z around inf 97.8%
Final simplification94.2%
x_m = (fabs.f64 x)
x_s = (copysign.f64 1 x)
y_m = (fabs.f64 y)
y_s = (copysign.f64 1 y)
NOTE: x_m, y_m, and z should be sorted in increasing order before calling this function.
(FPCore (y_s x_s x_m y_m z)
:precision binary64
(*
y_s
(*
x_s
(if (<= z -1.0)
(* (/ x_m z) (/ y_m (* z z)))
(if (<= z 0.058)
(/ (* y_m (- (/ x_m z) x_m)) z)
(* (/ y_m z) (/ (/ x_m z) z)))))))x_m = fabs(x);
x_s = copysign(1.0, x);
y_m = fabs(y);
y_s = copysign(1.0, y);
assert(x_m < y_m && y_m < z);
double code(double y_s, double x_s, double x_m, double y_m, double z) {
double tmp;
if (z <= -1.0) {
tmp = (x_m / z) * (y_m / (z * z));
} else if (z <= 0.058) {
tmp = (y_m * ((x_m / z) - x_m)) / z;
} else {
tmp = (y_m / z) * ((x_m / z) / z);
}
return y_s * (x_s * tmp);
}
x_m = abs(x)
x_s = copysign(1.0d0, x)
y_m = abs(y)
y_s = copysign(1.0d0, y)
NOTE: x_m, y_m, and z should be sorted in increasing order before calling this function.
real(8) function code(y_s, x_s, x_m, y_m, z)
real(8), intent (in) :: y_s
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y_m
real(8), intent (in) :: z
real(8) :: tmp
if (z <= (-1.0d0)) then
tmp = (x_m / z) * (y_m / (z * z))
else if (z <= 0.058d0) then
tmp = (y_m * ((x_m / z) - x_m)) / z
else
tmp = (y_m / z) * ((x_m / z) / z)
end if
code = y_s * (x_s * tmp)
end function
x_m = Math.abs(x);
x_s = Math.copySign(1.0, x);
y_m = Math.abs(y);
y_s = Math.copySign(1.0, y);
assert x_m < y_m && y_m < z;
public static double code(double y_s, double x_s, double x_m, double y_m, double z) {
double tmp;
if (z <= -1.0) {
tmp = (x_m / z) * (y_m / (z * z));
} else if (z <= 0.058) {
tmp = (y_m * ((x_m / z) - x_m)) / z;
} else {
tmp = (y_m / z) * ((x_m / z) / z);
}
return y_s * (x_s * tmp);
}
x_m = math.fabs(x) x_s = math.copysign(1.0, x) y_m = math.fabs(y) y_s = math.copysign(1.0, y) [x_m, y_m, z] = sort([x_m, y_m, z]) def code(y_s, x_s, x_m, y_m, z): tmp = 0 if z <= -1.0: tmp = (x_m / z) * (y_m / (z * z)) elif z <= 0.058: tmp = (y_m * ((x_m / z) - x_m)) / z else: tmp = (y_m / z) * ((x_m / z) / z) return y_s * (x_s * tmp)
x_m = abs(x) x_s = copysign(1.0, x) y_m = abs(y) y_s = copysign(1.0, y) x_m, y_m, z = sort([x_m, y_m, z]) function code(y_s, x_s, x_m, y_m, z) tmp = 0.0 if (z <= -1.0) tmp = Float64(Float64(x_m / z) * Float64(y_m / Float64(z * z))); elseif (z <= 0.058) tmp = Float64(Float64(y_m * Float64(Float64(x_m / z) - x_m)) / z); else tmp = Float64(Float64(y_m / z) * Float64(Float64(x_m / z) / z)); end return Float64(y_s * Float64(x_s * tmp)) end
x_m = abs(x);
x_s = sign(x) * abs(1.0);
y_m = abs(y);
y_s = sign(y) * abs(1.0);
x_m, y_m, z = num2cell(sort([x_m, y_m, z])){:}
function tmp_2 = code(y_s, x_s, x_m, y_m, z)
tmp = 0.0;
if (z <= -1.0)
tmp = (x_m / z) * (y_m / (z * z));
elseif (z <= 0.058)
tmp = (y_m * ((x_m / z) - x_m)) / z;
else
tmp = (y_m / z) * ((x_m / z) / z);
end
tmp_2 = y_s * (x_s * tmp);
end
x_m = N[Abs[x], $MachinePrecision]
x_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
y_m = N[Abs[y], $MachinePrecision]
y_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x_m, y_m, and z should be sorted in increasing order before calling this function.
code[y$95$s_, x$95$s_, x$95$m_, y$95$m_, z_] := N[(y$95$s * N[(x$95$s * If[LessEqual[z, -1.0], N[(N[(x$95$m / z), $MachinePrecision] * N[(y$95$m / N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 0.058], N[(N[(y$95$m * N[(N[(x$95$m / z), $MachinePrecision] - x$95$m), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], N[(N[(y$95$m / z), $MachinePrecision] * N[(N[(x$95$m / z), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
x_m = \left|x\right|
\\
x_s = \mathsf{copysign}\left(1, x\right)
\\
y_m = \left|y\right|
\\
y_s = \mathsf{copysign}\left(1, y\right)
\\
[x_m, y_m, z] = \mathsf{sort}([x_m, y_m, z])\\
\\
y_s \cdot \left(x_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -1:\\
\;\;\;\;\frac{x_m}{z} \cdot \frac{y_m}{z \cdot z}\\
\mathbf{elif}\;z \leq 0.058:\\
\;\;\;\;\frac{y_m \cdot \left(\frac{x_m}{z} - x_m\right)}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{y_m}{z} \cdot \frac{\frac{x_m}{z}}{z}\\
\end{array}\right)
\end{array}
if z < -1Initial program 81.3%
sqr-neg81.3%
*-commutative81.3%
times-frac92.3%
sqr-neg92.3%
Simplified92.3%
Taylor expanded in z around inf 89.3%
if -1 < z < 0.0580000000000000029Initial program 85.6%
*-commutative85.6%
associate-*l/85.4%
*-commutative85.4%
sqr-neg85.4%
*-commutative85.4%
distribute-rgt1-in85.4%
sqr-neg85.4%
fma-def85.5%
sqr-neg85.5%
cube-unmult85.5%
Simplified85.5%
fma-def85.4%
associate-*r/85.6%
*-commutative85.6%
cube-mult85.6%
distribute-rgt1-in85.6%
*-commutative85.6%
frac-times85.4%
associate-*l/85.7%
associate-/r*94.6%
Applied egg-rr94.6%
Taylor expanded in z around 0 87.6%
associate-*r*87.6%
associate-*l/89.7%
distribute-rgt-out95.5%
+-commutative95.5%
mul-1-neg95.5%
unsub-neg95.5%
Simplified95.5%
if 0.0580000000000000029 < z Initial program 84.8%
*-commutative84.8%
frac-times93.8%
associate-*l/92.3%
times-frac97.8%
Applied egg-rr97.8%
Taylor expanded in z around inf 97.8%
Final simplification94.6%
x_m = (fabs.f64 x)
x_s = (copysign.f64 1 x)
y_m = (fabs.f64 y)
y_s = (copysign.f64 1 y)
NOTE: x_m, y_m, and z should be sorted in increasing order before calling this function.
(FPCore (y_s x_s x_m y_m z)
:precision binary64
(*
y_s
(*
x_s
(if (<= z -1.0)
(/ (* (/ y_m z) (/ x_m z)) z)
(if (<= z 0.058)
(/ (* y_m (- (/ x_m z) x_m)) z)
(* (/ y_m z) (/ (/ x_m z) z)))))))x_m = fabs(x);
x_s = copysign(1.0, x);
y_m = fabs(y);
y_s = copysign(1.0, y);
assert(x_m < y_m && y_m < z);
double code(double y_s, double x_s, double x_m, double y_m, double z) {
double tmp;
if (z <= -1.0) {
tmp = ((y_m / z) * (x_m / z)) / z;
} else if (z <= 0.058) {
tmp = (y_m * ((x_m / z) - x_m)) / z;
} else {
tmp = (y_m / z) * ((x_m / z) / z);
}
return y_s * (x_s * tmp);
}
x_m = abs(x)
x_s = copysign(1.0d0, x)
y_m = abs(y)
y_s = copysign(1.0d0, y)
NOTE: x_m, y_m, and z should be sorted in increasing order before calling this function.
real(8) function code(y_s, x_s, x_m, y_m, z)
real(8), intent (in) :: y_s
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y_m
real(8), intent (in) :: z
real(8) :: tmp
if (z <= (-1.0d0)) then
tmp = ((y_m / z) * (x_m / z)) / z
else if (z <= 0.058d0) then
tmp = (y_m * ((x_m / z) - x_m)) / z
else
tmp = (y_m / z) * ((x_m / z) / z)
end if
code = y_s * (x_s * tmp)
end function
x_m = Math.abs(x);
x_s = Math.copySign(1.0, x);
y_m = Math.abs(y);
y_s = Math.copySign(1.0, y);
assert x_m < y_m && y_m < z;
public static double code(double y_s, double x_s, double x_m, double y_m, double z) {
double tmp;
if (z <= -1.0) {
tmp = ((y_m / z) * (x_m / z)) / z;
} else if (z <= 0.058) {
tmp = (y_m * ((x_m / z) - x_m)) / z;
} else {
tmp = (y_m / z) * ((x_m / z) / z);
}
return y_s * (x_s * tmp);
}
x_m = math.fabs(x) x_s = math.copysign(1.0, x) y_m = math.fabs(y) y_s = math.copysign(1.0, y) [x_m, y_m, z] = sort([x_m, y_m, z]) def code(y_s, x_s, x_m, y_m, z): tmp = 0 if z <= -1.0: tmp = ((y_m / z) * (x_m / z)) / z elif z <= 0.058: tmp = (y_m * ((x_m / z) - x_m)) / z else: tmp = (y_m / z) * ((x_m / z) / z) return y_s * (x_s * tmp)
x_m = abs(x) x_s = copysign(1.0, x) y_m = abs(y) y_s = copysign(1.0, y) x_m, y_m, z = sort([x_m, y_m, z]) function code(y_s, x_s, x_m, y_m, z) tmp = 0.0 if (z <= -1.0) tmp = Float64(Float64(Float64(y_m / z) * Float64(x_m / z)) / z); elseif (z <= 0.058) tmp = Float64(Float64(y_m * Float64(Float64(x_m / z) - x_m)) / z); else tmp = Float64(Float64(y_m / z) * Float64(Float64(x_m / z) / z)); end return Float64(y_s * Float64(x_s * tmp)) end
x_m = abs(x);
x_s = sign(x) * abs(1.0);
y_m = abs(y);
y_s = sign(y) * abs(1.0);
x_m, y_m, z = num2cell(sort([x_m, y_m, z])){:}
function tmp_2 = code(y_s, x_s, x_m, y_m, z)
tmp = 0.0;
if (z <= -1.0)
tmp = ((y_m / z) * (x_m / z)) / z;
elseif (z <= 0.058)
tmp = (y_m * ((x_m / z) - x_m)) / z;
else
tmp = (y_m / z) * ((x_m / z) / z);
end
tmp_2 = y_s * (x_s * tmp);
end
x_m = N[Abs[x], $MachinePrecision]
x_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
y_m = N[Abs[y], $MachinePrecision]
y_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x_m, y_m, and z should be sorted in increasing order before calling this function.
code[y$95$s_, x$95$s_, x$95$m_, y$95$m_, z_] := N[(y$95$s * N[(x$95$s * If[LessEqual[z, -1.0], N[(N[(N[(y$95$m / z), $MachinePrecision] * N[(x$95$m / z), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[z, 0.058], N[(N[(y$95$m * N[(N[(x$95$m / z), $MachinePrecision] - x$95$m), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], N[(N[(y$95$m / z), $MachinePrecision] * N[(N[(x$95$m / z), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
x_m = \left|x\right|
\\
x_s = \mathsf{copysign}\left(1, x\right)
\\
y_m = \left|y\right|
\\
y_s = \mathsf{copysign}\left(1, y\right)
\\
[x_m, y_m, z] = \mathsf{sort}([x_m, y_m, z])\\
\\
y_s \cdot \left(x_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -1:\\
\;\;\;\;\frac{\frac{y_m}{z} \cdot \frac{x_m}{z}}{z}\\
\mathbf{elif}\;z \leq 0.058:\\
\;\;\;\;\frac{y_m \cdot \left(\frac{x_m}{z} - x_m\right)}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{y_m}{z} \cdot \frac{\frac{x_m}{z}}{z}\\
\end{array}\right)
\end{array}
if z < -1Initial program 81.3%
*-commutative81.3%
associate-*l/79.8%
*-commutative79.8%
sqr-neg79.8%
*-commutative79.8%
distribute-rgt1-in37.8%
sqr-neg37.8%
fma-def79.8%
sqr-neg79.8%
cube-unmult79.8%
Simplified79.8%
fma-def37.8%
associate-*r/41.0%
*-commutative41.0%
cube-mult41.0%
distribute-rgt1-in81.3%
*-commutative81.3%
frac-times92.3%
associate-*l/96.6%
associate-/r*96.7%
Applied egg-rr96.7%
Taylor expanded in z around inf 89.0%
associate-*r/93.6%
Simplified93.6%
*-commutative93.6%
associate-*r/93.6%
Applied egg-rr93.6%
if -1 < z < 0.0580000000000000029Initial program 85.6%
*-commutative85.6%
associate-*l/85.4%
*-commutative85.4%
sqr-neg85.4%
*-commutative85.4%
distribute-rgt1-in85.4%
sqr-neg85.4%
fma-def85.5%
sqr-neg85.5%
cube-unmult85.5%
Simplified85.5%
fma-def85.4%
associate-*r/85.6%
*-commutative85.6%
cube-mult85.6%
distribute-rgt1-in85.6%
*-commutative85.6%
frac-times85.4%
associate-*l/85.7%
associate-/r*94.6%
Applied egg-rr94.6%
Taylor expanded in z around 0 87.6%
associate-*r*87.6%
associate-*l/89.7%
distribute-rgt-out95.5%
+-commutative95.5%
mul-1-neg95.5%
unsub-neg95.5%
Simplified95.5%
if 0.0580000000000000029 < z Initial program 84.8%
*-commutative84.8%
frac-times93.8%
associate-*l/92.3%
times-frac97.8%
Applied egg-rr97.8%
Taylor expanded in z around inf 97.8%
Final simplification95.7%
x_m = (fabs.f64 x)
x_s = (copysign.f64 1 x)
y_m = (fabs.f64 y)
y_s = (copysign.f64 1 y)
NOTE: x_m, y_m, and z should be sorted in increasing order before calling this function.
(FPCore (y_s x_s x_m y_m z)
:precision binary64
(*
y_s
(*
x_s
(if (<= z -1.0)
(/ (/ (* (/ y_m z) x_m) z) z)
(if (<= z 0.058)
(/ (* y_m (- (/ x_m z) x_m)) z)
(* (/ y_m z) (/ (/ x_m z) z)))))))x_m = fabs(x);
x_s = copysign(1.0, x);
y_m = fabs(y);
y_s = copysign(1.0, y);
assert(x_m < y_m && y_m < z);
double code(double y_s, double x_s, double x_m, double y_m, double z) {
double tmp;
if (z <= -1.0) {
tmp = (((y_m / z) * x_m) / z) / z;
} else if (z <= 0.058) {
tmp = (y_m * ((x_m / z) - x_m)) / z;
} else {
tmp = (y_m / z) * ((x_m / z) / z);
}
return y_s * (x_s * tmp);
}
x_m = abs(x)
x_s = copysign(1.0d0, x)
y_m = abs(y)
y_s = copysign(1.0d0, y)
NOTE: x_m, y_m, and z should be sorted in increasing order before calling this function.
real(8) function code(y_s, x_s, x_m, y_m, z)
real(8), intent (in) :: y_s
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y_m
real(8), intent (in) :: z
real(8) :: tmp
if (z <= (-1.0d0)) then
tmp = (((y_m / z) * x_m) / z) / z
else if (z <= 0.058d0) then
tmp = (y_m * ((x_m / z) - x_m)) / z
else
tmp = (y_m / z) * ((x_m / z) / z)
end if
code = y_s * (x_s * tmp)
end function
x_m = Math.abs(x);
x_s = Math.copySign(1.0, x);
y_m = Math.abs(y);
y_s = Math.copySign(1.0, y);
assert x_m < y_m && y_m < z;
public static double code(double y_s, double x_s, double x_m, double y_m, double z) {
double tmp;
if (z <= -1.0) {
tmp = (((y_m / z) * x_m) / z) / z;
} else if (z <= 0.058) {
tmp = (y_m * ((x_m / z) - x_m)) / z;
} else {
tmp = (y_m / z) * ((x_m / z) / z);
}
return y_s * (x_s * tmp);
}
x_m = math.fabs(x) x_s = math.copysign(1.0, x) y_m = math.fabs(y) y_s = math.copysign(1.0, y) [x_m, y_m, z] = sort([x_m, y_m, z]) def code(y_s, x_s, x_m, y_m, z): tmp = 0 if z <= -1.0: tmp = (((y_m / z) * x_m) / z) / z elif z <= 0.058: tmp = (y_m * ((x_m / z) - x_m)) / z else: tmp = (y_m / z) * ((x_m / z) / z) return y_s * (x_s * tmp)
x_m = abs(x) x_s = copysign(1.0, x) y_m = abs(y) y_s = copysign(1.0, y) x_m, y_m, z = sort([x_m, y_m, z]) function code(y_s, x_s, x_m, y_m, z) tmp = 0.0 if (z <= -1.0) tmp = Float64(Float64(Float64(Float64(y_m / z) * x_m) / z) / z); elseif (z <= 0.058) tmp = Float64(Float64(y_m * Float64(Float64(x_m / z) - x_m)) / z); else tmp = Float64(Float64(y_m / z) * Float64(Float64(x_m / z) / z)); end return Float64(y_s * Float64(x_s * tmp)) end
x_m = abs(x);
x_s = sign(x) * abs(1.0);
y_m = abs(y);
y_s = sign(y) * abs(1.0);
x_m, y_m, z = num2cell(sort([x_m, y_m, z])){:}
function tmp_2 = code(y_s, x_s, x_m, y_m, z)
tmp = 0.0;
if (z <= -1.0)
tmp = (((y_m / z) * x_m) / z) / z;
elseif (z <= 0.058)
tmp = (y_m * ((x_m / z) - x_m)) / z;
else
tmp = (y_m / z) * ((x_m / z) / z);
end
tmp_2 = y_s * (x_s * tmp);
end
x_m = N[Abs[x], $MachinePrecision]
x_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
y_m = N[Abs[y], $MachinePrecision]
y_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x_m, y_m, and z should be sorted in increasing order before calling this function.
code[y$95$s_, x$95$s_, x$95$m_, y$95$m_, z_] := N[(y$95$s * N[(x$95$s * If[LessEqual[z, -1.0], N[(N[(N[(N[(y$95$m / z), $MachinePrecision] * x$95$m), $MachinePrecision] / z), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[z, 0.058], N[(N[(y$95$m * N[(N[(x$95$m / z), $MachinePrecision] - x$95$m), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], N[(N[(y$95$m / z), $MachinePrecision] * N[(N[(x$95$m / z), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
x_m = \left|x\right|
\\
x_s = \mathsf{copysign}\left(1, x\right)
\\
y_m = \left|y\right|
\\
y_s = \mathsf{copysign}\left(1, y\right)
\\
[x_m, y_m, z] = \mathsf{sort}([x_m, y_m, z])\\
\\
y_s \cdot \left(x_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -1:\\
\;\;\;\;\frac{\frac{\frac{y_m}{z} \cdot x_m}{z}}{z}\\
\mathbf{elif}\;z \leq 0.058:\\
\;\;\;\;\frac{y_m \cdot \left(\frac{x_m}{z} - x_m\right)}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{y_m}{z} \cdot \frac{\frac{x_m}{z}}{z}\\
\end{array}\right)
\end{array}
if z < -1Initial program 81.3%
*-commutative81.3%
associate-*l/79.8%
*-commutative79.8%
sqr-neg79.8%
*-commutative79.8%
distribute-rgt1-in37.8%
sqr-neg37.8%
fma-def79.8%
sqr-neg79.8%
cube-unmult79.8%
Simplified79.8%
fma-def37.8%
associate-*r/41.0%
*-commutative41.0%
cube-mult41.0%
distribute-rgt1-in81.3%
*-commutative81.3%
frac-times92.3%
associate-*l/96.6%
associate-/r*96.7%
Applied egg-rr96.7%
Taylor expanded in z around inf 89.0%
associate-*r/93.6%
Simplified93.6%
if -1 < z < 0.0580000000000000029Initial program 85.6%
*-commutative85.6%
associate-*l/85.4%
*-commutative85.4%
sqr-neg85.4%
*-commutative85.4%
distribute-rgt1-in85.4%
sqr-neg85.4%
fma-def85.5%
sqr-neg85.5%
cube-unmult85.5%
Simplified85.5%
fma-def85.4%
associate-*r/85.6%
*-commutative85.6%
cube-mult85.6%
distribute-rgt1-in85.6%
*-commutative85.6%
frac-times85.4%
associate-*l/85.7%
associate-/r*94.6%
Applied egg-rr94.6%
Taylor expanded in z around 0 87.6%
associate-*r*87.6%
associate-*l/89.7%
distribute-rgt-out95.5%
+-commutative95.5%
mul-1-neg95.5%
unsub-neg95.5%
Simplified95.5%
if 0.0580000000000000029 < z Initial program 84.8%
*-commutative84.8%
frac-times93.8%
associate-*l/92.3%
times-frac97.8%
Applied egg-rr97.8%
Taylor expanded in z around inf 97.8%
Final simplification95.7%
x_m = (fabs.f64 x)
x_s = (copysign.f64 1 x)
y_m = (fabs.f64 y)
y_s = (copysign.f64 1 y)
NOTE: x_m, y_m, and z should be sorted in increasing order before calling this function.
(FPCore (y_s x_s x_m y_m z)
:precision binary64
(*
y_s
(*
x_s
(if (<= z -8.2e+42)
(/ (/ (* (/ y_m z) x_m) z) z)
(* (/ y_m z) (/ (/ x_m (+ z 1.0)) z))))))x_m = fabs(x);
x_s = copysign(1.0, x);
y_m = fabs(y);
y_s = copysign(1.0, y);
assert(x_m < y_m && y_m < z);
double code(double y_s, double x_s, double x_m, double y_m, double z) {
double tmp;
if (z <= -8.2e+42) {
tmp = (((y_m / z) * x_m) / z) / z;
} else {
tmp = (y_m / z) * ((x_m / (z + 1.0)) / z);
}
return y_s * (x_s * tmp);
}
x_m = abs(x)
x_s = copysign(1.0d0, x)
y_m = abs(y)
y_s = copysign(1.0d0, y)
NOTE: x_m, y_m, and z should be sorted in increasing order before calling this function.
real(8) function code(y_s, x_s, x_m, y_m, z)
real(8), intent (in) :: y_s
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y_m
real(8), intent (in) :: z
real(8) :: tmp
if (z <= (-8.2d+42)) then
tmp = (((y_m / z) * x_m) / z) / z
else
tmp = (y_m / z) * ((x_m / (z + 1.0d0)) / z)
end if
code = y_s * (x_s * tmp)
end function
x_m = Math.abs(x);
x_s = Math.copySign(1.0, x);
y_m = Math.abs(y);
y_s = Math.copySign(1.0, y);
assert x_m < y_m && y_m < z;
public static double code(double y_s, double x_s, double x_m, double y_m, double z) {
double tmp;
if (z <= -8.2e+42) {
tmp = (((y_m / z) * x_m) / z) / z;
} else {
tmp = (y_m / z) * ((x_m / (z + 1.0)) / z);
}
return y_s * (x_s * tmp);
}
x_m = math.fabs(x) x_s = math.copysign(1.0, x) y_m = math.fabs(y) y_s = math.copysign(1.0, y) [x_m, y_m, z] = sort([x_m, y_m, z]) def code(y_s, x_s, x_m, y_m, z): tmp = 0 if z <= -8.2e+42: tmp = (((y_m / z) * x_m) / z) / z else: tmp = (y_m / z) * ((x_m / (z + 1.0)) / z) return y_s * (x_s * tmp)
x_m = abs(x) x_s = copysign(1.0, x) y_m = abs(y) y_s = copysign(1.0, y) x_m, y_m, z = sort([x_m, y_m, z]) function code(y_s, x_s, x_m, y_m, z) tmp = 0.0 if (z <= -8.2e+42) tmp = Float64(Float64(Float64(Float64(y_m / z) * x_m) / z) / z); else tmp = Float64(Float64(y_m / z) * Float64(Float64(x_m / Float64(z + 1.0)) / z)); end return Float64(y_s * Float64(x_s * tmp)) end
x_m = abs(x);
x_s = sign(x) * abs(1.0);
y_m = abs(y);
y_s = sign(y) * abs(1.0);
x_m, y_m, z = num2cell(sort([x_m, y_m, z])){:}
function tmp_2 = code(y_s, x_s, x_m, y_m, z)
tmp = 0.0;
if (z <= -8.2e+42)
tmp = (((y_m / z) * x_m) / z) / z;
else
tmp = (y_m / z) * ((x_m / (z + 1.0)) / z);
end
tmp_2 = y_s * (x_s * tmp);
end
x_m = N[Abs[x], $MachinePrecision]
x_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
y_m = N[Abs[y], $MachinePrecision]
y_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x_m, y_m, and z should be sorted in increasing order before calling this function.
code[y$95$s_, x$95$s_, x$95$m_, y$95$m_, z_] := N[(y$95$s * N[(x$95$s * If[LessEqual[z, -8.2e+42], N[(N[(N[(N[(y$95$m / z), $MachinePrecision] * x$95$m), $MachinePrecision] / z), $MachinePrecision] / z), $MachinePrecision], N[(N[(y$95$m / z), $MachinePrecision] * N[(N[(x$95$m / N[(z + 1.0), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
x_m = \left|x\right|
\\
x_s = \mathsf{copysign}\left(1, x\right)
\\
y_m = \left|y\right|
\\
y_s = \mathsf{copysign}\left(1, y\right)
\\
[x_m, y_m, z] = \mathsf{sort}([x_m, y_m, z])\\
\\
y_s \cdot \left(x_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -8.2 \cdot 10^{+42}:\\
\;\;\;\;\frac{\frac{\frac{y_m}{z} \cdot x_m}{z}}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{y_m}{z} \cdot \frac{\frac{x_m}{z + 1}}{z}\\
\end{array}\right)
\end{array}
if z < -8.2000000000000001e42Initial program 79.4%
*-commutative79.4%
associate-*l/77.7%
*-commutative77.7%
sqr-neg77.7%
*-commutative77.7%
distribute-rgt1-in31.2%
sqr-neg31.2%
fma-def77.7%
sqr-neg77.7%
cube-unmult77.7%
Simplified77.7%
fma-def31.2%
associate-*r/34.7%
*-commutative34.7%
cube-mult34.7%
distribute-rgt1-in79.4%
*-commutative79.4%
frac-times91.5%
associate-*l/96.3%
associate-/r*96.4%
Applied egg-rr96.4%
Taylor expanded in z around inf 91.2%
associate-*r/96.2%
Simplified96.2%
if -8.2000000000000001e42 < z Initial program 85.7%
*-commutative85.7%
frac-times88.9%
associate-*l/88.5%
times-frac96.7%
Applied egg-rr96.7%
Final simplification96.6%
x_m = (fabs.f64 x) x_s = (copysign.f64 1 x) y_m = (fabs.f64 y) y_s = (copysign.f64 1 y) NOTE: x_m, y_m, and z should be sorted in increasing order before calling this function. (FPCore (y_s x_s x_m y_m z) :precision binary64 (* y_s (* x_s (if (<= x_m 3.6e-80) (* (/ y_m z) (/ x_m z)) (* x_m (/ y_m (* z z)))))))
x_m = fabs(x);
x_s = copysign(1.0, x);
y_m = fabs(y);
y_s = copysign(1.0, y);
assert(x_m < y_m && y_m < z);
double code(double y_s, double x_s, double x_m, double y_m, double z) {
double tmp;
if (x_m <= 3.6e-80) {
tmp = (y_m / z) * (x_m / z);
} else {
tmp = x_m * (y_m / (z * z));
}
return y_s * (x_s * tmp);
}
x_m = abs(x)
x_s = copysign(1.0d0, x)
y_m = abs(y)
y_s = copysign(1.0d0, y)
NOTE: x_m, y_m, and z should be sorted in increasing order before calling this function.
real(8) function code(y_s, x_s, x_m, y_m, z)
real(8), intent (in) :: y_s
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y_m
real(8), intent (in) :: z
real(8) :: tmp
if (x_m <= 3.6d-80) then
tmp = (y_m / z) * (x_m / z)
else
tmp = x_m * (y_m / (z * z))
end if
code = y_s * (x_s * tmp)
end function
x_m = Math.abs(x);
x_s = Math.copySign(1.0, x);
y_m = Math.abs(y);
y_s = Math.copySign(1.0, y);
assert x_m < y_m && y_m < z;
public static double code(double y_s, double x_s, double x_m, double y_m, double z) {
double tmp;
if (x_m <= 3.6e-80) {
tmp = (y_m / z) * (x_m / z);
} else {
tmp = x_m * (y_m / (z * z));
}
return y_s * (x_s * tmp);
}
x_m = math.fabs(x) x_s = math.copysign(1.0, x) y_m = math.fabs(y) y_s = math.copysign(1.0, y) [x_m, y_m, z] = sort([x_m, y_m, z]) def code(y_s, x_s, x_m, y_m, z): tmp = 0 if x_m <= 3.6e-80: tmp = (y_m / z) * (x_m / z) else: tmp = x_m * (y_m / (z * z)) return y_s * (x_s * tmp)
x_m = abs(x) x_s = copysign(1.0, x) y_m = abs(y) y_s = copysign(1.0, y) x_m, y_m, z = sort([x_m, y_m, z]) function code(y_s, x_s, x_m, y_m, z) tmp = 0.0 if (x_m <= 3.6e-80) tmp = Float64(Float64(y_m / z) * Float64(x_m / z)); else tmp = Float64(x_m * Float64(y_m / Float64(z * z))); end return Float64(y_s * Float64(x_s * tmp)) end
x_m = abs(x);
x_s = sign(x) * abs(1.0);
y_m = abs(y);
y_s = sign(y) * abs(1.0);
x_m, y_m, z = num2cell(sort([x_m, y_m, z])){:}
function tmp_2 = code(y_s, x_s, x_m, y_m, z)
tmp = 0.0;
if (x_m <= 3.6e-80)
tmp = (y_m / z) * (x_m / z);
else
tmp = x_m * (y_m / (z * z));
end
tmp_2 = y_s * (x_s * tmp);
end
x_m = N[Abs[x], $MachinePrecision]
x_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
y_m = N[Abs[y], $MachinePrecision]
y_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x_m, y_m, and z should be sorted in increasing order before calling this function.
code[y$95$s_, x$95$s_, x$95$m_, y$95$m_, z_] := N[(y$95$s * N[(x$95$s * If[LessEqual[x$95$m, 3.6e-80], N[(N[(y$95$m / z), $MachinePrecision] * N[(x$95$m / z), $MachinePrecision]), $MachinePrecision], N[(x$95$m * N[(y$95$m / N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
x_m = \left|x\right|
\\
x_s = \mathsf{copysign}\left(1, x\right)
\\
y_m = \left|y\right|
\\
y_s = \mathsf{copysign}\left(1, y\right)
\\
[x_m, y_m, z] = \mathsf{sort}([x_m, y_m, z])\\
\\
y_s \cdot \left(x_s \cdot \begin{array}{l}
\mathbf{if}\;x_m \leq 3.6 \cdot 10^{-80}:\\
\;\;\;\;\frac{y_m}{z} \cdot \frac{x_m}{z}\\
\mathbf{else}:\\
\;\;\;\;x_m \cdot \frac{y_m}{z \cdot z}\\
\end{array}\right)
\end{array}
if x < 3.6e-80Initial program 83.2%
*-commutative83.2%
frac-times88.4%
associate-*l/89.2%
times-frac96.5%
Applied egg-rr96.5%
Taylor expanded in z around 0 79.9%
if 3.6e-80 < x Initial program 86.6%
sqr-neg86.6%
*-commutative86.6%
times-frac91.5%
sqr-neg91.5%
Simplified91.5%
Taylor expanded in z around 0 73.6%
Final simplification77.8%
x_m = (fabs.f64 x) x_s = (copysign.f64 1 x) y_m = (fabs.f64 y) y_s = (copysign.f64 1 y) NOTE: x_m, y_m, and z should be sorted in increasing order before calling this function. (FPCore (y_s x_s x_m y_m z) :precision binary64 (* y_s (* x_s (* (/ y_m z) (/ x_m z)))))
x_m = fabs(x);
x_s = copysign(1.0, x);
y_m = fabs(y);
y_s = copysign(1.0, y);
assert(x_m < y_m && y_m < z);
double code(double y_s, double x_s, double x_m, double y_m, double z) {
return y_s * (x_s * ((y_m / z) * (x_m / z)));
}
x_m = abs(x)
x_s = copysign(1.0d0, x)
y_m = abs(y)
y_s = copysign(1.0d0, y)
NOTE: x_m, y_m, and z should be sorted in increasing order before calling this function.
real(8) function code(y_s, x_s, x_m, y_m, z)
real(8), intent (in) :: y_s
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y_m
real(8), intent (in) :: z
code = y_s * (x_s * ((y_m / z) * (x_m / z)))
end function
x_m = Math.abs(x);
x_s = Math.copySign(1.0, x);
y_m = Math.abs(y);
y_s = Math.copySign(1.0, y);
assert x_m < y_m && y_m < z;
public static double code(double y_s, double x_s, double x_m, double y_m, double z) {
return y_s * (x_s * ((y_m / z) * (x_m / z)));
}
x_m = math.fabs(x) x_s = math.copysign(1.0, x) y_m = math.fabs(y) y_s = math.copysign(1.0, y) [x_m, y_m, z] = sort([x_m, y_m, z]) def code(y_s, x_s, x_m, y_m, z): return y_s * (x_s * ((y_m / z) * (x_m / z)))
x_m = abs(x) x_s = copysign(1.0, x) y_m = abs(y) y_s = copysign(1.0, y) x_m, y_m, z = sort([x_m, y_m, z]) function code(y_s, x_s, x_m, y_m, z) return Float64(y_s * Float64(x_s * Float64(Float64(y_m / z) * Float64(x_m / z)))) end
x_m = abs(x);
x_s = sign(x) * abs(1.0);
y_m = abs(y);
y_s = sign(y) * abs(1.0);
x_m, y_m, z = num2cell(sort([x_m, y_m, z])){:}
function tmp = code(y_s, x_s, x_m, y_m, z)
tmp = y_s * (x_s * ((y_m / z) * (x_m / z)));
end
x_m = N[Abs[x], $MachinePrecision]
x_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
y_m = N[Abs[y], $MachinePrecision]
y_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x_m, y_m, and z should be sorted in increasing order before calling this function.
code[y$95$s_, x$95$s_, x$95$m_, y$95$m_, z_] := N[(y$95$s * N[(x$95$s * N[(N[(y$95$m / z), $MachinePrecision] * N[(x$95$m / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
x_m = \left|x\right|
\\
x_s = \mathsf{copysign}\left(1, x\right)
\\
y_m = \left|y\right|
\\
y_s = \mathsf{copysign}\left(1, y\right)
\\
[x_m, y_m, z] = \mathsf{sort}([x_m, y_m, z])\\
\\
y_s \cdot \left(x_s \cdot \left(\frac{y_m}{z} \cdot \frac{x_m}{z}\right)\right)
\end{array}
Initial program 84.3%
*-commutative84.3%
frac-times89.5%
associate-*l/90.2%
times-frac95.5%
Applied egg-rr95.5%
Taylor expanded in z around 0 74.6%
Final simplification74.6%
x_m = (fabs.f64 x) x_s = (copysign.f64 1 x) y_m = (fabs.f64 y) y_s = (copysign.f64 1 y) NOTE: x_m, y_m, and z should be sorted in increasing order before calling this function. (FPCore (y_s x_s x_m y_m z) :precision binary64 (* y_s (* x_s (/ y_m (* z (/ z x_m))))))
x_m = fabs(x);
x_s = copysign(1.0, x);
y_m = fabs(y);
y_s = copysign(1.0, y);
assert(x_m < y_m && y_m < z);
double code(double y_s, double x_s, double x_m, double y_m, double z) {
return y_s * (x_s * (y_m / (z * (z / x_m))));
}
x_m = abs(x)
x_s = copysign(1.0d0, x)
y_m = abs(y)
y_s = copysign(1.0d0, y)
NOTE: x_m, y_m, and z should be sorted in increasing order before calling this function.
real(8) function code(y_s, x_s, x_m, y_m, z)
real(8), intent (in) :: y_s
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y_m
real(8), intent (in) :: z
code = y_s * (x_s * (y_m / (z * (z / x_m))))
end function
x_m = Math.abs(x);
x_s = Math.copySign(1.0, x);
y_m = Math.abs(y);
y_s = Math.copySign(1.0, y);
assert x_m < y_m && y_m < z;
public static double code(double y_s, double x_s, double x_m, double y_m, double z) {
return y_s * (x_s * (y_m / (z * (z / x_m))));
}
x_m = math.fabs(x) x_s = math.copysign(1.0, x) y_m = math.fabs(y) y_s = math.copysign(1.0, y) [x_m, y_m, z] = sort([x_m, y_m, z]) def code(y_s, x_s, x_m, y_m, z): return y_s * (x_s * (y_m / (z * (z / x_m))))
x_m = abs(x) x_s = copysign(1.0, x) y_m = abs(y) y_s = copysign(1.0, y) x_m, y_m, z = sort([x_m, y_m, z]) function code(y_s, x_s, x_m, y_m, z) return Float64(y_s * Float64(x_s * Float64(y_m / Float64(z * Float64(z / x_m))))) end
x_m = abs(x);
x_s = sign(x) * abs(1.0);
y_m = abs(y);
y_s = sign(y) * abs(1.0);
x_m, y_m, z = num2cell(sort([x_m, y_m, z])){:}
function tmp = code(y_s, x_s, x_m, y_m, z)
tmp = y_s * (x_s * (y_m / (z * (z / x_m))));
end
x_m = N[Abs[x], $MachinePrecision]
x_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
y_m = N[Abs[y], $MachinePrecision]
y_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x_m, y_m, and z should be sorted in increasing order before calling this function.
code[y$95$s_, x$95$s_, x$95$m_, y$95$m_, z_] := N[(y$95$s * N[(x$95$s * N[(y$95$m / N[(z * N[(z / x$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
x_m = \left|x\right|
\\
x_s = \mathsf{copysign}\left(1, x\right)
\\
y_m = \left|y\right|
\\
y_s = \mathsf{copysign}\left(1, y\right)
\\
[x_m, y_m, z] = \mathsf{sort}([x_m, y_m, z])\\
\\
y_s \cdot \left(x_s \cdot \frac{y_m}{z \cdot \frac{z}{x_m}}\right)
\end{array}
Initial program 84.3%
*-commutative84.3%
frac-times89.5%
associate-*l/90.2%
times-frac95.5%
Applied egg-rr95.5%
Taylor expanded in z around 0 74.6%
*-commutative74.6%
clear-num74.6%
frac-times72.4%
*-un-lft-identity72.4%
Applied egg-rr72.4%
Final simplification72.4%
x_m = (fabs.f64 x) x_s = (copysign.f64 1 x) y_m = (fabs.f64 y) y_s = (copysign.f64 1 y) NOTE: x_m, y_m, and z should be sorted in increasing order before calling this function. (FPCore (y_s x_s x_m y_m z) :precision binary64 (* y_s (* x_s (/ y_m (/ z (/ x_m z))))))
x_m = fabs(x);
x_s = copysign(1.0, x);
y_m = fabs(y);
y_s = copysign(1.0, y);
assert(x_m < y_m && y_m < z);
double code(double y_s, double x_s, double x_m, double y_m, double z) {
return y_s * (x_s * (y_m / (z / (x_m / z))));
}
x_m = abs(x)
x_s = copysign(1.0d0, x)
y_m = abs(y)
y_s = copysign(1.0d0, y)
NOTE: x_m, y_m, and z should be sorted in increasing order before calling this function.
real(8) function code(y_s, x_s, x_m, y_m, z)
real(8), intent (in) :: y_s
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y_m
real(8), intent (in) :: z
code = y_s * (x_s * (y_m / (z / (x_m / z))))
end function
x_m = Math.abs(x);
x_s = Math.copySign(1.0, x);
y_m = Math.abs(y);
y_s = Math.copySign(1.0, y);
assert x_m < y_m && y_m < z;
public static double code(double y_s, double x_s, double x_m, double y_m, double z) {
return y_s * (x_s * (y_m / (z / (x_m / z))));
}
x_m = math.fabs(x) x_s = math.copysign(1.0, x) y_m = math.fabs(y) y_s = math.copysign(1.0, y) [x_m, y_m, z] = sort([x_m, y_m, z]) def code(y_s, x_s, x_m, y_m, z): return y_s * (x_s * (y_m / (z / (x_m / z))))
x_m = abs(x) x_s = copysign(1.0, x) y_m = abs(y) y_s = copysign(1.0, y) x_m, y_m, z = sort([x_m, y_m, z]) function code(y_s, x_s, x_m, y_m, z) return Float64(y_s * Float64(x_s * Float64(y_m / Float64(z / Float64(x_m / z))))) end
x_m = abs(x);
x_s = sign(x) * abs(1.0);
y_m = abs(y);
y_s = sign(y) * abs(1.0);
x_m, y_m, z = num2cell(sort([x_m, y_m, z])){:}
function tmp = code(y_s, x_s, x_m, y_m, z)
tmp = y_s * (x_s * (y_m / (z / (x_m / z))));
end
x_m = N[Abs[x], $MachinePrecision]
x_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
y_m = N[Abs[y], $MachinePrecision]
y_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x_m, y_m, and z should be sorted in increasing order before calling this function.
code[y$95$s_, x$95$s_, x$95$m_, y$95$m_, z_] := N[(y$95$s * N[(x$95$s * N[(y$95$m / N[(z / N[(x$95$m / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
x_m = \left|x\right|
\\
x_s = \mathsf{copysign}\left(1, x\right)
\\
y_m = \left|y\right|
\\
y_s = \mathsf{copysign}\left(1, y\right)
\\
[x_m, y_m, z] = \mathsf{sort}([x_m, y_m, z])\\
\\
y_s \cdot \left(x_s \cdot \frac{y_m}{\frac{z}{\frac{x_m}{z}}}\right)
\end{array}
Initial program 84.3%
*-commutative84.3%
frac-times89.5%
associate-*l/90.2%
times-frac95.5%
Applied egg-rr95.5%
Taylor expanded in z around 0 74.6%
associate-*l/73.7%
associate-/l*72.4%
Applied egg-rr72.4%
Final simplification72.4%
x_m = (fabs.f64 x) x_s = (copysign.f64 1 x) y_m = (fabs.f64 y) y_s = (copysign.f64 1 y) NOTE: x_m, y_m, and z should be sorted in increasing order before calling this function. (FPCore (y_s x_s x_m y_m z) :precision binary64 (* y_s (* x_s (* y_m (/ (- x_m) z)))))
x_m = fabs(x);
x_s = copysign(1.0, x);
y_m = fabs(y);
y_s = copysign(1.0, y);
assert(x_m < y_m && y_m < z);
double code(double y_s, double x_s, double x_m, double y_m, double z) {
return y_s * (x_s * (y_m * (-x_m / z)));
}
x_m = abs(x)
x_s = copysign(1.0d0, x)
y_m = abs(y)
y_s = copysign(1.0d0, y)
NOTE: x_m, y_m, and z should be sorted in increasing order before calling this function.
real(8) function code(y_s, x_s, x_m, y_m, z)
real(8), intent (in) :: y_s
real(8), intent (in) :: x_s
real(8), intent (in) :: x_m
real(8), intent (in) :: y_m
real(8), intent (in) :: z
code = y_s * (x_s * (y_m * (-x_m / z)))
end function
x_m = Math.abs(x);
x_s = Math.copySign(1.0, x);
y_m = Math.abs(y);
y_s = Math.copySign(1.0, y);
assert x_m < y_m && y_m < z;
public static double code(double y_s, double x_s, double x_m, double y_m, double z) {
return y_s * (x_s * (y_m * (-x_m / z)));
}
x_m = math.fabs(x) x_s = math.copysign(1.0, x) y_m = math.fabs(y) y_s = math.copysign(1.0, y) [x_m, y_m, z] = sort([x_m, y_m, z]) def code(y_s, x_s, x_m, y_m, z): return y_s * (x_s * (y_m * (-x_m / z)))
x_m = abs(x) x_s = copysign(1.0, x) y_m = abs(y) y_s = copysign(1.0, y) x_m, y_m, z = sort([x_m, y_m, z]) function code(y_s, x_s, x_m, y_m, z) return Float64(y_s * Float64(x_s * Float64(y_m * Float64(Float64(-x_m) / z)))) end
x_m = abs(x);
x_s = sign(x) * abs(1.0);
y_m = abs(y);
y_s = sign(y) * abs(1.0);
x_m, y_m, z = num2cell(sort([x_m, y_m, z])){:}
function tmp = code(y_s, x_s, x_m, y_m, z)
tmp = y_s * (x_s * (y_m * (-x_m / z)));
end
x_m = N[Abs[x], $MachinePrecision]
x_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
y_m = N[Abs[y], $MachinePrecision]
y_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x_m, y_m, and z should be sorted in increasing order before calling this function.
code[y$95$s_, x$95$s_, x$95$m_, y$95$m_, z_] := N[(y$95$s * N[(x$95$s * N[(y$95$m * N[((-x$95$m) / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
x_m = \left|x\right|
\\
x_s = \mathsf{copysign}\left(1, x\right)
\\
y_m = \left|y\right|
\\
y_s = \mathsf{copysign}\left(1, y\right)
\\
[x_m, y_m, z] = \mathsf{sort}([x_m, y_m, z])\\
\\
y_s \cdot \left(x_s \cdot \left(y_m \cdot \frac{-x_m}{z}\right)\right)
\end{array}
Initial program 84.3%
*-commutative84.3%
associate-*l/85.3%
*-commutative85.3%
sqr-neg85.3%
*-commutative85.3%
distribute-rgt1-in75.1%
sqr-neg75.1%
fma-def85.3%
sqr-neg85.3%
cube-unmult85.3%
Simplified85.3%
fma-def75.1%
associate-*r/74.6%
*-commutative74.6%
cube-mult74.6%
distribute-rgt1-in84.3%
*-commutative84.3%
frac-times89.5%
associate-*l/90.2%
associate-/r*95.2%
Applied egg-rr95.2%
Taylor expanded in z around 0 58.8%
associate-*r*58.8%
associate-*l/59.8%
distribute-rgt-out62.9%
+-commutative62.9%
mul-1-neg62.9%
unsub-neg62.9%
Simplified62.9%
Taylor expanded in z around inf 29.5%
mul-1-neg29.5%
associate-*l/35.5%
*-commutative35.5%
distribute-rgt-neg-in35.5%
distribute-frac-neg35.5%
Simplified35.5%
Final simplification35.5%
(FPCore (x y z) :precision binary64 (if (< z 249.6182814532307) (/ (* y (/ x z)) (+ z (* z z))) (/ (* (/ (/ y z) (+ 1.0 z)) x) z)))
double code(double x, double y, double z) {
double tmp;
if (z < 249.6182814532307) {
tmp = (y * (x / z)) / (z + (z * z));
} else {
tmp = (((y / z) / (1.0 + z)) * x) / z;
}
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) :: tmp
if (z < 249.6182814532307d0) then
tmp = (y * (x / z)) / (z + (z * z))
else
tmp = (((y / z) / (1.0d0 + z)) * x) / z
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z < 249.6182814532307) {
tmp = (y * (x / z)) / (z + (z * z));
} else {
tmp = (((y / z) / (1.0 + z)) * x) / z;
}
return tmp;
}
def code(x, y, z): tmp = 0 if z < 249.6182814532307: tmp = (y * (x / z)) / (z + (z * z)) else: tmp = (((y / z) / (1.0 + z)) * x) / z return tmp
function code(x, y, z) tmp = 0.0 if (z < 249.6182814532307) tmp = Float64(Float64(y * Float64(x / z)) / Float64(z + Float64(z * z))); else tmp = Float64(Float64(Float64(Float64(y / z) / Float64(1.0 + z)) * x) / z); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z < 249.6182814532307) tmp = (y * (x / z)) / (z + (z * z)); else tmp = (((y / z) / (1.0 + z)) * x) / z; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Less[z, 249.6182814532307], N[(N[(y * N[(x / z), $MachinePrecision]), $MachinePrecision] / N[(z + N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(y / z), $MachinePrecision] / N[(1.0 + z), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision] / z), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z < 249.6182814532307:\\
\;\;\;\;\frac{y \cdot \frac{x}{z}}{z + z \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\frac{y}{z}}{1 + z} \cdot x}{z}\\
\end{array}
\end{array}
herbie shell --seed 2024018
(FPCore (x y z)
:name "Statistics.Distribution.Beta:$cvariance from math-functions-0.1.5.2"
:precision binary64
:herbie-target
(if (< z 249.6182814532307) (/ (* y (/ x z)) (+ z (* z z))) (/ (* (/ (/ y z) (+ 1.0 z)) x) z))
(/ (* x y) (* (* z z) (+ z 1.0))))