
(FPCore (x y z) :precision binary64 (/ (* x y) (* (* z z) (+ z 1.0))))
double code(double x, double y, double z) {
return (x * y) / ((z * z) * (z + 1.0));
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = (x * y) / ((z * z) * (z + 1.0d0))
end function
public static double code(double x, double y, double z) {
return (x * y) / ((z * z) * (z + 1.0));
}
def code(x, y, z): return (x * y) / ((z * z) * (z + 1.0))
function code(x, y, z) return Float64(Float64(x * y) / Float64(Float64(z * z) * Float64(z + 1.0))) end
function tmp = code(x, y, z) tmp = (x * y) / ((z * z) * (z + 1.0)); end
code[x_, y_, z_] := N[(N[(x * y), $MachinePrecision] / N[(N[(z * z), $MachinePrecision] * N[(z + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x \cdot y}{\left(z \cdot z\right) \cdot \left(z + 1\right)}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 15 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z) :precision binary64 (/ (* x y) (* (* z z) (+ z 1.0))))
double code(double x, double y, double z) {
return (x * y) / ((z * z) * (z + 1.0));
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = (x * y) / ((z * z) * (z + 1.0d0))
end function
public static double code(double x, double y, double z) {
return (x * y) / ((z * z) * (z + 1.0));
}
def code(x, y, z): return (x * y) / ((z * z) * (z + 1.0))
function code(x, y, z) return Float64(Float64(x * y) / Float64(Float64(z * z) * Float64(z + 1.0))) end
function tmp = code(x, y, z) tmp = (x * y) / ((z * z) * (z + 1.0)); end
code[x_, y_, z_] := N[(N[(x * y), $MachinePrecision] / N[(N[(z * z), $MachinePrecision] * N[(z + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x \cdot y}{\left(z \cdot z\right) \cdot \left(z + 1\right)}
\end{array}
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z) :precision binary64 (/ (/ (/ x (/ z y)) z) (+ z 1.0)))
assert(x < y);
double code(double x, double y, double z) {
return ((x / (z / y)) / z) / (z + 1.0);
}
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) / (z + 1.0d0)
end function
assert x < y;
public static double code(double x, double y, double z) {
return ((x / (z / y)) / z) / (z + 1.0);
}
[x, y] = sort([x, y]) def code(x, y, z): return ((x / (z / y)) / z) / (z + 1.0)
x, y = sort([x, y]) function code(x, y, z) return Float64(Float64(Float64(x / Float64(z / y)) / z) / Float64(z + 1.0)) end
x, y = num2cell(sort([x, y])){:}
function tmp = code(x, y, z)
tmp = ((x / (z / y)) / z) / (z + 1.0);
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_] := N[(N[(N[(x / N[(z / y), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision] / N[(z + 1.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\frac{\frac{\frac{x}{\frac{z}{y}}}{z}}{z + 1}
\end{array}
Initial program 79.5%
associate-*l*79.5%
times-frac95.7%
associate-/r*96.4%
associate-*r/96.5%
Simplified96.5%
associate-*l/96.9%
Applied egg-rr96.9%
Taylor expanded in x around 0 88.1%
associate-/l*97.0%
Simplified97.0%
Final simplification97.0%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z) :precision binary64 (if (or (<= (* x y) -5000.0) (not (<= (* x y) 5e-49))) (* x (/ y (* z z))) (* (/ y z) (/ x z))))
assert(x < y);
double code(double x, double y, double z) {
double tmp;
if (((x * y) <= -5000.0) || !((x * y) <= 5e-49)) {
tmp = x * (y / (z * z));
} else {
tmp = (y / z) * (x / 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 * y) <= (-5000.0d0)) .or. (.not. ((x * y) <= 5d-49))) then
tmp = x * (y / (z * z))
else
tmp = (y / z) * (x / z)
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z) {
double tmp;
if (((x * y) <= -5000.0) || !((x * y) <= 5e-49)) {
tmp = x * (y / (z * z));
} else {
tmp = (y / z) * (x / z);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z): tmp = 0 if ((x * y) <= -5000.0) or not ((x * y) <= 5e-49): tmp = x * (y / (z * z)) else: tmp = (y / z) * (x / z) return tmp
x, y = sort([x, y]) function code(x, y, z) tmp = 0.0 if ((Float64(x * y) <= -5000.0) || !(Float64(x * y) <= 5e-49)) tmp = Float64(x * Float64(y / Float64(z * z))); else tmp = Float64(Float64(y / z) * Float64(x / z)); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z)
tmp = 0.0;
if (((x * y) <= -5000.0) || ~(((x * y) <= 5e-49)))
tmp = x * (y / (z * z));
else
tmp = (y / z) * (x / 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[N[(x * y), $MachinePrecision], -5000.0], N[Not[LessEqual[N[(x * y), $MachinePrecision], 5e-49]], $MachinePrecision]], N[(x * N[(y / N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y / z), $MachinePrecision] * N[(x / z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -5000 \lor \neg \left(x \cdot y \leq 5 \cdot 10^{-49}\right):\\
\;\;\;\;x \cdot \frac{y}{z \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{z} \cdot \frac{x}{z}\\
\end{array}
\end{array}
if (*.f64 x y) < -5e3 or 4.9999999999999999e-49 < (*.f64 x y) Initial program 86.8%
*-commutative86.8%
sqr-neg86.8%
times-frac94.7%
sqr-neg94.7%
Simplified94.7%
Taylor expanded in z around 0 74.6%
if -5e3 < (*.f64 x y) < 4.9999999999999999e-49Initial program 72.1%
*-commutative72.1%
associate-*r/75.1%
sqr-neg75.1%
associate-*l*75.1%
associate-*l*75.1%
sqr-neg75.1%
associate-*l*75.1%
distribute-lft-in75.1%
fma-def75.1%
*-rgt-identity75.1%
Simplified75.1%
Taylor expanded in z around 0 60.6%
unpow260.6%
times-frac88.1%
Simplified88.1%
Final simplification81.3%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z) :precision binary64 (if (or (<= z -4.8e-46) (not (<= z 5.5e-131))) (* (/ y (* z z)) (/ x (+ z 1.0))) (/ (/ x (/ z y)) z)))
assert(x < y);
double code(double x, double y, double z) {
double tmp;
if ((z <= -4.8e-46) || !(z <= 5.5e-131)) {
tmp = (y / (z * z)) * (x / (z + 1.0));
} 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 <= (-4.8d-46)) .or. (.not. (z <= 5.5d-131))) then
tmp = (y / (z * z)) * (x / (z + 1.0d0))
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 <= -4.8e-46) || !(z <= 5.5e-131)) {
tmp = (y / (z * z)) * (x / (z + 1.0));
} else {
tmp = (x / (z / y)) / z;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z): tmp = 0 if (z <= -4.8e-46) or not (z <= 5.5e-131): tmp = (y / (z * z)) * (x / (z + 1.0)) else: tmp = (x / (z / y)) / z return tmp
x, y = sort([x, y]) function code(x, y, z) tmp = 0.0 if ((z <= -4.8e-46) || !(z <= 5.5e-131)) tmp = Float64(Float64(y / Float64(z * z)) * Float64(x / Float64(z + 1.0))); 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 <= -4.8e-46) || ~((z <= 5.5e-131)))
tmp = (y / (z * z)) * (x / (z + 1.0));
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, -4.8e-46], N[Not[LessEqual[z, 5.5e-131]], $MachinePrecision]], N[(N[(y / N[(z * z), $MachinePrecision]), $MachinePrecision] * N[(x / N[(z + 1.0), $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 -4.8 \cdot 10^{-46} \lor \neg \left(z \leq 5.5 \cdot 10^{-131}\right):\\
\;\;\;\;\frac{y}{z \cdot z} \cdot \frac{x}{z + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{\frac{z}{y}}}{z}\\
\end{array}
\end{array}
if z < -4.80000000000000027e-46 or 5.4999999999999997e-131 < z Initial program 87.0%
*-commutative87.0%
sqr-neg87.0%
times-frac95.3%
sqr-neg95.3%
Simplified95.3%
if -4.80000000000000027e-46 < z < 5.4999999999999997e-131Initial program 65.7%
*-commutative65.7%
sqr-neg65.7%
times-frac66.8%
sqr-neg66.8%
Simplified66.8%
Taylor expanded in z around 0 66.8%
*-commutative66.8%
associate-/r*83.0%
associate-*r/97.1%
Applied egg-rr97.1%
Taylor expanded in x around 0 83.7%
associate-/l*97.6%
Simplified97.6%
Final simplification96.1%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z) :precision binary64 (if (<= (* x y) -5000.0) (/ x (/ (* z z) y)) (if (<= (* x y) 5e-49) (* (/ y z) (/ x z)) (* x (/ y (* z z))))))
assert(x < y);
double code(double x, double y, double z) {
double tmp;
if ((x * y) <= -5000.0) {
tmp = x / ((z * z) / y);
} else if ((x * y) <= 5e-49) {
tmp = (y / z) * (x / 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 ((x * y) <= (-5000.0d0)) then
tmp = x / ((z * z) / y)
else if ((x * y) <= 5d-49) then
tmp = (y / z) * (x / 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 ((x * y) <= -5000.0) {
tmp = x / ((z * z) / y);
} else if ((x * y) <= 5e-49) {
tmp = (y / z) * (x / z);
} else {
tmp = x * (y / (z * z));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z): tmp = 0 if (x * y) <= -5000.0: tmp = x / ((z * z) / y) elif (x * y) <= 5e-49: tmp = (y / z) * (x / z) else: tmp = x * (y / (z * z)) return tmp
x, y = sort([x, y]) function code(x, y, z) tmp = 0.0 if (Float64(x * y) <= -5000.0) tmp = Float64(x / Float64(Float64(z * z) / y)); elseif (Float64(x * y) <= 5e-49) tmp = Float64(Float64(y / z) * Float64(x / z)); else tmp = Float64(x * Float64(y / Float64(z * z))); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z)
tmp = 0.0;
if ((x * y) <= -5000.0)
tmp = x / ((z * z) / y);
elseif ((x * y) <= 5e-49)
tmp = (y / z) * (x / 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[LessEqual[N[(x * y), $MachinePrecision], -5000.0], N[(x / N[(N[(z * z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 5e-49], N[(N[(y / z), $MachinePrecision] * N[(x / z), $MachinePrecision]), $MachinePrecision], N[(x * N[(y / N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -5000:\\
\;\;\;\;\frac{x}{\frac{z \cdot z}{y}}\\
\mathbf{elif}\;x \cdot y \leq 5 \cdot 10^{-49}:\\
\;\;\;\;\frac{y}{z} \cdot \frac{x}{z}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{y}{z \cdot z}\\
\end{array}
\end{array}
if (*.f64 x y) < -5e3Initial program 89.9%
*-commutative89.9%
sqr-neg89.9%
times-frac97.2%
sqr-neg97.2%
Simplified97.2%
Taylor expanded in z around 0 80.8%
associate-*l/76.3%
frac-times71.4%
clear-num71.4%
frac-times76.7%
*-un-lft-identity76.7%
Applied egg-rr76.7%
Taylor expanded in z around 0 80.8%
unpow280.8%
Simplified80.8%
if -5e3 < (*.f64 x y) < 4.9999999999999999e-49Initial program 72.1%
*-commutative72.1%
associate-*r/75.1%
sqr-neg75.1%
associate-*l*75.1%
associate-*l*75.1%
sqr-neg75.1%
associate-*l*75.1%
distribute-lft-in75.1%
fma-def75.1%
*-rgt-identity75.1%
Simplified75.1%
Taylor expanded in z around 0 60.6%
unpow260.6%
times-frac88.1%
Simplified88.1%
if 4.9999999999999999e-49 < (*.f64 x y) Initial program 83.1%
*-commutative83.1%
sqr-neg83.1%
times-frac91.7%
sqr-neg91.7%
Simplified91.7%
Taylor expanded in z around 0 67.0%
Final simplification81.4%
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 3.6e-9))) (* (/ 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.0) || !(z <= 3.6e-9)) {
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.0d0)) .or. (.not. (z <= 3.6d-9))) 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.0) || !(z <= 3.6e-9)) {
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.0) or not (z <= 3.6e-9): 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.0) || !(z <= 3.6e-9)) tmp = Float64(Float64(x / z) * Float64(y / 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 <= -1.0) || ~((z <= 3.6e-9)))
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.0], N[Not[LessEqual[z, 3.6e-9]], $MachinePrecision]], N[(N[(x / z), $MachinePrecision] * N[(y / 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 -1 \lor \neg \left(z \leq 3.6 \cdot 10^{-9}\right):\\
\;\;\;\;\frac{x}{z} \cdot \frac{y}{z \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{\frac{z}{y}}}{z}\\
\end{array}
\end{array}
if z < -1 or 3.6e-9 < z Initial program 85.8%
*-commutative85.8%
sqr-neg85.8%
times-frac94.3%
sqr-neg94.3%
Simplified94.3%
Taylor expanded in z around inf 92.5%
if -1 < z < 3.6e-9Initial program 74.1%
*-commutative74.1%
sqr-neg74.1%
times-frac77.6%
sqr-neg77.6%
Simplified77.6%
Taylor expanded in z around 0 77.1%
*-commutative77.1%
associate-/r*87.8%
associate-*r/96.6%
Applied egg-rr96.6%
Taylor expanded in x around 0 85.4%
associate-/l*97.3%
Simplified96.9%
Final simplification94.9%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z) :precision binary64 (if (<= y 4.7e-178) (/ x (* z (/ z y))) (if (<= y 1.9e+99) (* (/ y z) (/ x z)) (* y (/ x (* z z))))))
assert(x < y);
double code(double x, double y, double z) {
double tmp;
if (y <= 4.7e-178) {
tmp = x / (z * (z / y));
} else if (y <= 1.9e+99) {
tmp = (y / z) * (x / 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 (y <= 4.7d-178) then
tmp = x / (z * (z / y))
else if (y <= 1.9d+99) then
tmp = (y / z) * (x / 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 (y <= 4.7e-178) {
tmp = x / (z * (z / y));
} else if (y <= 1.9e+99) {
tmp = (y / z) * (x / z);
} else {
tmp = y * (x / (z * z));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z): tmp = 0 if y <= 4.7e-178: tmp = x / (z * (z / y)) elif y <= 1.9e+99: tmp = (y / z) * (x / z) else: tmp = y * (x / (z * z)) return tmp
x, y = sort([x, y]) function code(x, y, z) tmp = 0.0 if (y <= 4.7e-178) tmp = Float64(x / Float64(z * Float64(z / y))); elseif (y <= 1.9e+99) tmp = Float64(Float64(y / z) * Float64(x / z)); else tmp = Float64(y * Float64(x / Float64(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.7e-178)
tmp = x / (z * (z / y));
elseif (y <= 1.9e+99)
tmp = (y / z) * (x / 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[y, 4.7e-178], N[(x / N[(z * N[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.9e+99], N[(N[(y / z), $MachinePrecision] * N[(x / z), $MachinePrecision]), $MachinePrecision], N[(y * N[(x / N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 4.7 \cdot 10^{-178}:\\
\;\;\;\;\frac{x}{z \cdot \frac{z}{y}}\\
\mathbf{elif}\;y \leq 1.9 \cdot 10^{+99}:\\
\;\;\;\;\frac{y}{z} \cdot \frac{x}{z}\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{x}{z \cdot z}\\
\end{array}
\end{array}
if y < 4.69999999999999999e-178Initial program 78.0%
*-commutative78.0%
sqr-neg78.0%
times-frac83.1%
sqr-neg83.1%
Simplified83.1%
Taylor expanded in z around 0 71.2%
associate-*l/65.6%
frac-times80.6%
clear-num80.7%
frac-times80.5%
*-un-lft-identity80.5%
Applied egg-rr80.5%
if 4.69999999999999999e-178 < y < 1.9e99Initial program 82.1%
*-commutative82.1%
associate-*r/80.3%
sqr-neg80.3%
associate-*l*80.3%
associate-*l*80.3%
sqr-neg80.3%
associate-*l*80.3%
distribute-lft-in80.3%
fma-def80.3%
*-rgt-identity80.3%
Simplified80.3%
Taylor expanded in z around 0 61.7%
unpow261.7%
times-frac75.5%
Simplified75.5%
if 1.9e99 < y Initial program 81.5%
*-commutative81.5%
associate-*r/83.8%
sqr-neg83.8%
associate-*l*83.8%
associate-*l*83.8%
sqr-neg83.8%
associate-*l*83.8%
distribute-lft-in83.8%
fma-def83.8%
*-rgt-identity83.8%
Simplified83.8%
Taylor expanded in z around 0 68.8%
unpow268.8%
*-rgt-identity68.8%
times-frac78.2%
/-rgt-identity78.2%
Simplified78.2%
Final simplification79.1%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z) :precision binary64 (/ (* (/ y z) (/ x z)) (+ z 1.0)))
assert(x < y);
double code(double x, double y, double z) {
return ((y / z) * (x / z)) / (z + 1.0);
}
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)) / (z + 1.0d0)
end function
assert x < y;
public static double code(double x, double y, double z) {
return ((y / z) * (x / z)) / (z + 1.0);
}
[x, y] = sort([x, y]) def code(x, y, z): return ((y / z) * (x / z)) / (z + 1.0)
x, y = sort([x, y]) function code(x, y, z) return Float64(Float64(Float64(y / z) * Float64(x / z)) / Float64(z + 1.0)) end
x, y = num2cell(sort([x, y])){:}
function tmp = code(x, y, z)
tmp = ((y / z) * (x / z)) / (z + 1.0);
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_] := N[(N[(N[(y / z), $MachinePrecision] * N[(x / z), $MachinePrecision]), $MachinePrecision] / N[(z + 1.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\frac{\frac{y}{z} \cdot \frac{x}{z}}{z + 1}
\end{array}
Initial program 79.5%
associate-*l*79.5%
times-frac95.7%
associate-/r*96.4%
associate-*r/96.5%
Simplified96.5%
Final simplification96.5%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z) :precision binary64 (/ (/ (* x (/ y z)) z) (+ z 1.0)))
assert(x < y);
double code(double x, double y, double z) {
return ((x * (y / z)) / z) / (z + 1.0);
}
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 * (y / z)) / z) / (z + 1.0d0)
end function
assert x < y;
public static double code(double x, double y, double z) {
return ((x * (y / z)) / z) / (z + 1.0);
}
[x, y] = sort([x, y]) def code(x, y, z): return ((x * (y / z)) / z) / (z + 1.0)
x, y = sort([x, y]) function code(x, y, z) return Float64(Float64(Float64(x * Float64(y / z)) / z) / Float64(z + 1.0)) end
x, y = num2cell(sort([x, y])){:}
function tmp = code(x, y, z)
tmp = ((x * (y / z)) / z) / (z + 1.0);
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_] := N[(N[(N[(x * N[(y / z), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision] / N[(z + 1.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\frac{\frac{x \cdot \frac{y}{z}}{z}}{z + 1}
\end{array}
Initial program 79.5%
associate-*l*79.5%
times-frac95.7%
associate-/r*96.4%
associate-*r/96.5%
Simplified96.5%
associate-*l/96.9%
Applied egg-rr96.9%
Final simplification96.9%
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 (/ x z)) (if (<= z -1e-309) (* (/ y z) (- x)) (* x (/ y z)))))
assert(x < y);
double code(double x, double y, double z) {
double tmp;
if (z <= -1.0) {
tmp = y * (x / z);
} else if (z <= -1e-309) {
tmp = (y / z) * -x;
} else {
tmp = x * (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.0d0)) then
tmp = y * (x / z)
else if (z <= (-1d-309)) then
tmp = (y / z) * -x
else
tmp = x * (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.0) {
tmp = y * (x / z);
} else if (z <= -1e-309) {
tmp = (y / z) * -x;
} else {
tmp = x * (y / z);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z): tmp = 0 if z <= -1.0: tmp = y * (x / z) elif z <= -1e-309: tmp = (y / z) * -x else: tmp = x * (y / z) return tmp
x, y = sort([x, y]) function code(x, y, z) tmp = 0.0 if (z <= -1.0) tmp = Float64(y * Float64(x / z)); elseif (z <= -1e-309) tmp = Float64(Float64(y / z) * Float64(-x)); else tmp = Float64(x * 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 <= -1.0)
tmp = y * (x / z);
elseif (z <= -1e-309)
tmp = (y / z) * -x;
else
tmp = x * (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[LessEqual[z, -1.0], N[(y * N[(x / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -1e-309], N[(N[(y / z), $MachinePrecision] * (-x)), $MachinePrecision], N[(x * N[(y / z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1:\\
\;\;\;\;y \cdot \frac{x}{z}\\
\mathbf{elif}\;z \leq -1 \cdot 10^{-309}:\\
\;\;\;\;\frac{y}{z} \cdot \left(-x\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{y}{z}\\
\end{array}
\end{array}
if z < -1Initial program 88.2%
*-commutative88.2%
associate-*r/88.5%
sqr-neg88.5%
associate-*l*88.5%
associate-*l*88.5%
sqr-neg88.5%
associate-*l*88.5%
distribute-lft-in88.5%
fma-def88.5%
*-rgt-identity88.5%
Simplified88.5%
Taylor expanded in z around 0 34.2%
+-commutative34.2%
unpow234.2%
times-frac34.3%
mul-1-neg34.3%
associate-*r/40.0%
distribute-lft-neg-in40.0%
distribute-rgt-out40.0%
Simplified40.0%
Taylor expanded in z around inf 34.3%
mul-1-neg34.3%
associate-*r/40.0%
distribute-lft-neg-in40.0%
Simplified40.0%
add-sqr-sqrt15.8%
sqrt-unprod39.9%
sqr-neg39.9%
sqrt-unprod26.3%
add-sqr-sqrt44.3%
associate-*r/38.6%
associate-/l*44.3%
Applied egg-rr44.3%
associate-/r/45.7%
Applied egg-rr45.7%
if -1 < z < -1.000000000000002e-309Initial program 72.6%
*-commutative72.6%
associate-*r/77.7%
sqr-neg77.7%
associate-*l*77.7%
associate-*l*77.7%
sqr-neg77.7%
associate-*l*77.7%
distribute-lft-in77.7%
fma-def77.7%
*-rgt-identity77.7%
Simplified77.7%
Taylor expanded in z around 0 72.6%
+-commutative72.6%
unpow272.6%
times-frac95.0%
mul-1-neg95.0%
associate-*r/95.0%
distribute-lft-neg-in95.0%
distribute-rgt-out95.0%
Simplified95.0%
Taylor expanded in z around inf 32.7%
mul-1-neg32.7%
associate-*r/32.8%
distribute-lft-neg-in32.8%
Simplified32.8%
if -1.000000000000002e-309 < z Initial program 78.1%
*-commutative78.1%
associate-*r/81.9%
sqr-neg81.9%
associate-*l*82.0%
associate-*l*81.9%
sqr-neg81.9%
associate-*l*82.0%
distribute-lft-in82.0%
fma-def82.0%
*-rgt-identity82.0%
Simplified82.0%
Taylor expanded in z around 0 38.6%
+-commutative38.6%
unpow238.6%
times-frac52.7%
mul-1-neg52.7%
associate-*r/54.1%
distribute-lft-neg-in54.1%
distribute-rgt-out75.1%
Simplified75.1%
Taylor expanded in z around inf 13.2%
mul-1-neg13.2%
associate-*r/16.2%
distribute-lft-neg-in16.2%
Simplified16.2%
add-sqr-sqrt10.6%
sqrt-unprod30.2%
sqr-neg30.2%
sqrt-unprod20.2%
add-sqr-sqrt39.3%
associate-*r/34.8%
associate-/l*38.6%
Applied egg-rr38.6%
div-inv39.3%
clear-num39.3%
*-commutative39.3%
Applied egg-rr39.3%
Final simplification39.4%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z) :precision binary64 (if (<= y 1.85e+99) (* (/ y z) (/ x z)) (* y (/ x (* z z)))))
assert(x < y);
double code(double x, double y, double z) {
double tmp;
if (y <= 1.85e+99) {
tmp = (y / z) * (x / 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 (y <= 1.85d+99) then
tmp = (y / z) * (x / 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 (y <= 1.85e+99) {
tmp = (y / z) * (x / z);
} else {
tmp = y * (x / (z * z));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z): tmp = 0 if y <= 1.85e+99: tmp = (y / z) * (x / z) else: tmp = y * (x / (z * z)) return tmp
x, y = sort([x, y]) function code(x, y, z) tmp = 0.0 if (y <= 1.85e+99) tmp = Float64(Float64(y / z) * Float64(x / z)); else tmp = Float64(y * Float64(x / Float64(z * z))); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z)
tmp = 0.0;
if (y <= 1.85e+99)
tmp = (y / z) * (x / 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[y, 1.85e+99], N[(N[(y / z), $MachinePrecision] * N[(x / z), $MachinePrecision]), $MachinePrecision], N[(y * N[(x / N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 1.85 \cdot 10^{+99}:\\
\;\;\;\;\frac{y}{z} \cdot \frac{x}{z}\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{x}{z \cdot z}\\
\end{array}
\end{array}
if y < 1.85000000000000005e99Initial program 78.9%
*-commutative78.9%
associate-*r/82.3%
sqr-neg82.3%
associate-*l*82.4%
associate-*l*82.3%
sqr-neg82.3%
associate-*l*82.4%
distribute-lft-in82.4%
fma-def82.4%
*-rgt-identity82.4%
Simplified82.4%
Taylor expanded in z around 0 64.7%
unpow264.7%
times-frac79.4%
Simplified79.4%
if 1.85000000000000005e99 < y Initial program 81.5%
*-commutative81.5%
associate-*r/83.8%
sqr-neg83.8%
associate-*l*83.8%
associate-*l*83.8%
sqr-neg83.8%
associate-*l*83.8%
distribute-lft-in83.8%
fma-def83.8%
*-rgt-identity83.8%
Simplified83.8%
Taylor expanded in z around 0 68.8%
unpow268.8%
*-rgt-identity68.8%
times-frac78.2%
/-rgt-identity78.2%
Simplified78.2%
Final simplification79.2%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z) :precision binary64 (if (<= y 1e-90) (/ x (* z (/ z y))) (/ y (* z (/ z x)))))
assert(x < y);
double code(double x, double y, double z) {
double tmp;
if (y <= 1e-90) {
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 <= 1d-90) 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 <= 1e-90) {
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 <= 1e-90: 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 <= 1e-90) 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 <= 1e-90)
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, 1e-90], 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 10^{-90}:\\
\;\;\;\;\frac{x}{z \cdot \frac{z}{y}}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{z \cdot \frac{z}{x}}\\
\end{array}
\end{array}
if y < 9.99999999999999995e-91Initial program 79.6%
*-commutative79.6%
sqr-neg79.6%
times-frac84.3%
sqr-neg84.3%
Simplified84.3%
Taylor expanded in z around 0 71.2%
associate-*l/66.0%
frac-times79.9%
clear-num79.9%
frac-times79.8%
*-un-lft-identity79.8%
Applied egg-rr79.8%
if 9.99999999999999995e-91 < y Initial program 79.2%
*-commutative79.2%
associate-*r/81.7%
sqr-neg81.7%
associate-*l*81.7%
associate-*l*81.7%
sqr-neg81.7%
associate-*l*81.7%
distribute-lft-in81.7%
fma-def81.7%
*-rgt-identity81.7%
Simplified81.7%
Taylor expanded in z around 0 64.7%
unpow264.7%
times-frac70.3%
Simplified70.3%
clear-num70.3%
frac-times78.9%
*-un-lft-identity78.9%
Applied egg-rr78.9%
Final simplification79.5%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z) :precision binary64 (if (<= z -1e-309) (* y (/ (- x) z)) (* x (/ y z))))
assert(x < y);
double code(double x, double y, double z) {
double tmp;
if (z <= -1e-309) {
tmp = y * (-x / z);
} else {
tmp = x * (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 <= (-1d-309)) then
tmp = y * (-x / z)
else
tmp = x * (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 <= -1e-309) {
tmp = y * (-x / z);
} else {
tmp = x * (y / z);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z): tmp = 0 if z <= -1e-309: tmp = y * (-x / z) else: tmp = x * (y / z) return tmp
x, y = sort([x, y]) function code(x, y, z) tmp = 0.0 if (z <= -1e-309) tmp = Float64(y * Float64(Float64(-x) / z)); else tmp = Float64(x * 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 <= -1e-309)
tmp = y * (-x / z);
else
tmp = x * (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[LessEqual[z, -1e-309], N[(y * N[((-x) / z), $MachinePrecision]), $MachinePrecision], N[(x * N[(y / z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1 \cdot 10^{-309}:\\
\;\;\;\;y \cdot \frac{-x}{z}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{y}{z}\\
\end{array}
\end{array}
if z < -1.000000000000002e-309Initial program 80.8%
*-commutative80.8%
associate-*r/83.4%
sqr-neg83.4%
associate-*l*83.4%
associate-*l*83.4%
sqr-neg83.4%
associate-*l*83.4%
distribute-lft-in83.4%
fma-def83.4%
*-rgt-identity83.4%
Simplified83.4%
Taylor expanded in z around 0 52.4%
+-commutative52.4%
unpow252.4%
times-frac63.0%
mul-1-neg63.0%
associate-*r/66.0%
distribute-lft-neg-in66.0%
distribute-rgt-out66.0%
Simplified66.0%
Taylor expanded in z around inf 33.5%
mul-1-neg33.5%
associate-*r/36.6%
distribute-lft-neg-in36.6%
Simplified36.6%
Taylor expanded in x around 0 33.5%
mul-1-neg33.5%
associate-*l/41.0%
distribute-lft-neg-out41.0%
*-commutative41.0%
distribute-frac-neg41.0%
Simplified41.0%
if -1.000000000000002e-309 < z Initial program 78.1%
*-commutative78.1%
associate-*r/81.9%
sqr-neg81.9%
associate-*l*82.0%
associate-*l*81.9%
sqr-neg81.9%
associate-*l*82.0%
distribute-lft-in82.0%
fma-def82.0%
*-rgt-identity82.0%
Simplified82.0%
Taylor expanded in z around 0 38.6%
+-commutative38.6%
unpow238.6%
times-frac52.7%
mul-1-neg52.7%
associate-*r/54.1%
distribute-lft-neg-in54.1%
distribute-rgt-out75.1%
Simplified75.1%
Taylor expanded in z around inf 13.2%
mul-1-neg13.2%
associate-*r/16.2%
distribute-lft-neg-in16.2%
Simplified16.2%
add-sqr-sqrt10.6%
sqrt-unprod30.2%
sqr-neg30.2%
sqrt-unprod20.2%
add-sqr-sqrt39.3%
associate-*r/34.8%
associate-/l*38.6%
Applied egg-rr38.6%
div-inv39.3%
clear-num39.3%
*-commutative39.3%
Applied egg-rr39.3%
Final simplification40.2%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z) :precision binary64 (if (<= y 1e+171) (* x (/ y z)) (* y (/ x z))))
assert(x < y);
double code(double x, double y, double z) {
double tmp;
if (y <= 1e+171) {
tmp = x * (y / z);
} else {
tmp = y * (x / 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 <= 1d+171) then
tmp = x * (y / z)
else
tmp = y * (x / z)
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z) {
double tmp;
if (y <= 1e+171) {
tmp = x * (y / z);
} else {
tmp = y * (x / z);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z): tmp = 0 if y <= 1e+171: tmp = x * (y / z) else: tmp = y * (x / z) return tmp
x, y = sort([x, y]) function code(x, y, z) tmp = 0.0 if (y <= 1e+171) tmp = Float64(x * Float64(y / z)); else tmp = Float64(y * Float64(x / z)); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z)
tmp = 0.0;
if (y <= 1e+171)
tmp = x * (y / z);
else
tmp = y * (x / 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, 1e+171], N[(x * N[(y / z), $MachinePrecision]), $MachinePrecision], N[(y * N[(x / z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 10^{+171}:\\
\;\;\;\;x \cdot \frac{y}{z}\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{x}{z}\\
\end{array}
\end{array}
if y < 9.99999999999999954e170Initial program 79.8%
*-commutative79.8%
associate-*r/82.6%
sqr-neg82.6%
associate-*l*82.6%
associate-*l*82.6%
sqr-neg82.6%
associate-*l*82.6%
distribute-lft-in82.6%
fma-def82.6%
*-rgt-identity82.6%
Simplified82.6%
Taylor expanded in z around 0 46.8%
+-commutative46.8%
unpow246.8%
times-frac61.5%
mul-1-neg61.5%
associate-*r/64.0%
distribute-lft-neg-in64.0%
distribute-rgt-out73.9%
Simplified73.9%
Taylor expanded in z around inf 23.4%
mul-1-neg23.4%
associate-*r/26.9%
distribute-lft-neg-in26.9%
Simplified26.9%
add-sqr-sqrt13.3%
sqrt-unprod30.0%
sqr-neg30.0%
sqrt-unprod18.7%
add-sqr-sqrt34.3%
associate-*r/30.0%
associate-/l*33.9%
Applied egg-rr33.9%
div-inv34.3%
clear-num34.3%
*-commutative34.3%
Applied egg-rr34.3%
if 9.99999999999999954e170 < y Initial program 77.2%
*-commutative77.2%
associate-*r/83.2%
sqr-neg83.2%
associate-*l*83.2%
associate-*l*83.2%
sqr-neg83.2%
associate-*l*83.2%
distribute-lft-in83.2%
fma-def83.2%
*-rgt-identity83.2%
Simplified83.2%
Taylor expanded in z around 0 36.4%
+-commutative36.4%
unpow236.4%
times-frac33.7%
mul-1-neg33.7%
associate-*r/33.8%
distribute-lft-neg-in33.8%
distribute-rgt-out48.5%
Simplified48.5%
Taylor expanded in z around inf 22.5%
mul-1-neg22.5%
associate-*r/22.5%
distribute-lft-neg-in22.5%
Simplified22.5%
add-sqr-sqrt12.9%
sqrt-unprod34.4%
sqr-neg34.4%
sqrt-unprod13.1%
add-sqr-sqrt20.1%
associate-*r/20.0%
associate-/l*20.1%
Applied egg-rr20.1%
associate-/r/34.2%
Applied egg-rr34.2%
Final simplification34.3%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z) :precision binary64 (* (/ y z) (/ x z)))
assert(x < y);
double code(double x, double y, double z) {
return (y / z) * (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 / z) * (x / z)
end function
assert x < y;
public static double code(double x, double y, double z) {
return (y / z) * (x / z);
}
[x, y] = sort([x, y]) def code(x, y, z): return (y / z) * (x / z)
x, y = sort([x, y]) function code(x, y, z) return Float64(Float64(y / z) * Float64(x / z)) end
x, y = num2cell(sort([x, y])){:}
function tmp = code(x, y, z)
tmp = (y / z) * (x / 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[(x / z), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\frac{y}{z} \cdot \frac{x}{z}
\end{array}
Initial program 79.5%
*-commutative79.5%
associate-*r/82.6%
sqr-neg82.6%
associate-*l*82.7%
associate-*l*82.6%
sqr-neg82.6%
associate-*l*82.7%
distribute-lft-in82.7%
fma-def82.7%
*-rgt-identity82.7%
Simplified82.7%
Taylor expanded in z around 0 65.5%
unpow265.5%
times-frac76.6%
Simplified76.6%
Final simplification76.6%
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 79.5%
*-commutative79.5%
associate-*r/82.6%
sqr-neg82.6%
associate-*l*82.7%
associate-*l*82.6%
sqr-neg82.6%
associate-*l*82.7%
distribute-lft-in82.7%
fma-def82.7%
*-rgt-identity82.7%
Simplified82.7%
Taylor expanded in z around 0 45.4%
+-commutative45.4%
unpow245.4%
times-frac57.8%
mul-1-neg57.8%
associate-*r/60.0%
distribute-lft-neg-in60.0%
distribute-rgt-out70.5%
Simplified70.5%
Taylor expanded in z around inf 23.3%
mul-1-neg23.3%
associate-*r/26.3%
distribute-lft-neg-in26.3%
Simplified26.3%
add-sqr-sqrt13.2%
sqrt-unprod30.6%
sqr-neg30.6%
sqrt-unprod17.9%
add-sqr-sqrt32.4%
associate-*r/28.7%
associate-/l*32.1%
Applied egg-rr32.1%
associate-/r/32.8%
Applied egg-rr32.8%
Final simplification32.8%
(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 2023293
(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))))