
(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 13 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 #s(literal 1 binary64) x)
y\_m = (fabs.f64 y)
y\_s = (copysign.f64 #s(literal 1 binary64) 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 (* z (/ z y_m))))
(*
y_s
(*
x_s
(if (<= z -2.15e+54)
(/ (/ x_m z) t_0)
(if (<= z -6.6e-131)
(* y_m (/ (/ x_m (* z z)) (+ z 1.0)))
(if (<= z 18000000000.0)
(/ (/ y_m (/ z x_m)) z)
(/ x_m (* (+ z 1.0) 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 = z * (z / y_m);
double tmp;
if (z <= -2.15e+54) {
tmp = (x_m / z) / t_0;
} else if (z <= -6.6e-131) {
tmp = y_m * ((x_m / (z * z)) / (z + 1.0));
} else if (z <= 18000000000.0) {
tmp = (y_m / (z / x_m)) / z;
} else {
tmp = x_m / ((z + 1.0) * t_0);
}
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 = z * (z / y_m)
if (z <= (-2.15d+54)) then
tmp = (x_m / z) / t_0
else if (z <= (-6.6d-131)) then
tmp = y_m * ((x_m / (z * z)) / (z + 1.0d0))
else if (z <= 18000000000.0d0) then
tmp = (y_m / (z / x_m)) / z
else
tmp = x_m / ((z + 1.0d0) * t_0)
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 = z * (z / y_m);
double tmp;
if (z <= -2.15e+54) {
tmp = (x_m / z) / t_0;
} else if (z <= -6.6e-131) {
tmp = y_m * ((x_m / (z * z)) / (z + 1.0));
} else if (z <= 18000000000.0) {
tmp = (y_m / (z / x_m)) / z;
} else {
tmp = x_m / ((z + 1.0) * 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 = z * (z / y_m) tmp = 0 if z <= -2.15e+54: tmp = (x_m / z) / t_0 elif z <= -6.6e-131: tmp = y_m * ((x_m / (z * z)) / (z + 1.0)) elif z <= 18000000000.0: tmp = (y_m / (z / x_m)) / z else: tmp = x_m / ((z + 1.0) * 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(z * Float64(z / y_m)) tmp = 0.0 if (z <= -2.15e+54) tmp = Float64(Float64(x_m / z) / t_0); elseif (z <= -6.6e-131) tmp = Float64(y_m * Float64(Float64(x_m / Float64(z * z)) / Float64(z + 1.0))); elseif (z <= 18000000000.0) tmp = Float64(Float64(y_m / Float64(z / x_m)) / z); else tmp = Float64(x_m / Float64(Float64(z + 1.0) * 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 = z * (z / y_m);
tmp = 0.0;
if (z <= -2.15e+54)
tmp = (x_m / z) / t_0;
elseif (z <= -6.6e-131)
tmp = y_m * ((x_m / (z * z)) / (z + 1.0));
elseif (z <= 18000000000.0)
tmp = (y_m / (z / x_m)) / z;
else
tmp = x_m / ((z + 1.0) * 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[(z * N[(z / y$95$m), $MachinePrecision]), $MachinePrecision]}, N[(y$95$s * N[(x$95$s * If[LessEqual[z, -2.15e+54], N[(N[(x$95$m / z), $MachinePrecision] / t$95$0), $MachinePrecision], If[LessEqual[z, -6.6e-131], N[(y$95$m * N[(N[(x$95$m / N[(z * z), $MachinePrecision]), $MachinePrecision] / N[(z + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 18000000000.0], N[(N[(y$95$m / N[(z / x$95$m), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], N[(x$95$m / N[(N[(z + 1.0), $MachinePrecision] * 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 := z \cdot \frac{z}{y\_m}\\
y\_s \cdot \left(x\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -2.15 \cdot 10^{+54}:\\
\;\;\;\;\frac{\frac{x\_m}{z}}{t\_0}\\
\mathbf{elif}\;z \leq -6.6 \cdot 10^{-131}:\\
\;\;\;\;y\_m \cdot \frac{\frac{x\_m}{z \cdot z}}{z + 1}\\
\mathbf{elif}\;z \leq 18000000000:\\
\;\;\;\;\frac{\frac{y\_m}{\frac{z}{x\_m}}}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x\_m}{\left(z + 1\right) \cdot t\_0}\\
\end{array}\right)
\end{array}
\end{array}
if z < -2.14999999999999988e54Initial program 75.7%
*-commutative75.7%
frac-times85.5%
associate-*l/87.1%
times-frac92.7%
Applied egg-rr92.7%
clear-num92.6%
frac-times92.8%
*-un-lft-identity92.8%
Applied egg-rr92.8%
Taylor expanded in z around inf 92.8%
if -2.14999999999999988e54 < z < -6.6000000000000004e-131Initial program 97.0%
*-commutative97.0%
associate-/l*92.1%
sqr-neg92.1%
associate-/r*92.1%
sqr-neg92.1%
Simplified92.1%
if -6.6000000000000004e-131 < z < 1.8e10Initial program 85.3%
*-commutative85.3%
sqr-neg85.3%
times-frac84.5%
sqr-neg84.5%
Simplified84.5%
Taylor expanded in z around 0 83.7%
associate-*l/84.6%
*-commutative84.6%
associate-/r*92.1%
associate-*l/97.4%
clear-num97.3%
associate-*l/97.4%
*-un-lft-identity97.4%
Applied egg-rr97.4%
if 1.8e10 < z Initial program 79.6%
*-commutative79.6%
associate-/l*88.9%
sqr-neg88.9%
associate-/r*94.3%
sqr-neg94.3%
Simplified94.3%
associate-/r*88.9%
associate-*r/79.6%
frac-times89.7%
clear-num87.4%
frac-times85.7%
*-un-lft-identity85.7%
pow285.7%
Applied egg-rr85.7%
pow285.7%
div-inv85.7%
associate-*l*85.7%
div-inv85.7%
Applied egg-rr85.7%
Final simplification93.3%
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
y\_m = (fabs.f64 y)
y\_s = (copysign.f64 #s(literal 1 binary64) 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 y_m) (* (+ z 1.0) (* z z)))))
(*
y_s
(*
x_s
(if (<= t_0 0.0)
(/ x_m (* (+ z 1.0) (* z (/ z y_m))))
(if (<= t_0 4e+151) t_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 t_0 = (x_m * y_m) / ((z + 1.0) * (z * z));
double tmp;
if (t_0 <= 0.0) {
tmp = x_m / ((z + 1.0) * (z * (z / y_m)));
} else if (t_0 <= 4e+151) {
tmp = t_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) :: t_0
real(8) :: tmp
t_0 = (x_m * y_m) / ((z + 1.0d0) * (z * z))
if (t_0 <= 0.0d0) then
tmp = x_m / ((z + 1.0d0) * (z * (z / y_m)))
else if (t_0 <= 4d+151) then
tmp = t_0
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 t_0 = (x_m * y_m) / ((z + 1.0) * (z * z));
double tmp;
if (t_0 <= 0.0) {
tmp = x_m / ((z + 1.0) * (z * (z / y_m)));
} else if (t_0 <= 4e+151) {
tmp = t_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): t_0 = (x_m * y_m) / ((z + 1.0) * (z * z)) tmp = 0 if t_0 <= 0.0: tmp = x_m / ((z + 1.0) * (z * (z / y_m))) elif t_0 <= 4e+151: tmp = t_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) t_0 = Float64(Float64(x_m * y_m) / Float64(Float64(z + 1.0) * Float64(z * z))) tmp = 0.0 if (t_0 <= 0.0) tmp = Float64(x_m / Float64(Float64(z + 1.0) * Float64(z * Float64(z / y_m)))); elseif (t_0 <= 4e+151) tmp = t_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)
t_0 = (x_m * y_m) / ((z + 1.0) * (z * z));
tmp = 0.0;
if (t_0 <= 0.0)
tmp = x_m / ((z + 1.0) * (z * (z / y_m)));
elseif (t_0 <= 4e+151)
tmp = t_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_] := Block[{t$95$0 = N[(N[(x$95$m * y$95$m), $MachinePrecision] / N[(N[(z + 1.0), $MachinePrecision] * N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(y$95$s * N[(x$95$s * If[LessEqual[t$95$0, 0.0], N[(x$95$m / N[(N[(z + 1.0), $MachinePrecision] * N[(z * N[(z / y$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 4e+151], t$95$0, 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])\\
\\
\begin{array}{l}
t_0 := \frac{x\_m \cdot y\_m}{\left(z + 1\right) \cdot \left(z \cdot z\right)}\\
y\_s \cdot \left(x\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_0 \leq 0:\\
\;\;\;\;\frac{x\_m}{\left(z + 1\right) \cdot \left(z \cdot \frac{z}{y\_m}\right)}\\
\mathbf{elif}\;t\_0 \leq 4 \cdot 10^{+151}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{y\_m}{z} \cdot \frac{\frac{x\_m}{z + 1}}{z}\\
\end{array}\right)
\end{array}
\end{array}
if (/.f64 (*.f64 x y) (*.f64 (*.f64 z z) (+.f64 z #s(literal 1 binary64)))) < -0.0Initial program 90.0%
*-commutative90.0%
associate-/l*88.2%
sqr-neg88.2%
associate-/r*90.0%
sqr-neg90.0%
Simplified90.0%
associate-/r*88.2%
associate-*r/90.0%
frac-times90.5%
clear-num89.7%
frac-times88.6%
*-un-lft-identity88.6%
pow288.6%
Applied egg-rr88.6%
pow288.6%
div-inv88.6%
associate-*l*90.8%
div-inv90.8%
Applied egg-rr90.8%
if -0.0 < (/.f64 (*.f64 x y) (*.f64 (*.f64 z z) (+.f64 z #s(literal 1 binary64)))) < 4.00000000000000007e151Initial program 98.4%
if 4.00000000000000007e151 < (/.f64 (*.f64 x y) (*.f64 (*.f64 z z) (+.f64 z #s(literal 1 binary64)))) Initial program 66.6%
*-commutative66.6%
frac-times80.6%
associate-*l/79.0%
times-frac95.9%
Applied egg-rr95.9%
Final simplification92.9%
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
y\_m = (fabs.f64 y)
y\_s = (copysign.f64 #s(literal 1 binary64) 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) (* z (/ z y_m)))))
(*
y_s
(*
x_s
(if (<= z -2.15e+54)
t_0
(if (<= z -5.4e-26)
(* y_m (/ (/ x_m (* z z)) (+ z 1.0)))
(if (<= z 8.5e-40) (/ (/ y_m (/ z x_m)) z) 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 = (x_m / z) / (z * (z / y_m));
double tmp;
if (z <= -2.15e+54) {
tmp = t_0;
} else if (z <= -5.4e-26) {
tmp = y_m * ((x_m / (z * z)) / (z + 1.0));
} else if (z <= 8.5e-40) {
tmp = (y_m / (z / x_m)) / z;
} else {
tmp = t_0;
}
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) / (z * (z / y_m))
if (z <= (-2.15d+54)) then
tmp = t_0
else if (z <= (-5.4d-26)) then
tmp = y_m * ((x_m / (z * z)) / (z + 1.0d0))
else if (z <= 8.5d-40) then
tmp = (y_m / (z / x_m)) / z
else
tmp = t_0
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) / (z * (z / y_m));
double tmp;
if (z <= -2.15e+54) {
tmp = t_0;
} else if (z <= -5.4e-26) {
tmp = y_m * ((x_m / (z * z)) / (z + 1.0));
} else if (z <= 8.5e-40) {
tmp = (y_m / (z / x_m)) / z;
} else {
tmp = 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 = (x_m / z) / (z * (z / y_m)) tmp = 0 if z <= -2.15e+54: tmp = t_0 elif z <= -5.4e-26: tmp = y_m * ((x_m / (z * z)) / (z + 1.0)) elif z <= 8.5e-40: tmp = (y_m / (z / x_m)) / z else: tmp = 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(Float64(x_m / z) / Float64(z * Float64(z / y_m))) tmp = 0.0 if (z <= -2.15e+54) tmp = t_0; elseif (z <= -5.4e-26) tmp = Float64(y_m * Float64(Float64(x_m / Float64(z * z)) / Float64(z + 1.0))); elseif (z <= 8.5e-40) tmp = Float64(Float64(y_m / Float64(z / x_m)) / z); else tmp = 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 = (x_m / z) / (z * (z / y_m));
tmp = 0.0;
if (z <= -2.15e+54)
tmp = t_0;
elseif (z <= -5.4e-26)
tmp = y_m * ((x_m / (z * z)) / (z + 1.0));
elseif (z <= 8.5e-40)
tmp = (y_m / (z / x_m)) / z;
else
tmp = 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[(x$95$m / z), $MachinePrecision] / N[(z * N[(z / y$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(y$95$s * N[(x$95$s * If[LessEqual[z, -2.15e+54], t$95$0, If[LessEqual[z, -5.4e-26], N[(y$95$m * N[(N[(x$95$m / N[(z * z), $MachinePrecision]), $MachinePrecision] / N[(z + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 8.5e-40], N[(N[(y$95$m / N[(z / x$95$m), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], t$95$0]]]), $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{\frac{x\_m}{z}}{z \cdot \frac{z}{y\_m}}\\
y\_s \cdot \left(x\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -2.15 \cdot 10^{+54}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq -5.4 \cdot 10^{-26}:\\
\;\;\;\;y\_m \cdot \frac{\frac{x\_m}{z \cdot z}}{z + 1}\\
\mathbf{elif}\;z \leq 8.5 \cdot 10^{-40}:\\
\;\;\;\;\frac{\frac{y\_m}{\frac{z}{x\_m}}}{z}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}\right)
\end{array}
\end{array}
if z < -2.14999999999999988e54 or 8.4999999999999998e-40 < z Initial program 78.9%
*-commutative78.9%
frac-times88.3%
associate-*l/90.5%
times-frac93.4%
Applied egg-rr93.4%
clear-num93.4%
frac-times92.3%
*-un-lft-identity92.3%
Applied egg-rr92.3%
Taylor expanded in z around inf 90.4%
if -2.14999999999999988e54 < z < -5.39999999999999963e-26Initial program 94.9%
*-commutative94.9%
associate-/l*99.5%
sqr-neg99.5%
associate-/r*99.5%
sqr-neg99.5%
Simplified99.5%
if -5.39999999999999963e-26 < z < 8.4999999999999998e-40Initial program 86.7%
*-commutative86.7%
sqr-neg86.7%
times-frac85.9%
sqr-neg85.9%
Simplified85.9%
Taylor expanded in z around 0 85.9%
associate-*l/86.7%
*-commutative86.7%
associate-/r*93.5%
associate-*l/97.5%
clear-num97.5%
associate-*l/98.1%
*-un-lft-identity98.1%
Applied egg-rr98.1%
Final simplification94.9%
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
y\_m = (fabs.f64 y)
y\_s = (copysign.f64 #s(literal 1 binary64) 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 -4.1e+55)
(/ (/ x_m z) (* z (/ z y_m)))
(if (<= z -1e-131)
(* y_m (/ (/ x_m (* z z)) (+ z 1.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 (z <= -4.1e+55) {
tmp = (x_m / z) / (z * (z / y_m));
} else if (z <= -1e-131) {
tmp = y_m * ((x_m / (z * z)) / (z + 1.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 (z <= (-4.1d+55)) then
tmp = (x_m / z) / (z * (z / y_m))
else if (z <= (-1d-131)) then
tmp = y_m * ((x_m / (z * z)) / (z + 1.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 (z <= -4.1e+55) {
tmp = (x_m / z) / (z * (z / y_m));
} else if (z <= -1e-131) {
tmp = y_m * ((x_m / (z * z)) / (z + 1.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 z <= -4.1e+55: tmp = (x_m / z) / (z * (z / y_m)) elif z <= -1e-131: tmp = y_m * ((x_m / (z * z)) / (z + 1.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 (z <= -4.1e+55) tmp = Float64(Float64(x_m / z) / Float64(z * Float64(z / y_m))); elseif (z <= -1e-131) tmp = Float64(y_m * Float64(Float64(x_m / Float64(z * z)) / Float64(z + 1.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 (z <= -4.1e+55)
tmp = (x_m / z) / (z * (z / y_m));
elseif (z <= -1e-131)
tmp = y_m * ((x_m / (z * z)) / (z + 1.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[z, -4.1e+55], N[(N[(x$95$m / z), $MachinePrecision] / N[(z * N[(z / y$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -1e-131], N[(y$95$m * N[(N[(x$95$m / N[(z * z), $MachinePrecision]), $MachinePrecision] / N[(z + 1.0), $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}\;z \leq -4.1 \cdot 10^{+55}:\\
\;\;\;\;\frac{\frac{x\_m}{z}}{z \cdot \frac{z}{y\_m}}\\
\mathbf{elif}\;z \leq -1 \cdot 10^{-131}:\\
\;\;\;\;y\_m \cdot \frac{\frac{x\_m}{z \cdot z}}{z + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{y\_m}{z} \cdot \frac{\frac{x\_m}{z + 1}}{z}\\
\end{array}\right)
\end{array}
if z < -4.09999999999999981e55Initial program 75.7%
*-commutative75.7%
frac-times85.5%
associate-*l/87.1%
times-frac92.7%
Applied egg-rr92.7%
clear-num92.6%
frac-times92.8%
*-un-lft-identity92.8%
Applied egg-rr92.8%
Taylor expanded in z around inf 92.8%
if -4.09999999999999981e55 < z < -9.9999999999999999e-132Initial program 97.0%
*-commutative97.0%
associate-/l*92.1%
sqr-neg92.1%
associate-/r*92.1%
sqr-neg92.1%
Simplified92.1%
if -9.9999999999999999e-132 < z Initial program 83.5%
*-commutative83.5%
frac-times86.2%
associate-*l/87.7%
times-frac97.3%
Applied egg-rr97.3%
Final simplification95.6%
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
y\_m = (fabs.f64 y)
y\_s = (copysign.f64 #s(literal 1 binary64) 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 -215000000.0) (not (<= z 8.4e-55)))
(/ (/ x_m z) (* z (/ z y_m)))
(/ (/ 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) {
double tmp;
if ((z <= -215000000.0) || !(z <= 8.4e-55)) {
tmp = (x_m / z) / (z * (z / y_m));
} else {
tmp = (y_m / (z / x_m)) / 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 <= (-215000000.0d0)) .or. (.not. (z <= 8.4d-55))) then
tmp = (x_m / z) / (z * (z / y_m))
else
tmp = (y_m / (z / x_m)) / 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 <= -215000000.0) || !(z <= 8.4e-55)) {
tmp = (x_m / z) / (z * (z / y_m));
} else {
tmp = (y_m / (z / x_m)) / 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 <= -215000000.0) or not (z <= 8.4e-55): tmp = (x_m / z) / (z * (z / y_m)) else: tmp = (y_m / (z / x_m)) / 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 <= -215000000.0) || !(z <= 8.4e-55)) tmp = Float64(Float64(x_m / z) / Float64(z * Float64(z / y_m))); else tmp = Float64(Float64(y_m / Float64(z / x_m)) / 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 <= -215000000.0) || ~((z <= 8.4e-55)))
tmp = (x_m / z) / (z * (z / y_m));
else
tmp = (y_m / (z / x_m)) / 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, -215000000.0], N[Not[LessEqual[z, 8.4e-55]], $MachinePrecision]], N[(N[(x$95$m / z), $MachinePrecision] / N[(z * N[(z / y$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y$95$m / N[(z / x$95$m), $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 -215000000 \lor \neg \left(z \leq 8.4 \cdot 10^{-55}\right):\\
\;\;\;\;\frac{\frac{x\_m}{z}}{z \cdot \frac{z}{y\_m}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{y\_m}{\frac{z}{x\_m}}}{z}\\
\end{array}\right)
\end{array}
if z < -2.15e8 or 8.4000000000000006e-55 < z Initial program 80.5%
*-commutative80.5%
frac-times88.8%
associate-*l/91.5%
times-frac93.4%
Applied egg-rr93.4%
clear-num93.4%
frac-times92.4%
*-un-lft-identity92.4%
Applied egg-rr92.4%
Taylor expanded in z around inf 88.5%
if -2.15e8 < z < 8.4000000000000006e-55Initial program 87.2%
*-commutative87.2%
sqr-neg87.2%
times-frac86.5%
sqr-neg86.5%
Simplified86.5%
Taylor expanded in z around 0 83.3%
associate-*l/84.0%
*-commutative84.0%
associate-/r*90.5%
associate-*l/94.4%
clear-num94.3%
associate-*l/94.9%
*-un-lft-identity94.9%
Applied egg-rr94.9%
Final simplification91.8%
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
y\_m = (fabs.f64 y)
y\_s = (copysign.f64 #s(literal 1 binary64) 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 -215000000.0) (not (<= z 8.4e-55)))
(/ (* (/ x_m z) (/ y_m z)) z)
(/ (/ 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) {
double tmp;
if ((z <= -215000000.0) || !(z <= 8.4e-55)) {
tmp = ((x_m / z) * (y_m / z)) / z;
} else {
tmp = (y_m / (z / x_m)) / 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 <= (-215000000.0d0)) .or. (.not. (z <= 8.4d-55))) then
tmp = ((x_m / z) * (y_m / z)) / z
else
tmp = (y_m / (z / x_m)) / 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 <= -215000000.0) || !(z <= 8.4e-55)) {
tmp = ((x_m / z) * (y_m / z)) / z;
} else {
tmp = (y_m / (z / x_m)) / 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 <= -215000000.0) or not (z <= 8.4e-55): tmp = ((x_m / z) * (y_m / z)) / z else: tmp = (y_m / (z / x_m)) / 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 <= -215000000.0) || !(z <= 8.4e-55)) tmp = Float64(Float64(Float64(x_m / z) * Float64(y_m / z)) / z); else tmp = Float64(Float64(y_m / Float64(z / x_m)) / 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 <= -215000000.0) || ~((z <= 8.4e-55)))
tmp = ((x_m / z) * (y_m / z)) / z;
else
tmp = (y_m / (z / x_m)) / 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, -215000000.0], N[Not[LessEqual[z, 8.4e-55]], $MachinePrecision]], N[(N[(N[(x$95$m / z), $MachinePrecision] * N[(y$95$m / z), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], N[(N[(y$95$m / N[(z / x$95$m), $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 -215000000 \lor \neg \left(z \leq 8.4 \cdot 10^{-55}\right):\\
\;\;\;\;\frac{\frac{x\_m}{z} \cdot \frac{y\_m}{z}}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{y\_m}{\frac{z}{x\_m}}}{z}\\
\end{array}\right)
\end{array}
if z < -2.15e8 or 8.4000000000000006e-55 < z Initial program 80.5%
*-commutative80.5%
associate-/l*82.4%
sqr-neg82.4%
associate-/r*87.8%
sqr-neg87.8%
Simplified87.8%
associate-*r/89.7%
*-commutative89.7%
associate-*r/87.4%
associate-/r*93.4%
associate-*l/96.7%
Applied egg-rr96.7%
Taylor expanded in z around inf 93.6%
if -2.15e8 < z < 8.4000000000000006e-55Initial program 87.2%
*-commutative87.2%
sqr-neg87.2%
times-frac86.5%
sqr-neg86.5%
Simplified86.5%
Taylor expanded in z around 0 83.3%
associate-*l/84.0%
*-commutative84.0%
associate-/r*90.5%
associate-*l/94.4%
clear-num94.3%
associate-*l/94.9%
*-un-lft-identity94.9%
Applied egg-rr94.9%
Final simplification94.2%
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
y\_m = (fabs.f64 y)
y\_s = (copysign.f64 #s(literal 1 binary64) 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 3.5e-35)))
(* (/ x_m z) (/ y_m (* z z)))
(/ (/ 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) {
double tmp;
if ((z <= -1.0) || !(z <= 3.5e-35)) {
tmp = (x_m / z) * (y_m / (z * z));
} else {
tmp = (y_m / (z / x_m)) / 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 <= 3.5d-35))) then
tmp = (x_m / z) * (y_m / (z * z))
else
tmp = (y_m / (z / x_m)) / 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 <= 3.5e-35)) {
tmp = (x_m / z) * (y_m / (z * z));
} else {
tmp = (y_m / (z / x_m)) / 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 <= 3.5e-35): tmp = (x_m / z) * (y_m / (z * z)) else: tmp = (y_m / (z / x_m)) / 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 <= 3.5e-35)) tmp = Float64(Float64(x_m / z) * Float64(y_m / Float64(z * z))); else tmp = Float64(Float64(y_m / Float64(z / x_m)) / 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 <= 3.5e-35)))
tmp = (x_m / z) * (y_m / (z * z));
else
tmp = (y_m / (z / x_m)) / 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, 3.5e-35]], $MachinePrecision]], N[(N[(x$95$m / z), $MachinePrecision] * N[(y$95$m / N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y$95$m / N[(z / x$95$m), $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 3.5 \cdot 10^{-35}\right):\\
\;\;\;\;\frac{x\_m}{z} \cdot \frac{y\_m}{z \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{y\_m}{\frac{z}{x\_m}}}{z}\\
\end{array}\right)
\end{array}
if z < -1 or 3.49999999999999996e-35 < z Initial program 79.7%
*-commutative79.7%
sqr-neg79.7%
times-frac88.4%
sqr-neg88.4%
Simplified88.4%
Taylor expanded in z around inf 87.0%
if -1 < z < 3.49999999999999996e-35Initial program 87.7%
*-commutative87.7%
sqr-neg87.7%
times-frac87.0%
sqr-neg87.0%
Simplified87.0%
Taylor expanded in z around 0 84.6%
associate-*l/85.3%
*-commutative85.3%
associate-/r*91.6%
associate-*l/94.6%
clear-num94.5%
associate-*l/95.1%
*-un-lft-identity95.1%
Applied egg-rr95.1%
Final simplification91.3%
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
y\_m = (fabs.f64 y)
y\_s = (copysign.f64 #s(literal 1 binary64) 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 9.8e-26)))
(* (/ y_m z) (/ (/ x_m z) z))
(/ (/ 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) {
double tmp;
if ((z <= -1.0) || !(z <= 9.8e-26)) {
tmp = (y_m / z) * ((x_m / z) / z);
} else {
tmp = (y_m / (z / x_m)) / 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 <= 9.8d-26))) then
tmp = (y_m / z) * ((x_m / z) / z)
else
tmp = (y_m / (z / x_m)) / 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 <= 9.8e-26)) {
tmp = (y_m / z) * ((x_m / z) / z);
} else {
tmp = (y_m / (z / x_m)) / 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 <= 9.8e-26): tmp = (y_m / z) * ((x_m / z) / z) else: tmp = (y_m / (z / x_m)) / 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 <= 9.8e-26)) tmp = Float64(Float64(y_m / z) * Float64(Float64(x_m / z) / z)); else tmp = Float64(Float64(y_m / Float64(z / x_m)) / 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 <= 9.8e-26)))
tmp = (y_m / z) * ((x_m / z) / z);
else
tmp = (y_m / (z / x_m)) / 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, 9.8e-26]], $MachinePrecision]], N[(N[(y$95$m / z), $MachinePrecision] * N[(N[(x$95$m / z), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], N[(N[(y$95$m / N[(z / x$95$m), $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 9.8 \cdot 10^{-26}\right):\\
\;\;\;\;\frac{y\_m}{z} \cdot \frac{\frac{x\_m}{z}}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{y\_m}{\frac{z}{x\_m}}}{z}\\
\end{array}\right)
\end{array}
if z < -1 or 9.7999999999999998e-26 < z Initial program 79.5%
*-commutative79.5%
frac-times88.3%
associate-*l/91.1%
times-frac93.9%
Applied egg-rr93.9%
Taylor expanded in z around inf 93.3%
if -1 < z < 9.7999999999999998e-26Initial program 87.8%
*-commutative87.8%
sqr-neg87.8%
times-frac87.1%
sqr-neg87.1%
Simplified87.1%
Taylor expanded in z around 0 84.7%
associate-*l/85.4%
*-commutative85.4%
associate-/r*91.6%
associate-*l/94.6%
clear-num94.6%
associate-*l/95.1%
*-un-lft-identity95.1%
Applied egg-rr95.1%
Final simplification94.3%
x\_m = (fabs.f64 x) x\_s = (copysign.f64 #s(literal 1 binary64) x) y\_m = (fabs.f64 y) y\_s = (copysign.f64 #s(literal 1 binary64) 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 2.6e-90) (* (/ x_m z) (/ y_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 <= 2.6e-90) {
tmp = (x_m / z) * (y_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 <= 2.6d-90) then
tmp = (x_m / z) * (y_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 <= 2.6e-90) {
tmp = (x_m / z) * (y_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 <= 2.6e-90: tmp = (x_m / z) * (y_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 <= 2.6e-90) tmp = Float64(Float64(x_m / z) * Float64(y_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 <= 2.6e-90)
tmp = (x_m / z) * (y_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, 2.6e-90], N[(N[(x$95$m / z), $MachinePrecision] * N[(y$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 2.6 \cdot 10^{-90}:\\
\;\;\;\;\frac{x\_m}{z} \cdot \frac{y\_m}{z}\\
\mathbf{else}:\\
\;\;\;\;x\_m \cdot \frac{y\_m}{z \cdot z}\\
\end{array}\right)
\end{array}
if x < 2.6e-90Initial program 84.5%
*-commutative84.5%
frac-times88.1%
associate-*l/88.5%
times-frac96.2%
Applied egg-rr96.2%
Taylor expanded in z around 0 78.9%
if 2.6e-90 < x Initial program 82.9%
*-commutative82.9%
sqr-neg82.9%
times-frac86.8%
sqr-neg86.8%
Simplified86.8%
Taylor expanded in z around 0 70.9%
Final simplification76.2%
x\_m = (fabs.f64 x) x\_s = (copysign.f64 #s(literal 1 binary64) x) y\_m = (fabs.f64 y) y\_s = (copysign.f64 #s(literal 1 binary64) 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 (/ (* (/ x_m z) (/ y_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) {
return y_s * (x_s * (((x_m / z) * (y_m / (z + 1.0))) / 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 * (((x_m / z) * (y_m / (z + 1.0d0))) / 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 * (((x_m / z) * (y_m / (z + 1.0))) / 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 * (((x_m / z) * (y_m / (z + 1.0))) / 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(Float64(x_m / z) * Float64(y_m / Float64(z + 1.0))) / 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 * (((x_m / z) * (y_m / (z + 1.0))) / 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[(N[(x$95$m / z), $MachinePrecision] * N[(y$95$m / N[(z + 1.0), $MachinePrecision]), $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 \frac{\frac{x\_m}{z} \cdot \frac{y\_m}{z + 1}}{z}\right)
\end{array}
Initial program 83.9%
*-commutative83.9%
associate-/l*82.8%
sqr-neg82.8%
associate-/r*85.5%
sqr-neg85.5%
Simplified85.5%
associate-*r/86.4%
*-commutative86.4%
associate-*r/85.3%
associate-/r*91.2%
associate-*l/97.2%
Applied egg-rr97.2%
x\_m = (fabs.f64 x) x\_s = (copysign.f64 #s(literal 1 binary64) x) y\_m = (fabs.f64 y) y\_s = (copysign.f64 #s(literal 1 binary64) 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 83.9%
*-commutative83.9%
frac-times87.6%
associate-*l/89.3%
times-frac95.6%
Applied egg-rr95.6%
associate-*r/98.7%
frac-times89.1%
*-commutative89.1%
frac-times97.2%
associate-/l*95.2%
clear-num95.1%
frac-times91.2%
*-un-lft-identity91.2%
Applied egg-rr91.2%
Taylor expanded in z around 0 73.4%
*-commutative73.4%
clear-num73.4%
un-div-inv73.4%
Applied egg-rr73.4%
x\_m = (fabs.f64 x) x\_s = (copysign.f64 #s(literal 1 binary64) x) y\_m = (fabs.f64 y) y\_s = (copysign.f64 #s(literal 1 binary64) 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 83.9%
*-commutative83.9%
frac-times87.6%
associate-*l/89.3%
times-frac95.6%
Applied egg-rr95.6%
associate-*r/98.7%
frac-times89.1%
*-commutative89.1%
frac-times97.2%
associate-/l*95.2%
clear-num95.1%
frac-times91.2%
*-un-lft-identity91.2%
Applied egg-rr91.2%
Taylor expanded in z around 0 73.4%
Final simplification73.4%
x\_m = (fabs.f64 x) x\_s = (copysign.f64 #s(literal 1 binary64) x) y\_m = (fabs.f64 y) y\_s = (copysign.f64 #s(literal 1 binary64) 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 (* (/ x_m z) (/ y_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 * ((x_m / z) * (y_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 * ((x_m / z) * (y_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 * ((x_m / z) * (y_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 * ((x_m / z) * (y_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(x_m / z) * Float64(y_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 * ((x_m / z) * (y_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[(x$95$m / z), $MachinePrecision] * N[(y$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{x\_m}{z} \cdot \frac{y\_m}{z}\right)\right)
\end{array}
Initial program 83.9%
*-commutative83.9%
frac-times87.6%
associate-*l/89.3%
times-frac95.6%
Applied egg-rr95.6%
Taylor expanded in z around 0 75.4%
Final simplification75.4%
(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 2024107
(FPCore (x y z)
:name "Statistics.Distribution.Beta:$cvariance from math-functions-0.1.5.2"
:precision binary64
:alt
(if (< z 249.6182814532307) (/ (* y (/ x z)) (+ z (* z z))) (/ (* (/ (/ y z) (+ 1.0 z)) x) z))
(/ (* x y) (* (* z z) (+ z 1.0))))