
(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 11 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 (* z (+ z 1.0))) (t_1 (/ (* x_m y_m) (* (+ z 1.0) (* z z)))))
(*
y_s
(*
x_s
(if (<= t_1 2e-17)
(/ x_m (* (/ z y_m) t_0))
(if (<= t_1 1e+217)
(/ (* x_m y_m) (* z 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 = z * (z + 1.0);
double t_1 = (x_m * y_m) / ((z + 1.0) * (z * z));
double tmp;
if (t_1 <= 2e-17) {
tmp = x_m / ((z / y_m) * t_0);
} else if (t_1 <= 1e+217) {
tmp = (x_m * y_m) / (z * 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) :: t_1
real(8) :: tmp
t_0 = z * (z + 1.0d0)
t_1 = (x_m * y_m) / ((z + 1.0d0) * (z * z))
if (t_1 <= 2d-17) then
tmp = x_m / ((z / y_m) * t_0)
else if (t_1 <= 1d+217) then
tmp = (x_m * y_m) / (z * 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 = z * (z + 1.0);
double t_1 = (x_m * y_m) / ((z + 1.0) * (z * z));
double tmp;
if (t_1 <= 2e-17) {
tmp = x_m / ((z / y_m) * t_0);
} else if (t_1 <= 1e+217) {
tmp = (x_m * y_m) / (z * 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 = z * (z + 1.0) t_1 = (x_m * y_m) / ((z + 1.0) * (z * z)) tmp = 0 if t_1 <= 2e-17: tmp = x_m / ((z / y_m) * t_0) elif t_1 <= 1e+217: tmp = (x_m * y_m) / (z * 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(z * Float64(z + 1.0)) t_1 = Float64(Float64(x_m * y_m) / Float64(Float64(z + 1.0) * Float64(z * z))) tmp = 0.0 if (t_1 <= 2e-17) tmp = Float64(x_m / Float64(Float64(z / y_m) * t_0)); elseif (t_1 <= 1e+217) tmp = Float64(Float64(x_m * y_m) / Float64(z * 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 = z * (z + 1.0);
t_1 = (x_m * y_m) / ((z + 1.0) * (z * z));
tmp = 0.0;
if (t_1 <= 2e-17)
tmp = x_m / ((z / y_m) * t_0);
elseif (t_1 <= 1e+217)
tmp = (x_m * y_m) / (z * 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[(z * N[(z + 1.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = 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$1, 2e-17], N[(x$95$m / N[(N[(z / y$95$m), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e+217], N[(N[(x$95$m * y$95$m), $MachinePrecision] / N[(z * t$95$0), $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])\\
\\
\begin{array}{l}
t_0 := z \cdot \left(z + 1\right)\\
t_1 := \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\_1 \leq 2 \cdot 10^{-17}:\\
\;\;\;\;\frac{x\_m}{\frac{z}{y\_m} \cdot t\_0}\\
\mathbf{elif}\;t\_1 \leq 10^{+217}:\\
\;\;\;\;\frac{x\_m \cdot y\_m}{z \cdot 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 1))) < 2.00000000000000014e-17Initial program 90.2%
*-commutative90.2%
frac-times93.0%
associate-*l/93.2%
times-frac96.0%
Applied egg-rr96.0%
clear-num95.8%
associate-/l/94.7%
frac-times93.4%
*-un-lft-identity93.4%
Applied egg-rr93.4%
if 2.00000000000000014e-17 < (/.f64 (*.f64 x y) (*.f64 (*.f64 z z) (+.f64 z 1))) < 9.9999999999999996e216Initial program 99.6%
*-commutative99.6%
frac-times93.1%
associate-*l/99.5%
times-frac80.5%
Applied egg-rr80.5%
*-commutative80.5%
associate-/l/80.5%
frac-times99.7%
Applied egg-rr99.7%
if 9.9999999999999996e216 < (/.f64 (*.f64 x y) (*.f64 (*.f64 z z) (+.f64 z 1))) Initial program 75.5%
*-commutative75.5%
frac-times83.1%
associate-*l/83.8%
times-frac99.8%
Applied egg-rr99.8%
Final simplification95.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 y_m) (* (+ z 1.0) (* z z)))))
(*
y_s
(*
x_s
(if (<= t_0 0.0)
(/ x_m (* (/ z y_m) (* z (+ z 1.0))))
(if (<= t_0 1e+217) 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 / y_m) * (z * (z + 1.0)));
} else if (t_0 <= 1e+217) {
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 / y_m) * (z * (z + 1.0d0)))
else if (t_0 <= 1d+217) 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 / y_m) * (z * (z + 1.0)));
} else if (t_0 <= 1e+217) {
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 / y_m) * (z * (z + 1.0))) elif t_0 <= 1e+217: 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 / y_m) * Float64(z * Float64(z + 1.0)))); elseif (t_0 <= 1e+217) 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 / y_m) * (z * (z + 1.0)));
elseif (t_0 <= 1e+217)
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 / y$95$m), $MachinePrecision] * N[(z * N[(z + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 1e+217], 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}{\frac{z}{y\_m} \cdot \left(z \cdot \left(z + 1\right)\right)}\\
\mathbf{elif}\;t\_0 \leq 10^{+217}:\\
\;\;\;\;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 1))) < 0.0Initial program 89.6%
*-commutative89.6%
frac-times93.7%
associate-*l/92.9%
times-frac95.8%
Applied egg-rr95.8%
clear-num95.6%
associate-/l/94.4%
frac-times94.7%
*-un-lft-identity94.7%
Applied egg-rr94.7%
if 0.0 < (/.f64 (*.f64 x y) (*.f64 (*.f64 z z) (+.f64 z 1))) < 9.9999999999999996e216Initial program 99.6%
if 9.9999999999999996e216 < (/.f64 (*.f64 x y) (*.f64 (*.f64 z z) (+.f64 z 1))) Initial program 75.5%
*-commutative75.5%
frac-times83.1%
associate-*l/83.8%
times-frac99.8%
Applied egg-rr99.8%
Final simplification96.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
(let* ((t_0 (/ (/ x_m z) z)))
(*
y_s
(*
x_s
(if (or (<= z -1.0) (not (<= z 1.0))) (* (/ y_m z) t_0) (* y_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 = (x_m / z) / z;
double tmp;
if ((z <= -1.0) || !(z <= 1.0)) {
tmp = (y_m / z) * t_0;
} else {
tmp = y_m * 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
if ((z <= (-1.0d0)) .or. (.not. (z <= 1.0d0))) then
tmp = (y_m / z) * t_0
else
tmp = y_m * 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;
double tmp;
if ((z <= -1.0) || !(z <= 1.0)) {
tmp = (y_m / z) * t_0;
} else {
tmp = y_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 = (x_m / z) / z tmp = 0 if (z <= -1.0) or not (z <= 1.0): tmp = (y_m / z) * t_0 else: tmp = y_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(Float64(x_m / z) / z) tmp = 0.0 if ((z <= -1.0) || !(z <= 1.0)) tmp = Float64(Float64(y_m / z) * t_0); else tmp = Float64(y_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 = (x_m / z) / z;
tmp = 0.0;
if ((z <= -1.0) || ~((z <= 1.0)))
tmp = (y_m / z) * t_0;
else
tmp = y_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[(x$95$m / z), $MachinePrecision] / z), $MachinePrecision]}, N[(y$95$s * N[(x$95$s * If[Or[LessEqual[z, -1.0], N[Not[LessEqual[z, 1.0]], $MachinePrecision]], N[(N[(y$95$m / z), $MachinePrecision] * t$95$0), $MachinePrecision], N[(y$95$m * t$95$0), $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{\frac{x\_m}{z}}{z}\\
y\_s \cdot \left(x\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -1 \lor \neg \left(z \leq 1\right):\\
\;\;\;\;\frac{y\_m}{z} \cdot t\_0\\
\mathbf{else}:\\
\;\;\;\;y\_m \cdot t\_0\\
\end{array}\right)
\end{array}
\end{array}
if z < -1 or 1 < z Initial program 89.1%
*-commutative89.1%
frac-times94.3%
associate-*l/96.7%
times-frac96.4%
Applied egg-rr96.4%
Taylor expanded in z around inf 96.1%
if -1 < z < 1Initial program 86.5%
*-commutative86.5%
associate-/l*82.7%
sqr-neg82.7%
associate-/r*82.7%
sqr-neg82.7%
Simplified82.7%
associate-*r/82.7%
*-commutative82.7%
associate-*r/82.7%
associate-/r*86.8%
associate-*l/93.9%
Applied egg-rr93.9%
Taylor expanded in z around 0 92.8%
associate-/l/85.0%
*-commutative85.0%
frac-times93.7%
associate-*l/92.4%
associate-/l*85.3%
Applied egg-rr85.3%
Final simplification90.9%
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.76)))
(/ (/ (* x_m (/ y_m z)) z) z)
(/ (* y_m (- (/ x_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 <= 0.76)) {
tmp = ((x_m * (y_m / z)) / z) / z;
} else {
tmp = (y_m * ((x_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 <= 0.76d0))) then
tmp = ((x_m * (y_m / z)) / z) / z
else
tmp = (y_m * ((x_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 <= 0.76)) {
tmp = ((x_m * (y_m / z)) / z) / z;
} else {
tmp = (y_m * ((x_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 <= 0.76): tmp = ((x_m * (y_m / z)) / z) / z else: tmp = (y_m * ((x_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 <= 0.76)) tmp = Float64(Float64(Float64(x_m * Float64(y_m / z)) / z) / z); else tmp = Float64(Float64(y_m * Float64(Float64(x_m / 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 <= 0.76)))
tmp = ((x_m * (y_m / z)) / z) / z;
else
tmp = (y_m * ((x_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, 0.76]], $MachinePrecision]], N[(N[(N[(x$95$m * N[(y$95$m / z), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision] / z), $MachinePrecision], N[(N[(y$95$m * N[(N[(x$95$m / z), $MachinePrecision] - 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 0.76\right):\\
\;\;\;\;\frac{\frac{x\_m \cdot \frac{y\_m}{z}}{z}}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{y\_m \cdot \left(\frac{x\_m}{z} - x\_m\right)}{z}\\
\end{array}\right)
\end{array}
if z < -1 or 0.76000000000000001 < z Initial program 89.1%
*-commutative89.1%
associate-/l*91.1%
sqr-neg91.1%
associate-/r*92.6%
sqr-neg92.6%
Simplified92.6%
associate-/l/91.1%
associate-/r*92.6%
associate-/l*96.7%
associate-/r*99.8%
clear-num99.7%
un-div-inv99.8%
Applied egg-rr99.8%
Taylor expanded in z around inf 99.5%
associate-/r/99.0%
Applied egg-rr99.0%
if -1 < z < 0.76000000000000001Initial program 86.5%
*-commutative86.5%
associate-/l*82.7%
sqr-neg82.7%
associate-/r*82.7%
sqr-neg82.7%
Simplified82.7%
associate-*r/82.7%
*-commutative82.7%
associate-*r/82.7%
associate-/r*86.8%
associate-*l/93.9%
Applied egg-rr93.9%
Taylor expanded in z around 0 85.8%
associate-*r*85.8%
neg-mul-185.8%
associate-*l/85.4%
distribute-rgt-out93.4%
+-commutative93.4%
unsub-neg93.4%
Simplified93.4%
Final simplification96.3%
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) z)))
(*
y_s
(*
x_s
(if (<= z -1.0)
(* (/ x_m z) (/ y_m (* z z)))
(if (<= z 1.0) (* y_m t_0) (* (/ y_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;
double tmp;
if (z <= -1.0) {
tmp = (x_m / z) * (y_m / (z * z));
} else if (z <= 1.0) {
tmp = y_m * t_0;
} else {
tmp = (y_m / z) * 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
if (z <= (-1.0d0)) then
tmp = (x_m / z) * (y_m / (z * z))
else if (z <= 1.0d0) then
tmp = y_m * t_0
else
tmp = (y_m / z) * 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;
double tmp;
if (z <= -1.0) {
tmp = (x_m / z) * (y_m / (z * z));
} else if (z <= 1.0) {
tmp = y_m * t_0;
} else {
tmp = (y_m / z) * 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 tmp = 0 if z <= -1.0: tmp = (x_m / z) * (y_m / (z * z)) elif z <= 1.0: tmp = y_m * t_0 else: tmp = (y_m / z) * 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) / z) tmp = 0.0 if (z <= -1.0) tmp = Float64(Float64(x_m / z) * Float64(y_m / Float64(z * z))); elseif (z <= 1.0) tmp = Float64(y_m * t_0); else tmp = Float64(Float64(y_m / z) * 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;
tmp = 0.0;
if (z <= -1.0)
tmp = (x_m / z) * (y_m / (z * z));
elseif (z <= 1.0)
tmp = y_m * t_0;
else
tmp = (y_m / z) * 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] / z), $MachinePrecision]}, 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, 1.0], N[(y$95$m * t$95$0), $MachinePrecision], N[(N[(y$95$m / z), $MachinePrecision] * t$95$0), $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{\frac{x\_m}{z}}{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 1:\\
\;\;\;\;y\_m \cdot t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{y\_m}{z} \cdot t\_0\\
\end{array}\right)
\end{array}
\end{array}
if z < -1Initial program 88.6%
*-commutative88.6%
sqr-neg88.6%
times-frac93.4%
sqr-neg93.4%
Simplified93.4%
Taylor expanded in z around inf 93.4%
if -1 < z < 1Initial program 86.5%
*-commutative86.5%
associate-/l*82.7%
sqr-neg82.7%
associate-/r*82.7%
sqr-neg82.7%
Simplified82.7%
associate-*r/82.7%
*-commutative82.7%
associate-*r/82.7%
associate-/r*86.8%
associate-*l/93.9%
Applied egg-rr93.9%
Taylor expanded in z around 0 92.8%
associate-/l/85.0%
*-commutative85.0%
frac-times93.7%
associate-*l/92.4%
associate-/l*85.3%
Applied egg-rr85.3%
if 1 < z Initial program 89.5%
*-commutative89.5%
frac-times94.9%
associate-*l/96.8%
times-frac99.9%
Applied egg-rr99.9%
Taylor expanded in z around inf 99.3%
Final simplification91.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.76)
(/ (* 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.76) {
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.76d0) 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.76) {
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.76: 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.76) 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.76)
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.76], 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.76:\\
\;\;\;\;\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 88.6%
*-commutative88.6%
sqr-neg88.6%
times-frac93.4%
sqr-neg93.4%
Simplified93.4%
Taylor expanded in z around inf 93.4%
if -1 < z < 0.76000000000000001Initial program 86.5%
*-commutative86.5%
associate-/l*82.7%
sqr-neg82.7%
associate-/r*82.7%
sqr-neg82.7%
Simplified82.7%
associate-*r/82.7%
*-commutative82.7%
associate-*r/82.7%
associate-/r*86.8%
associate-*l/93.9%
Applied egg-rr93.9%
Taylor expanded in z around 0 85.8%
associate-*r*85.8%
neg-mul-185.8%
associate-*l/85.4%
distribute-rgt-out93.4%
+-commutative93.4%
unsub-neg93.4%
Simplified93.4%
if 0.76000000000000001 < z Initial program 89.5%
*-commutative89.5%
frac-times94.9%
associate-*l/96.8%
times-frac99.9%
Applied egg-rr99.9%
Taylor expanded in z around inf 99.3%
Final simplification95.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
(*
y_s
(*
x_s
(if (<= z -1.0)
(/ (/ (* x_m (/ y_m z)) z) z)
(if (<= z 0.76)
(/ (* 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 * (y_m / z)) / z) / z;
} else if (z <= 0.76) {
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 * (y_m / z)) / z) / z
else if (z <= 0.76d0) 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 * (y_m / z)) / z) / z;
} else if (z <= 0.76) {
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 * (y_m / z)) / z) / z elif z <= 0.76: 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(x_m * Float64(y_m / z)) / z) / z); elseif (z <= 0.76) tmp = Float64(Float64(y_m * Float64(Float64(x_m / z) - x_m)) / z); else tmp = Float64(Float64(Float64(y_m / Float64(z / 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 * (y_m / z)) / z) / z;
elseif (z <= 0.76)
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[(x$95$m * N[(y$95$m / z), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[z, 0.76], N[(N[(y$95$m * N[(N[(x$95$m / z), $MachinePrecision] - x$95$m), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], N[(N[(N[(y$95$m / N[(z / x$95$m), $MachinePrecision]), $MachinePrecision] / z), $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:\\
\;\;\;\;\frac{\frac{x\_m \cdot \frac{y\_m}{z}}{z}}{z}\\
\mathbf{elif}\;z \leq 0.76:\\
\;\;\;\;\frac{y\_m \cdot \left(\frac{x\_m}{z} - x\_m\right)}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\frac{y\_m}{\frac{z}{x\_m}}}{z}}{z}\\
\end{array}\right)
\end{array}
if z < -1Initial program 88.6%
*-commutative88.6%
associate-/l*86.3%
sqr-neg86.3%
associate-/r*87.8%
sqr-neg87.8%
Simplified87.8%
associate-/l/86.3%
associate-/r*87.8%
associate-/l*96.6%
associate-/r*99.6%
clear-num99.6%
un-div-inv99.7%
Applied egg-rr99.7%
Taylor expanded in z around inf 99.7%
associate-/r/98.5%
Applied egg-rr98.5%
if -1 < z < 0.76000000000000001Initial program 86.5%
*-commutative86.5%
associate-/l*82.7%
sqr-neg82.7%
associate-/r*82.7%
sqr-neg82.7%
Simplified82.7%
associate-*r/82.7%
*-commutative82.7%
associate-*r/82.7%
associate-/r*86.8%
associate-*l/93.9%
Applied egg-rr93.9%
Taylor expanded in z around 0 85.8%
associate-*r*85.8%
neg-mul-185.8%
associate-*l/85.4%
distribute-rgt-out93.4%
+-commutative93.4%
unsub-neg93.4%
Simplified93.4%
if 0.76000000000000001 < z Initial program 89.5%
*-commutative89.5%
associate-/l*95.0%
sqr-neg95.0%
associate-/r*96.5%
sqr-neg96.5%
Simplified96.5%
associate-/l/95.0%
associate-/r*96.4%
associate-/l*96.8%
associate-/r*99.9%
clear-num99.9%
un-div-inv99.9%
Applied egg-rr99.9%
Taylor expanded in z around inf 99.4%
Final simplification96.3%
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 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 * ((y_m / z) * ((x_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 * ((y_m / z) * ((x_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 * ((y_m / z) * ((x_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 * ((y_m / z) * ((x_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(y_m / z) * Float64(Float64(x_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 * ((y_m / z) * ((x_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[(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 \left(\frac{y\_m}{z} \cdot \frac{\frac{x\_m}{z + 1}}{z}\right)\right)
\end{array}
Initial program 87.9%
*-commutative87.9%
frac-times91.1%
associate-*l/91.8%
times-frac95.8%
Applied egg-rr95.8%
Final simplification95.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 (/ (* (/ 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 87.9%
*-commutative87.9%
associate-/l*87.0%
sqr-neg87.0%
associate-/r*87.8%
sqr-neg87.8%
Simplified87.8%
associate-*r/88.4%
*-commutative88.4%
associate-*r/88.2%
associate-/r*91.8%
associate-*l/96.7%
Applied egg-rr96.7%
Final simplification96.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 (* 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) {
return y_s * (x_s * (y_m * ((x_m / z) / 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) / 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) / 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) / 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) / 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) / 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[(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 \left(y\_m \cdot \frac{\frac{x\_m}{z}}{z}\right)\right)
\end{array}
Initial program 87.9%
*-commutative87.9%
associate-/l*87.0%
sqr-neg87.0%
associate-/r*87.8%
sqr-neg87.8%
Simplified87.8%
associate-*r/88.4%
*-commutative88.4%
associate-*r/88.2%
associate-/r*91.8%
associate-*l/96.7%
Applied egg-rr96.7%
Taylor expanded in z around 0 76.1%
associate-/l/75.8%
*-commutative75.8%
frac-times76.9%
associate-*l/76.3%
associate-/l*75.5%
Applied egg-rr75.5%
Final simplification75.5%
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 87.9%
*-commutative87.9%
frac-times91.1%
associate-*l/91.8%
times-frac95.8%
Applied egg-rr95.8%
Taylor expanded in z around 0 76.9%
*-commutative76.9%
clear-num77.3%
frac-times76.0%
*-un-lft-identity76.0%
Applied egg-rr76.0%
Final simplification76.0%
(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 2024043
(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))))