
(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 7 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 (/ (/ x z) (* z (/ (+ z 1.0) y))))
assert(x < y);
double code(double x, double y, double z) {
return (x / z) / (z * ((z + 1.0) / y));
}
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 = (x / z) / (z * ((z + 1.0d0) / y))
end function
assert x < y;
public static double code(double x, double y, double z) {
return (x / z) / (z * ((z + 1.0) / y));
}
[x, y] = sort([x, y]) def code(x, y, z): return (x / z) / (z * ((z + 1.0) / y))
x, y = sort([x, y]) function code(x, y, z) return Float64(Float64(x / z) / Float64(z * Float64(Float64(z + 1.0) / y))) end
x, y = num2cell(sort([x, y])){:}
function tmp = code(x, y, z)
tmp = (x / z) / (z * ((z + 1.0) / y));
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_] := N[(N[(x / z), $MachinePrecision] / N[(z * N[(N[(z + 1.0), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\frac{\frac{x}{z}}{z \cdot \frac{z + 1}{y}}
\end{array}
Initial program 80.1%
associate-*r/82.6%
sqr-neg82.6%
*-commutative82.6%
distribute-rgt1-in68.9%
sqr-neg68.9%
fma-def82.6%
sqr-neg82.6%
cube-unmult82.6%
Simplified82.6%
associate-*r/80.1%
fma-udef66.5%
cube-mult66.6%
distribute-rgt1-in80.1%
*-commutative80.1%
frac-times86.4%
*-commutative86.4%
associate-/r*94.9%
clear-num94.9%
frac-times96.7%
*-un-lft-identity96.7%
Applied egg-rr96.7%
Final simplification96.7%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z) :precision binary64 (if (or (<= z -1.08e+18) (not (<= z 2.95e-10))) (* (/ x z) (/ (/ y z) z)) (/ (/ x (/ z y)) z)))
assert(x < y);
double code(double x, double y, double z) {
double tmp;
if ((z <= -1.08e+18) || !(z <= 2.95e-10)) {
tmp = (x / z) * ((y / z) / z);
} else {
tmp = (x / (z / y)) / 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.08d+18)) .or. (.not. (z <= 2.95d-10))) then
tmp = (x / z) * ((y / z) / z)
else
tmp = (x / (z / y)) / 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.08e+18) || !(z <= 2.95e-10)) {
tmp = (x / z) * ((y / z) / z);
} else {
tmp = (x / (z / y)) / z;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z): tmp = 0 if (z <= -1.08e+18) or not (z <= 2.95e-10): tmp = (x / z) * ((y / z) / z) else: tmp = (x / (z / y)) / z return tmp
x, y = sort([x, y]) function code(x, y, z) tmp = 0.0 if ((z <= -1.08e+18) || !(z <= 2.95e-10)) tmp = Float64(Float64(x / z) * Float64(Float64(y / z) / z)); else tmp = Float64(Float64(x / Float64(z / y)) / z); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z)
tmp = 0.0;
if ((z <= -1.08e+18) || ~((z <= 2.95e-10)))
tmp = (x / z) * ((y / z) / z);
else
tmp = (x / (z / y)) / 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[Or[LessEqual[z, -1.08e+18], N[Not[LessEqual[z, 2.95e-10]], $MachinePrecision]], N[(N[(x / z), $MachinePrecision] * N[(N[(y / z), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(z / y), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.08 \cdot 10^{+18} \lor \neg \left(z \leq 2.95 \cdot 10^{-10}\right):\\
\;\;\;\;\frac{x}{z} \cdot \frac{\frac{y}{z}}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{\frac{z}{y}}}{z}\\
\end{array}
\end{array}
if z < -1.08e18 or 2.9500000000000002e-10 < z Initial program 77.5%
frac-times89.9%
associate-*l/84.6%
times-frac97.5%
Applied egg-rr97.5%
Taylor expanded in z around inf 95.4%
if -1.08e18 < z < 2.9500000000000002e-10Initial program 82.6%
associate-*r/84.1%
sqr-neg84.1%
*-commutative84.1%
distribute-rgt1-in84.1%
sqr-neg84.1%
fma-def84.1%
sqr-neg84.1%
cube-unmult84.1%
Simplified84.1%
associate-*r/82.6%
fma-udef82.6%
cube-mult82.6%
distribute-rgt1-in82.6%
*-commutative82.6%
frac-times83.0%
associate-*l/82.6%
associate-/r*92.4%
associate-*r/92.4%
*-commutative92.4%
Applied egg-rr92.4%
associate-/l/92.4%
*-commutative92.4%
frac-times95.4%
clear-num95.4%
div-inv95.4%
associate-/r/95.4%
Applied egg-rr95.4%
associate-*l/95.4%
associate-/l*95.4%
Applied egg-rr95.4%
Taylor expanded in z around 0 91.2%
associate-/l*94.7%
Simplified94.7%
Final simplification95.1%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z) :precision binary64 (if (or (<= z -2.8e-39) (not (<= z 5e+113))) (* y (/ x (* z z))) (* (/ x z) (/ y z))))
assert(x < y);
double code(double x, double y, double z) {
double tmp;
if ((z <= -2.8e-39) || !(z <= 5e+113)) {
tmp = y * (x / (z * z));
} else {
tmp = (x / z) * (y / 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 <= (-2.8d-39)) .or. (.not. (z <= 5d+113))) then
tmp = y * (x / (z * z))
else
tmp = (x / z) * (y / z)
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -2.8e-39) || !(z <= 5e+113)) {
tmp = y * (x / (z * z));
} else {
tmp = (x / z) * (y / z);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z): tmp = 0 if (z <= -2.8e-39) or not (z <= 5e+113): tmp = y * (x / (z * z)) else: tmp = (x / z) * (y / z) return tmp
x, y = sort([x, y]) function code(x, y, z) tmp = 0.0 if ((z <= -2.8e-39) || !(z <= 5e+113)) tmp = Float64(y * Float64(x / Float64(z * z))); else tmp = Float64(Float64(x / z) * Float64(y / z)); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z)
tmp = 0.0;
if ((z <= -2.8e-39) || ~((z <= 5e+113)))
tmp = y * (x / (z * z));
else
tmp = (x / z) * (y / 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[Or[LessEqual[z, -2.8e-39], N[Not[LessEqual[z, 5e+113]], $MachinePrecision]], N[(y * N[(x / N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / z), $MachinePrecision] * N[(y / z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.8 \cdot 10^{-39} \lor \neg \left(z \leq 5 \cdot 10^{+113}\right):\\
\;\;\;\;y \cdot \frac{x}{z \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{z} \cdot \frac{y}{z}\\
\end{array}
\end{array}
if z < -2.8000000000000001e-39 or 5e113 < z Initial program 79.8%
sqr-neg79.8%
times-frac89.1%
sqr-neg89.1%
Simplified89.1%
Taylor expanded in z around 0 72.9%
if -2.8000000000000001e-39 < z < 5e113Initial program 80.3%
associate-*r/83.5%
sqr-neg83.5%
*-commutative83.5%
distribute-rgt1-in83.5%
sqr-neg83.5%
fma-def83.5%
sqr-neg83.5%
cube-unmult83.5%
Simplified83.5%
Taylor expanded in z around 0 72.0%
*-commutative72.0%
associate-/l*73.4%
Simplified73.4%
pow273.4%
associate-/l*72.0%
times-frac84.7%
Applied egg-rr84.7%
Final simplification79.6%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z) :precision binary64 (if (or (<= z -2.4e-39) (not (<= z 9.6e+114))) (* y (/ x (* z z))) (/ (* x (/ y z)) z)))
assert(x < y);
double code(double x, double y, double z) {
double tmp;
if ((z <= -2.4e-39) || !(z <= 9.6e+114)) {
tmp = y * (x / (z * z));
} else {
tmp = (x * (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 <= (-2.4d-39)) .or. (.not. (z <= 9.6d+114))) then
tmp = y * (x / (z * z))
else
tmp = (x * (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 <= -2.4e-39) || !(z <= 9.6e+114)) {
tmp = y * (x / (z * z));
} else {
tmp = (x * (y / z)) / z;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z): tmp = 0 if (z <= -2.4e-39) or not (z <= 9.6e+114): tmp = y * (x / (z * z)) else: tmp = (x * (y / z)) / z return tmp
x, y = sort([x, y]) function code(x, y, z) tmp = 0.0 if ((z <= -2.4e-39) || !(z <= 9.6e+114)) tmp = Float64(y * Float64(x / Float64(z * z))); else tmp = Float64(Float64(x * 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 <= -2.4e-39) || ~((z <= 9.6e+114)))
tmp = y * (x / (z * z));
else
tmp = (x * (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[Or[LessEqual[z, -2.4e-39], N[Not[LessEqual[z, 9.6e+114]], $MachinePrecision]], N[(y * N[(x / N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * N[(y / z), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.4 \cdot 10^{-39} \lor \neg \left(z \leq 9.6 \cdot 10^{+114}\right):\\
\;\;\;\;y \cdot \frac{x}{z \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot \frac{y}{z}}{z}\\
\end{array}
\end{array}
if z < -2.40000000000000016e-39 or 9.6e114 < z Initial program 79.8%
sqr-neg79.8%
times-frac89.1%
sqr-neg89.1%
Simplified89.1%
Taylor expanded in z around 0 72.9%
if -2.40000000000000016e-39 < z < 9.6e114Initial program 80.3%
associate-*r/83.5%
sqr-neg83.5%
*-commutative83.5%
distribute-rgt1-in83.5%
sqr-neg83.5%
fma-def83.5%
sqr-neg83.5%
cube-unmult83.5%
Simplified83.5%
associate-*r/80.3%
fma-udef80.3%
cube-mult80.3%
distribute-rgt1-in80.3%
*-commutative80.3%
frac-times84.4%
associate-*l/82.8%
associate-/r*91.4%
associate-*r/90.1%
*-commutative90.1%
Applied egg-rr90.1%
associate-/l/90.1%
*-commutative90.1%
frac-times94.1%
clear-num94.1%
div-inv94.1%
associate-/r/93.6%
Applied egg-rr93.6%
Taylor expanded in z around 0 80.6%
associate-*r/84.1%
Simplified84.1%
Final simplification79.3%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z) :precision binary64 (if (or (<= z -6e-85) (not (<= z 1.12e+117))) (* y (/ x (* z z))) (/ (/ x (/ z y)) z)))
assert(x < y);
double code(double x, double y, double z) {
double tmp;
if ((z <= -6e-85) || !(z <= 1.12e+117)) {
tmp = y * (x / (z * z));
} else {
tmp = (x / (z / y)) / 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 <= (-6d-85)) .or. (.not. (z <= 1.12d+117))) then
tmp = y * (x / (z * z))
else
tmp = (x / (z / y)) / z
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -6e-85) || !(z <= 1.12e+117)) {
tmp = y * (x / (z * z));
} else {
tmp = (x / (z / y)) / z;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z): tmp = 0 if (z <= -6e-85) or not (z <= 1.12e+117): tmp = y * (x / (z * z)) else: tmp = (x / (z / y)) / z return tmp
x, y = sort([x, y]) function code(x, y, z) tmp = 0.0 if ((z <= -6e-85) || !(z <= 1.12e+117)) tmp = Float64(y * Float64(x / Float64(z * z))); else tmp = Float64(Float64(x / Float64(z / y)) / z); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z)
tmp = 0.0;
if ((z <= -6e-85) || ~((z <= 1.12e+117)))
tmp = y * (x / (z * z));
else
tmp = (x / (z / y)) / 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[Or[LessEqual[z, -6e-85], N[Not[LessEqual[z, 1.12e+117]], $MachinePrecision]], N[(y * N[(x / N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(z / y), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6 \cdot 10^{-85} \lor \neg \left(z \leq 1.12 \cdot 10^{+117}\right):\\
\;\;\;\;y \cdot \frac{x}{z \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{\frac{z}{y}}}{z}\\
\end{array}
\end{array}
if z < -6.00000000000000044e-85 or 1.12000000000000002e117 < z Initial program 81.3%
sqr-neg81.3%
times-frac90.3%
sqr-neg90.3%
Simplified90.3%
Taylor expanded in z around 0 75.9%
if -6.00000000000000044e-85 < z < 1.12000000000000002e117Initial program 79.0%
associate-*r/82.6%
sqr-neg82.6%
*-commutative82.6%
distribute-rgt1-in82.6%
sqr-neg82.6%
fma-def82.6%
sqr-neg82.6%
cube-unmult82.6%
Simplified82.6%
associate-*r/78.9%
fma-udef78.9%
cube-mult79.0%
distribute-rgt1-in79.0%
*-commutative79.0%
frac-times82.8%
associate-*l/81.7%
associate-/r*91.2%
associate-*r/89.8%
*-commutative89.8%
Applied egg-rr89.8%
associate-/l/89.8%
*-commutative89.8%
frac-times93.5%
clear-num93.4%
div-inv93.4%
associate-/r/92.9%
Applied egg-rr92.9%
associate-*l/93.4%
associate-/l*93.4%
Applied egg-rr93.4%
Taylor expanded in z around 0 79.3%
associate-/l*82.9%
Simplified82.9%
Final simplification79.5%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z) :precision binary64 (* (/ x z) (/ (/ y (+ z 1.0)) z)))
assert(x < y);
double code(double x, double y, double z) {
return (x / z) * ((y / (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 = (x / z) * ((y / (z + 1.0d0)) / z)
end function
assert x < y;
public static double code(double x, double y, double z) {
return (x / z) * ((y / (z + 1.0)) / z);
}
[x, y] = sort([x, y]) def code(x, y, z): return (x / z) * ((y / (z + 1.0)) / z)
x, y = sort([x, y]) function code(x, y, z) return Float64(Float64(x / z) * Float64(Float64(y / Float64(z + 1.0)) / z)) end
x, y = num2cell(sort([x, y])){:}
function tmp = code(x, y, z)
tmp = (x / z) * ((y / (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[(x / z), $MachinePrecision] * N[(N[(y / N[(z + 1.0), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\frac{x}{z} \cdot \frac{\frac{y}{z + 1}}{z}
\end{array}
Initial program 80.1%
frac-times86.4%
associate-*l/83.6%
times-frac96.5%
Applied egg-rr96.5%
Final simplification96.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(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 80.1%
sqr-neg80.1%
times-frac86.4%
sqr-neg86.4%
Simplified86.4%
Taylor expanded in z around 0 72.9%
Final simplification72.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 2023318
(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))))