
(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 14 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}
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z) :precision binary64 (/ (/ y z) (* z (/ (+ z 1.0) x))))
assert(x < y);
double code(double x, double y, double z) {
return (y / z) / (z * ((z + 1.0) / x));
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = (y / z) / (z * ((z + 1.0d0) / x))
end function
assert x < y;
public static double code(double x, double y, double z) {
return (y / z) / (z * ((z + 1.0) / x));
}
[x, y] = sort([x, y]) def code(x, y, z): return (y / z) / (z * ((z + 1.0) / x))
x, y = sort([x, y]) function code(x, y, z) return Float64(Float64(y / z) / Float64(z * Float64(Float64(z + 1.0) / x))) end
x, y = num2cell(sort([x, y])){:}
function tmp = code(x, y, z)
tmp = (y / z) / (z * ((z + 1.0) / x));
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_] := N[(N[(y / z), $MachinePrecision] / N[(z * N[(N[(z + 1.0), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\frac{\frac{y}{z}}{z \cdot \frac{z + 1}{x}}
\end{array}
Initial program 84.2%
*-commutative84.2%
sqr-neg84.2%
times-frac87.7%
sqr-neg87.7%
Simplified87.7%
*-commutative87.7%
clear-num87.7%
associate-/r*92.9%
frac-times97.3%
*-un-lft-identity97.3%
Applied egg-rr97.3%
Final simplification97.3%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z) :precision binary64 (if (or (<= z -1.0) (not (<= z 1.0))) (* (/ y z) (/ (/ x z) z)) (/ (/ y z) (/ z x))))
assert(x < y);
double code(double x, double y, double z) {
double tmp;
if ((z <= -1.0) || !(z <= 1.0)) {
tmp = (y / z) * ((x / z) / z);
} else {
tmp = (y / z) / (z / x);
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
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 <= (-1.0d0)) .or. (.not. (z <= 1.0d0))) then
tmp = (y / z) * ((x / z) / z)
else
tmp = (y / z) / (z / x)
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -1.0) || !(z <= 1.0)) {
tmp = (y / z) * ((x / z) / z);
} else {
tmp = (y / z) / (z / x);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z): tmp = 0 if (z <= -1.0) or not (z <= 1.0): tmp = (y / z) * ((x / z) / z) else: tmp = (y / z) / (z / x) return tmp
x, y = sort([x, y]) function code(x, y, z) tmp = 0.0 if ((z <= -1.0) || !(z <= 1.0)) tmp = Float64(Float64(y / z) * Float64(Float64(x / z) / z)); else tmp = Float64(Float64(y / z) / Float64(z / x)); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z)
tmp = 0.0;
if ((z <= -1.0) || ~((z <= 1.0)))
tmp = (y / z) * ((x / z) / z);
else
tmp = (y / z) / (z / x);
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_] := If[Or[LessEqual[z, -1.0], N[Not[LessEqual[z, 1.0]], $MachinePrecision]], N[(N[(y / z), $MachinePrecision] * N[(N[(x / z), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], N[(N[(y / z), $MachinePrecision] / N[(z / x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1 \lor \neg \left(z \leq 1\right):\\
\;\;\;\;\frac{y}{z} \cdot \frac{\frac{x}{z}}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{y}{z}}{\frac{z}{x}}\\
\end{array}
\end{array}
if z < -1 or 1 < z Initial program 86.0%
associate-*l*86.0%
times-frac93.9%
associate-/r*97.4%
associate-*r/97.4%
Simplified97.4%
frac-times87.7%
associate-/r*86.0%
*-commutative86.0%
frac-times93.9%
associate-*l/91.3%
times-frac98.2%
Applied egg-rr98.2%
Taylor expanded in z around inf 97.7%
if -1 < z < 1Initial program 82.8%
*-commutative82.8%
sqr-neg82.8%
times-frac82.6%
sqr-neg82.6%
Simplified82.6%
*-commutative82.6%
clear-num82.6%
associate-/r*89.1%
frac-times96.7%
*-un-lft-identity96.7%
Applied egg-rr96.7%
Taylor expanded in z around 0 95.4%
Final simplification96.4%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z) :precision binary64 (if (<= z -1.0) (* (/ y z) (/ (/ x z) z)) (if (<= z 1.0) (/ (/ y z) (/ z x)) (* (/ x z) (/ (/ y z) z)))))
assert(x < y);
double code(double x, double y, double z) {
double tmp;
if (z <= -1.0) {
tmp = (y / z) * ((x / z) / z);
} else if (z <= 1.0) {
tmp = (y / z) / (z / x);
} else {
tmp = (x / z) * ((y / z) / z);
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
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 <= (-1.0d0)) then
tmp = (y / z) * ((x / z) / z)
else if (z <= 1.0d0) then
tmp = (y / z) / (z / x)
else
tmp = (x / z) * ((y / z) / z)
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z) {
double tmp;
if (z <= -1.0) {
tmp = (y / z) * ((x / z) / z);
} else if (z <= 1.0) {
tmp = (y / z) / (z / x);
} else {
tmp = (x / z) * ((y / z) / z);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z): tmp = 0 if z <= -1.0: tmp = (y / z) * ((x / z) / z) elif z <= 1.0: tmp = (y / z) / (z / x) else: tmp = (x / z) * ((y / z) / z) return tmp
x, y = sort([x, y]) function code(x, y, z) tmp = 0.0 if (z <= -1.0) tmp = Float64(Float64(y / z) * Float64(Float64(x / z) / z)); elseif (z <= 1.0) tmp = Float64(Float64(y / z) / Float64(z / x)); else tmp = Float64(Float64(x / z) * Float64(Float64(y / z) / z)); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z)
tmp = 0.0;
if (z <= -1.0)
tmp = (y / z) * ((x / z) / z);
elseif (z <= 1.0)
tmp = (y / z) / (z / x);
else
tmp = (x / z) * ((y / z) / z);
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_] := If[LessEqual[z, -1.0], N[(N[(y / z), $MachinePrecision] * N[(N[(x / z), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.0], N[(N[(y / z), $MachinePrecision] / N[(z / x), $MachinePrecision]), $MachinePrecision], N[(N[(x / z), $MachinePrecision] * N[(N[(y / z), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1:\\
\;\;\;\;\frac{y}{z} \cdot \frac{\frac{x}{z}}{z}\\
\mathbf{elif}\;z \leq 1:\\
\;\;\;\;\frac{\frac{y}{z}}{\frac{z}{x}}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{z} \cdot \frac{\frac{y}{z}}{z}\\
\end{array}
\end{array}
if z < -1Initial program 93.1%
associate-*l*93.1%
times-frac93.8%
associate-/r*96.9%
associate-*r/98.4%
Simplified98.4%
frac-times93.1%
associate-/r*93.1%
*-commutative93.1%
frac-times93.8%
associate-*l/93.2%
times-frac98.9%
Applied egg-rr98.9%
Taylor expanded in z around inf 97.9%
if -1 < z < 1Initial program 82.8%
*-commutative82.8%
sqr-neg82.8%
times-frac82.6%
sqr-neg82.6%
Simplified82.6%
*-commutative82.6%
clear-num82.6%
associate-/r*89.1%
frac-times96.7%
*-un-lft-identity96.7%
Applied egg-rr96.7%
Taylor expanded in z around 0 95.4%
if 1 < z Initial program 77.8%
*-commutative77.8%
sqr-neg77.8%
times-frac94.0%
sqr-neg94.0%
Simplified94.0%
*-commutative94.0%
clear-num93.9%
associate-/r*97.9%
frac-times97.4%
*-un-lft-identity97.4%
Applied egg-rr97.4%
Taylor expanded in z around inf 94.0%
unpow294.0%
associate-*r/97.4%
Simplified97.4%
associate-/r*98.0%
div-inv97.9%
clear-num97.9%
Applied egg-rr97.9%
Final simplification96.6%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z) :precision binary64 (if (<= z -1.0) (* (/ y z) (/ (/ x z) z)) (if (<= z 0.76) (/ (- (/ x z) x) (/ z y)) (* (/ x z) (/ (/ y z) z)))))
assert(x < y);
double code(double x, double y, double z) {
double tmp;
if (z <= -1.0) {
tmp = (y / z) * ((x / z) / z);
} else if (z <= 0.76) {
tmp = ((x / z) - x) / (z / y);
} else {
tmp = (x / z) * ((y / z) / z);
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
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 <= (-1.0d0)) then
tmp = (y / z) * ((x / z) / z)
else if (z <= 0.76d0) then
tmp = ((x / z) - x) / (z / y)
else
tmp = (x / z) * ((y / z) / z)
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z) {
double tmp;
if (z <= -1.0) {
tmp = (y / z) * ((x / z) / z);
} else if (z <= 0.76) {
tmp = ((x / z) - x) / (z / y);
} else {
tmp = (x / z) * ((y / z) / z);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z): tmp = 0 if z <= -1.0: tmp = (y / z) * ((x / z) / z) elif z <= 0.76: tmp = ((x / z) - x) / (z / y) else: tmp = (x / z) * ((y / z) / z) return tmp
x, y = sort([x, y]) function code(x, y, z) tmp = 0.0 if (z <= -1.0) tmp = Float64(Float64(y / z) * Float64(Float64(x / z) / z)); elseif (z <= 0.76) tmp = Float64(Float64(Float64(x / z) - x) / Float64(z / y)); else tmp = Float64(Float64(x / z) * Float64(Float64(y / z) / z)); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z)
tmp = 0.0;
if (z <= -1.0)
tmp = (y / z) * ((x / z) / z);
elseif (z <= 0.76)
tmp = ((x / z) - x) / (z / y);
else
tmp = (x / z) * ((y / z) / z);
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_] := If[LessEqual[z, -1.0], N[(N[(y / z), $MachinePrecision] * N[(N[(x / z), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 0.76], N[(N[(N[(x / z), $MachinePrecision] - x), $MachinePrecision] / N[(z / y), $MachinePrecision]), $MachinePrecision], N[(N[(x / z), $MachinePrecision] * N[(N[(y / z), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1:\\
\;\;\;\;\frac{y}{z} \cdot \frac{\frac{x}{z}}{z}\\
\mathbf{elif}\;z \leq 0.76:\\
\;\;\;\;\frac{\frac{x}{z} - x}{\frac{z}{y}}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{z} \cdot \frac{\frac{y}{z}}{z}\\
\end{array}
\end{array}
if z < -1Initial program 93.1%
associate-*l*93.1%
times-frac93.8%
associate-/r*96.9%
associate-*r/98.4%
Simplified98.4%
frac-times93.1%
associate-/r*93.1%
*-commutative93.1%
frac-times93.8%
associate-*l/93.2%
times-frac98.9%
Applied egg-rr98.9%
Taylor expanded in z around inf 97.9%
if -1 < z < 0.76000000000000001Initial program 82.8%
associate-*l*82.8%
times-frac96.4%
associate-/r*96.4%
associate-*r/96.4%
Simplified96.4%
frac-times82.7%
associate-/r*82.8%
*-commutative82.8%
frac-times82.6%
associate-*l/82.7%
times-frac96.4%
Applied egg-rr96.4%
*-commutative96.4%
clear-num96.4%
un-div-inv97.5%
associate-/l/97.5%
+-commutative97.5%
distribute-lft-in97.5%
*-rgt-identity97.5%
Applied egg-rr97.5%
Taylor expanded in z around 0 97.0%
neg-mul-197.0%
+-commutative97.0%
unsub-neg97.0%
Simplified97.0%
if 0.76000000000000001 < z Initial program 77.8%
*-commutative77.8%
sqr-neg77.8%
times-frac94.0%
sqr-neg94.0%
Simplified94.0%
*-commutative94.0%
clear-num93.9%
associate-/r*97.9%
frac-times97.4%
*-un-lft-identity97.4%
Applied egg-rr97.4%
Taylor expanded in z around inf 94.0%
unpow294.0%
associate-*r/97.4%
Simplified97.4%
associate-/r*98.0%
div-inv97.9%
clear-num97.9%
Applied egg-rr97.9%
Final simplification97.4%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z) :precision binary64 (* (/ y z) (/ (/ x (+ z 1.0)) z)))
assert(x < y);
double code(double x, double y, double z) {
return (y / z) * ((x / (z + 1.0)) / z);
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = (y / z) * ((x / (z + 1.0d0)) / z)
end function
assert x < y;
public static double code(double x, double y, double z) {
return (y / z) * ((x / (z + 1.0)) / z);
}
[x, y] = sort([x, y]) def code(x, y, z): return (y / z) * ((x / (z + 1.0)) / z)
x, y = sort([x, y]) function code(x, y, z) return Float64(Float64(y / z) * Float64(Float64(x / Float64(z + 1.0)) / z)) end
x, y = num2cell(sort([x, y])){:}
function tmp = code(x, y, z)
tmp = (y / z) * ((x / (z + 1.0)) / z);
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_] := N[(N[(y / z), $MachinePrecision] * N[(N[(x / N[(z + 1.0), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\frac{y}{z} \cdot \frac{\frac{x}{z + 1}}{z}
\end{array}
Initial program 84.2%
associate-*l*84.2%
times-frac95.3%
associate-/r*96.9%
associate-*r/96.9%
Simplified96.9%
frac-times85.0%
associate-/r*84.2%
*-commutative84.2%
frac-times87.7%
associate-*l/86.6%
times-frac97.2%
Applied egg-rr97.2%
Final simplification97.2%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z) :precision binary64 (if (<= x -1.5e-13) (* x (/ y (* z z))) (* y (/ (/ x z) z))))
assert(x < y);
double code(double x, double y, double z) {
double tmp;
if (x <= -1.5e-13) {
tmp = x * (y / (z * z));
} else {
tmp = y * ((x / z) / z);
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
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 (x <= (-1.5d-13)) then
tmp = x * (y / (z * z))
else
tmp = y * ((x / z) / z)
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z) {
double tmp;
if (x <= -1.5e-13) {
tmp = x * (y / (z * z));
} else {
tmp = y * ((x / z) / z);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z): tmp = 0 if x <= -1.5e-13: tmp = x * (y / (z * z)) else: tmp = y * ((x / z) / z) return tmp
x, y = sort([x, y]) function code(x, y, z) tmp = 0.0 if (x <= -1.5e-13) tmp = Float64(x * Float64(y / Float64(z * z))); else tmp = Float64(y * Float64(Float64(x / z) / z)); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z)
tmp = 0.0;
if (x <= -1.5e-13)
tmp = x * (y / (z * z));
else
tmp = y * ((x / z) / z);
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_] := If[LessEqual[x, -1.5e-13], N[(x * N[(y / N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * N[(N[(x / z), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.5 \cdot 10^{-13}:\\
\;\;\;\;x \cdot \frac{y}{z \cdot z}\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{\frac{x}{z}}{z}\\
\end{array}
\end{array}
if x < -1.49999999999999992e-13Initial program 85.2%
*-commutative85.2%
sqr-neg85.2%
times-frac93.8%
sqr-neg93.8%
Simplified93.8%
Taylor expanded in z around 0 76.7%
if -1.49999999999999992e-13 < x Initial program 83.8%
*-commutative83.8%
sqr-neg83.8%
times-frac85.4%
sqr-neg85.4%
Simplified85.4%
*-commutative85.4%
clear-num85.3%
associate-/r*91.0%
frac-times96.6%
*-un-lft-identity96.6%
Applied egg-rr96.6%
Taylor expanded in z around 0 74.3%
unpow274.3%
associate-/r*78.7%
associate-*r/83.9%
associate-*r/81.1%
Simplified81.1%
Final simplification79.9%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z) :precision binary64 (if (<= y 4.3e-72) (/ x (* z (/ z y))) (* y (/ (/ x z) z))))
assert(x < y);
double code(double x, double y, double z) {
double tmp;
if (y <= 4.3e-72) {
tmp = x / (z * (z / y));
} else {
tmp = y * ((x / z) / z);
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
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 (y <= 4.3d-72) then
tmp = x / (z * (z / y))
else
tmp = y * ((x / z) / z)
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z) {
double tmp;
if (y <= 4.3e-72) {
tmp = x / (z * (z / y));
} else {
tmp = y * ((x / z) / z);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z): tmp = 0 if y <= 4.3e-72: tmp = x / (z * (z / y)) else: tmp = y * ((x / z) / z) return tmp
x, y = sort([x, y]) function code(x, y, z) tmp = 0.0 if (y <= 4.3e-72) tmp = Float64(x / Float64(z * Float64(z / y))); else tmp = Float64(y * Float64(Float64(x / z) / z)); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z)
tmp = 0.0;
if (y <= 4.3e-72)
tmp = x / (z * (z / y));
else
tmp = y * ((x / z) / z);
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_] := If[LessEqual[y, 4.3e-72], N[(x / N[(z * N[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * N[(N[(x / z), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 4.3 \cdot 10^{-72}:\\
\;\;\;\;\frac{x}{z \cdot \frac{z}{y}}\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{\frac{x}{z}}{z}\\
\end{array}
\end{array}
if y < 4.2999999999999999e-72Initial program 83.9%
*-commutative83.9%
associate-*r/85.8%
sqr-neg85.8%
associate-*l*85.8%
associate-*l*85.8%
sqr-neg85.8%
associate-*l*85.8%
distribute-lft-in85.8%
fma-def85.8%
*-rgt-identity85.8%
Simplified85.8%
Taylor expanded in z around 0 72.7%
unpow272.7%
Simplified72.7%
associate-*r/71.3%
frac-times78.2%
clear-num78.2%
frac-times80.0%
*-un-lft-identity80.0%
Applied egg-rr80.0%
if 4.2999999999999999e-72 < y Initial program 85.2%
*-commutative85.2%
sqr-neg85.2%
times-frac90.0%
sqr-neg90.0%
Simplified90.0%
*-commutative90.0%
clear-num90.0%
associate-/r*93.6%
frac-times97.7%
*-un-lft-identity97.7%
Applied egg-rr97.7%
Taylor expanded in z around 0 77.9%
unpow277.9%
associate-/r*79.3%
associate-*r/81.3%
associate-*r/84.9%
Simplified84.9%
Final simplification81.2%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z) :precision binary64 (if (<= y 4.3e-74) (/ x (* z (/ z y))) (/ y (* z (/ z x)))))
assert(x < y);
double code(double x, double y, double z) {
double tmp;
if (y <= 4.3e-74) {
tmp = x / (z * (z / y));
} else {
tmp = y / (z * (z / x));
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
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 (y <= 4.3d-74) then
tmp = x / (z * (z / y))
else
tmp = y / (z * (z / x))
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z) {
double tmp;
if (y <= 4.3e-74) {
tmp = x / (z * (z / y));
} else {
tmp = y / (z * (z / x));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z): tmp = 0 if y <= 4.3e-74: tmp = x / (z * (z / y)) else: tmp = y / (z * (z / x)) return tmp
x, y = sort([x, y]) function code(x, y, z) tmp = 0.0 if (y <= 4.3e-74) tmp = Float64(x / Float64(z * Float64(z / y))); else tmp = Float64(y / Float64(z * Float64(z / x))); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z)
tmp = 0.0;
if (y <= 4.3e-74)
tmp = x / (z * (z / y));
else
tmp = y / (z * (z / x));
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_] := If[LessEqual[y, 4.3e-74], N[(x / N[(z * N[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y / N[(z * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 4.3 \cdot 10^{-74}:\\
\;\;\;\;\frac{x}{z \cdot \frac{z}{y}}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{z \cdot \frac{z}{x}}\\
\end{array}
\end{array}
if y < 4.29999999999999972e-74Initial program 84.0%
*-commutative84.0%
associate-*r/85.8%
sqr-neg85.8%
associate-*l*85.8%
associate-*l*85.8%
sqr-neg85.8%
associate-*l*85.8%
distribute-lft-in85.8%
fma-def85.8%
*-rgt-identity85.8%
Simplified85.8%
Taylor expanded in z around 0 73.1%
unpow273.1%
Simplified73.1%
associate-*r/71.7%
frac-times79.0%
clear-num78.9%
frac-times80.5%
*-un-lft-identity80.5%
Applied egg-rr80.5%
if 4.29999999999999972e-74 < y Initial program 85.0%
*-commutative85.0%
associate-*r/88.0%
sqr-neg88.0%
associate-*l*88.0%
associate-*l*88.0%
sqr-neg88.0%
associate-*l*88.0%
distribute-lft-in88.0%
fma-def88.0%
*-rgt-identity88.0%
Simplified88.0%
Taylor expanded in z around 0 78.9%
unpow278.9%
Simplified78.9%
associate-*r/76.5%
*-commutative76.5%
times-frac77.4%
clear-num77.4%
frac-times82.4%
*-un-lft-identity82.4%
Applied egg-rr82.4%
Final simplification81.0%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z) :precision binary64 (if (<= x -5.2e+74) (* x (/ y (* z z))) (/ (/ x z) (/ z y))))
assert(x < y);
double code(double x, double y, double z) {
double tmp;
if (x <= -5.2e+74) {
tmp = x * (y / (z * z));
} else {
tmp = (x / z) / (z / y);
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
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 (x <= (-5.2d+74)) then
tmp = x * (y / (z * z))
else
tmp = (x / z) / (z / y)
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z) {
double tmp;
if (x <= -5.2e+74) {
tmp = x * (y / (z * z));
} else {
tmp = (x / z) / (z / y);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z): tmp = 0 if x <= -5.2e+74: tmp = x * (y / (z * z)) else: tmp = (x / z) / (z / y) return tmp
x, y = sort([x, y]) function code(x, y, z) tmp = 0.0 if (x <= -5.2e+74) tmp = Float64(x * Float64(y / Float64(z * z))); else tmp = Float64(Float64(x / z) / Float64(z / y)); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z)
tmp = 0.0;
if (x <= -5.2e+74)
tmp = x * (y / (z * z));
else
tmp = (x / z) / (z / y);
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_] := If[LessEqual[x, -5.2e+74], N[(x * N[(y / N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / z), $MachinePrecision] / N[(z / y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -5.2 \cdot 10^{+74}:\\
\;\;\;\;x \cdot \frac{y}{z \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{z}}{\frac{z}{y}}\\
\end{array}
\end{array}
if x < -5.2000000000000001e74Initial program 83.1%
*-commutative83.1%
sqr-neg83.1%
times-frac95.1%
sqr-neg95.1%
Simplified95.1%
Taylor expanded in z around 0 78.5%
if -5.2000000000000001e74 < x Initial program 84.5%
*-commutative84.5%
associate-*r/85.8%
sqr-neg85.8%
associate-*l*85.8%
associate-*l*85.8%
sqr-neg85.8%
associate-*l*85.8%
distribute-lft-in85.8%
fma-def85.8%
*-rgt-identity85.8%
Simplified85.8%
Taylor expanded in z around 0 76.1%
unpow276.1%
Simplified76.1%
associate-*r/73.6%
*-commutative73.6%
times-frac82.8%
clear-num82.8%
un-div-inv83.6%
Applied egg-rr83.6%
Final simplification82.6%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z) :precision binary64 (if (<= z -1e-310) (* y (/ (- x) z)) (* (/ y z) x)))
assert(x < y);
double code(double x, double y, double z) {
double tmp;
if (z <= -1e-310) {
tmp = y * (-x / z);
} else {
tmp = (y / z) * x;
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
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 <= (-1d-310)) then
tmp = y * (-x / z)
else
tmp = (y / z) * x
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z) {
double tmp;
if (z <= -1e-310) {
tmp = y * (-x / z);
} else {
tmp = (y / z) * x;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z): tmp = 0 if z <= -1e-310: tmp = y * (-x / z) else: tmp = (y / z) * x return tmp
x, y = sort([x, y]) function code(x, y, z) tmp = 0.0 if (z <= -1e-310) tmp = Float64(y * Float64(Float64(-x) / z)); else tmp = Float64(Float64(y / z) * x); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z)
tmp = 0.0;
if (z <= -1e-310)
tmp = y * (-x / z);
else
tmp = (y / z) * x;
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_] := If[LessEqual[z, -1e-310], N[(y * N[((-x) / z), $MachinePrecision]), $MachinePrecision], N[(N[(y / z), $MachinePrecision] * x), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1 \cdot 10^{-310}:\\
\;\;\;\;y \cdot \frac{-x}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{z} \cdot x\\
\end{array}
\end{array}
if z < -9.999999999999969e-311Initial program 87.1%
associate-*l*87.1%
times-frac95.1%
associate-/r*96.5%
associate-*r/97.1%
Simplified97.1%
Taylor expanded in z around 0 62.8%
*-commutative62.8%
unpow262.8%
times-frac70.4%
associate-*r/70.4%
*-commutative70.4%
neg-mul-170.4%
distribute-rgt-neg-out70.4%
associate-*l/73.2%
distribute-lft-out73.2%
Simplified73.2%
Taylor expanded in z around inf 40.4%
mul-1-neg40.4%
Simplified40.4%
if -9.999999999999969e-311 < z Initial program 80.8%
associate-*l*80.8%
times-frac95.5%
associate-/r*97.4%
associate-*r/96.6%
Simplified96.6%
Taylor expanded in z around 0 40.7%
*-commutative40.7%
unpow240.7%
times-frac48.1%
associate-*r/48.1%
*-commutative48.1%
neg-mul-148.1%
distribute-rgt-neg-out48.1%
associate-*l/47.6%
distribute-lft-out66.6%
Simplified66.6%
Taylor expanded in z around inf 16.4%
mul-1-neg16.4%
Simplified16.4%
clear-num16.4%
add-sqr-sqrt7.2%
sqrt-unprod23.5%
sqr-neg23.5%
sqrt-unprod17.2%
add-sqr-sqrt37.6%
associate-*l/37.6%
*-un-lft-identity37.6%
Applied egg-rr37.6%
associate-/r/34.3%
Applied egg-rr34.3%
Final simplification37.6%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z) :precision binary64 (* y (/ x (* z z))))
assert(x < y);
double code(double x, double y, double z) {
return y * (x / (z * z));
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = y * (x / (z * z))
end function
assert x < y;
public static double code(double x, double y, double z) {
return y * (x / (z * z));
}
[x, y] = sort([x, y]) def code(x, y, z): return y * (x / (z * z))
x, y = sort([x, y]) function code(x, y, z) return Float64(y * Float64(x / Float64(z * z))) end
x, y = num2cell(sort([x, y])){:}
function tmp = code(x, y, z)
tmp = y * (x / (z * z));
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_] := N[(y * N[(x / N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
y \cdot \frac{x}{z \cdot z}
\end{array}
Initial program 84.2%
*-commutative84.2%
associate-*r/86.4%
sqr-neg86.4%
associate-*l*86.4%
associate-*l*86.4%
sqr-neg86.4%
associate-*l*86.4%
distribute-lft-in86.4%
fma-def86.4%
*-rgt-identity86.4%
Simplified86.4%
Taylor expanded in z around 0 74.5%
unpow274.5%
Simplified74.5%
Final simplification74.5%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z) :precision binary64 (* y (/ (/ x z) z)))
assert(x < y);
double code(double x, double y, double z) {
return y * ((x / z) / z);
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = y * ((x / z) / z)
end function
assert x < y;
public static double code(double x, double y, double z) {
return y * ((x / z) / z);
}
[x, y] = sort([x, y]) def code(x, y, z): return y * ((x / z) / z)
x, y = sort([x, y]) function code(x, y, z) return Float64(y * Float64(Float64(x / z) / z)) end
x, y = num2cell(sort([x, y])){:}
function tmp = code(x, y, z)
tmp = y * ((x / z) / z);
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_] := N[(y * N[(N[(x / z), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
y \cdot \frac{\frac{x}{z}}{z}
\end{array}
Initial program 84.2%
*-commutative84.2%
sqr-neg84.2%
times-frac87.7%
sqr-neg87.7%
Simplified87.7%
*-commutative87.7%
clear-num87.7%
associate-/r*92.9%
frac-times97.3%
*-un-lft-identity97.3%
Applied egg-rr97.3%
Taylor expanded in z around 0 72.8%
unpow272.8%
associate-/r*74.6%
associate-*r/78.0%
associate-*r/76.0%
Simplified76.0%
Final simplification76.0%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z) :precision binary64 (* y (/ x z)))
assert(x < y);
double code(double x, double y, double z) {
return y * (x / z);
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = y * (x / z)
end function
assert x < y;
public static double code(double x, double y, double z) {
return y * (x / z);
}
[x, y] = sort([x, y]) def code(x, y, z): return y * (x / z)
x, y = sort([x, y]) function code(x, y, z) return Float64(y * Float64(x / z)) end
x, y = num2cell(sort([x, y])){:}
function tmp = code(x, y, z)
tmp = y * (x / z);
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_] := N[(y * N[(x / z), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
y \cdot \frac{x}{z}
\end{array}
Initial program 84.2%
associate-*l*84.2%
times-frac95.3%
associate-/r*96.9%
associate-*r/96.9%
Simplified96.9%
Taylor expanded in z around 0 52.7%
*-commutative52.7%
unpow252.7%
times-frac60.2%
associate-*r/60.2%
*-commutative60.2%
neg-mul-160.2%
distribute-rgt-neg-out60.2%
associate-*l/61.5%
distribute-lft-out70.2%
Simplified70.2%
Taylor expanded in z around inf 29.4%
mul-1-neg29.4%
Simplified29.4%
clear-num29.4%
add-sqr-sqrt15.9%
sqrt-unprod29.4%
sqr-neg29.4%
sqrt-unprod13.4%
add-sqr-sqrt29.8%
associate-*l/29.8%
*-un-lft-identity29.8%
Applied egg-rr29.8%
associate-/l*24.6%
*-commutative24.6%
associate-*l/29.8%
Applied egg-rr29.8%
Final simplification29.8%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z) :precision binary64 (* (/ y z) x))
assert(x < y);
double code(double x, double y, double z) {
return (y / z) * x;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = (y / z) * x
end function
assert x < y;
public static double code(double x, double y, double z) {
return (y / z) * x;
}
[x, y] = sort([x, y]) def code(x, y, z): return (y / z) * x
x, y = sort([x, y]) function code(x, y, z) return Float64(Float64(y / z) * x) end
x, y = num2cell(sort([x, y])){:}
function tmp = code(x, y, z)
tmp = (y / z) * x;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_] := N[(N[(y / z), $MachinePrecision] * x), $MachinePrecision]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\frac{y}{z} \cdot x
\end{array}
Initial program 84.2%
associate-*l*84.2%
times-frac95.3%
associate-/r*96.9%
associate-*r/96.9%
Simplified96.9%
Taylor expanded in z around 0 52.7%
*-commutative52.7%
unpow252.7%
times-frac60.2%
associate-*r/60.2%
*-commutative60.2%
neg-mul-160.2%
distribute-rgt-neg-out60.2%
associate-*l/61.5%
distribute-lft-out70.2%
Simplified70.2%
Taylor expanded in z around inf 29.4%
mul-1-neg29.4%
Simplified29.4%
clear-num29.4%
add-sqr-sqrt15.9%
sqrt-unprod29.4%
sqr-neg29.4%
sqrt-unprod13.4%
add-sqr-sqrt29.8%
associate-*l/29.8%
*-un-lft-identity29.8%
Applied egg-rr29.8%
associate-/r/28.9%
Applied egg-rr28.9%
Final simplification28.9%
(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 2023279
(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))))