
(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 18 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 (if (or (<= z -8e-117) (not (<= z 2e-11))) (* (/ (/ x z) z) (/ y (+ z 1.0))) (/ (* x (- (/ y z) y)) z)))
assert(x < y);
double code(double x, double y, double z) {
double tmp;
if ((z <= -8e-117) || !(z <= 2e-11)) {
tmp = ((x / z) / z) * (y / (z + 1.0));
} else {
tmp = (x * ((y / 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 <= (-8d-117)) .or. (.not. (z <= 2d-11))) then
tmp = ((x / z) / z) * (y / (z + 1.0d0))
else
tmp = (x * ((y / 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 <= -8e-117) || !(z <= 2e-11)) {
tmp = ((x / z) / z) * (y / (z + 1.0));
} else {
tmp = (x * ((y / z) - y)) / z;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z): tmp = 0 if (z <= -8e-117) or not (z <= 2e-11): tmp = ((x / z) / z) * (y / (z + 1.0)) else: tmp = (x * ((y / z) - y)) / z return tmp
x, y = sort([x, y]) function code(x, y, z) tmp = 0.0 if ((z <= -8e-117) || !(z <= 2e-11)) tmp = Float64(Float64(Float64(x / z) / z) * Float64(y / Float64(z + 1.0))); else tmp = Float64(Float64(x * Float64(Float64(y / 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 <= -8e-117) || ~((z <= 2e-11)))
tmp = ((x / z) / z) * (y / (z + 1.0));
else
tmp = (x * ((y / 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, -8e-117], N[Not[LessEqual[z, 2e-11]], $MachinePrecision]], N[(N[(N[(x / z), $MachinePrecision] / z), $MachinePrecision] * N[(y / N[(z + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * N[(N[(y / z), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -8 \cdot 10^{-117} \lor \neg \left(z \leq 2 \cdot 10^{-11}\right):\\
\;\;\;\;\frac{\frac{x}{z}}{z} \cdot \frac{y}{z + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot \left(\frac{y}{z} - y\right)}{z}\\
\end{array}
\end{array}
if z < -8.00000000000000024e-117 or 1.99999999999999988e-11 < z Initial program 86.7%
associate-*l*86.7%
times-frac94.7%
distribute-lft-in94.7%
fma-def94.7%
*-rgt-identity94.7%
Simplified94.7%
frac-times86.7%
fma-udef86.7%
distribute-lft-in68.4%
*-un-lft-identity68.4%
distribute-rgt-in86.7%
associate-/r*88.5%
times-frac97.0%
Applied egg-rr97.0%
frac-2neg97.0%
associate-*r/97.5%
distribute-frac-neg97.5%
distribute-rgt-neg-out97.5%
associate-/r*95.6%
times-frac95.8%
frac-2neg95.8%
Applied egg-rr95.8%
if -8.00000000000000024e-117 < z < 1.99999999999999988e-11Initial program 81.3%
associate-*l*81.3%
times-frac94.7%
distribute-lft-in94.7%
fma-def94.7%
*-rgt-identity94.7%
Simplified94.7%
Taylor expanded in z around 0 94.7%
neg-mul-194.7%
+-commutative94.7%
unsub-neg94.7%
Simplified94.7%
Taylor expanded in x around 0 95.1%
Final simplification95.5%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z) :precision binary64 (if (or (<= z -1.65e-119) (not (<= z 9.5e-12))) (* (/ y (+ z 1.0)) (/ x (* z z))) (/ (* x (- (/ y z) y)) z)))
assert(x < y);
double code(double x, double y, double z) {
double tmp;
if ((z <= -1.65e-119) || !(z <= 9.5e-12)) {
tmp = (y / (z + 1.0)) * (x / (z * z));
} else {
tmp = (x * ((y / 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.65d-119)) .or. (.not. (z <= 9.5d-12))) then
tmp = (y / (z + 1.0d0)) * (x / (z * z))
else
tmp = (x * ((y / 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.65e-119) || !(z <= 9.5e-12)) {
tmp = (y / (z + 1.0)) * (x / (z * z));
} else {
tmp = (x * ((y / z) - y)) / z;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z): tmp = 0 if (z <= -1.65e-119) or not (z <= 9.5e-12): tmp = (y / (z + 1.0)) * (x / (z * z)) else: tmp = (x * ((y / z) - y)) / z return tmp
x, y = sort([x, y]) function code(x, y, z) tmp = 0.0 if ((z <= -1.65e-119) || !(z <= 9.5e-12)) tmp = Float64(Float64(y / Float64(z + 1.0)) * Float64(x / Float64(z * z))); else tmp = Float64(Float64(x * Float64(Float64(y / 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.65e-119) || ~((z <= 9.5e-12)))
tmp = (y / (z + 1.0)) * (x / (z * z));
else
tmp = (x * ((y / 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.65e-119], N[Not[LessEqual[z, 9.5e-12]], $MachinePrecision]], N[(N[(y / N[(z + 1.0), $MachinePrecision]), $MachinePrecision] * N[(x / N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * N[(N[(y / z), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.65 \cdot 10^{-119} \lor \neg \left(z \leq 9.5 \cdot 10^{-12}\right):\\
\;\;\;\;\frac{y}{z + 1} \cdot \frac{x}{z \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot \left(\frac{y}{z} - y\right)}{z}\\
\end{array}
\end{array}
if z < -1.65000000000000004e-119 or 9.4999999999999995e-12 < z Initial program 86.8%
times-frac94.1%
Simplified94.1%
if -1.65000000000000004e-119 < z < 9.4999999999999995e-12Initial program 81.2%
associate-*l*81.2%
times-frac94.6%
distribute-lft-in94.6%
fma-def94.6%
*-rgt-identity94.6%
Simplified94.6%
Taylor expanded in z around 0 94.6%
neg-mul-194.6%
+-commutative94.6%
unsub-neg94.6%
Simplified94.6%
Taylor expanded in x around 0 95.1%
Final simplification94.5%
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 0.75))) (* (/ x z) (/ y (* z z))) (* (/ x z) (- (/ y z) y))))
assert(x < y);
double code(double x, double y, double z) {
double tmp;
if ((z <= -1.0) || !(z <= 0.75)) {
tmp = (x / z) * (y / (z * z));
} else {
tmp = (x / z) * ((y / 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 ((z <= (-1.0d0)) .or. (.not. (z <= 0.75d0))) then
tmp = (x / z) * (y / (z * z))
else
tmp = (x / z) * ((y / z) - y)
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 <= 0.75)) {
tmp = (x / z) * (y / (z * z));
} else {
tmp = (x / z) * ((y / z) - y);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z): tmp = 0 if (z <= -1.0) or not (z <= 0.75): tmp = (x / z) * (y / (z * z)) else: tmp = (x / z) * ((y / z) - y) return tmp
x, y = sort([x, y]) function code(x, y, z) tmp = 0.0 if ((z <= -1.0) || !(z <= 0.75)) tmp = Float64(Float64(x / z) * Float64(y / Float64(z * z))); else tmp = Float64(Float64(x / z) * Float64(Float64(y / z) - y)); 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 <= 0.75)))
tmp = (x / z) * (y / (z * z));
else
tmp = (x / z) * ((y / 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[Or[LessEqual[z, -1.0], N[Not[LessEqual[z, 0.75]], $MachinePrecision]], N[(N[(x / z), $MachinePrecision] * N[(y / N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / z), $MachinePrecision] * N[(N[(y / z), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1 \lor \neg \left(z \leq 0.75\right):\\
\;\;\;\;\frac{x}{z} \cdot \frac{y}{z \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{z} \cdot \left(\frac{y}{z} - y\right)\\
\end{array}
\end{array}
if z < -1 or 0.75 < z Initial program 87.2%
associate-*l*87.2%
times-frac94.0%
distribute-lft-in94.0%
fma-def94.0%
*-rgt-identity94.0%
Simplified94.0%
Taylor expanded in z around inf 92.0%
unpow292.0%
Simplified92.0%
if -1 < z < 0.75Initial program 81.6%
associate-*l*81.6%
times-frac95.3%
distribute-lft-in95.3%
fma-def95.3%
*-rgt-identity95.3%
Simplified95.3%
Taylor expanded in z around 0 94.5%
neg-mul-194.5%
+-commutative94.5%
unsub-neg94.5%
Simplified94.5%
Final simplification93.2%
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.75) (* (/ x z) (- (/ y 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.75) {
tmp = (x / z) * ((y / 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.75d0) then
tmp = (x / z) * ((y / 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.75) {
tmp = (x / z) * ((y / 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.75: tmp = (x / z) * ((y / 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(x / Float64(z * z))); elseif (z <= 0.75) tmp = Float64(Float64(x / z) * Float64(Float64(y / z) - y)); else tmp = Float64(Float64(x / z) * 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 (z <= -1.0)
tmp = (y / z) * (x / (z * z));
elseif (z <= 0.75)
tmp = (x / z) * ((y / 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[(x / N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 0.75], N[(N[(x / z), $MachinePrecision] * N[(N[(y / z), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision], N[(N[(x / z), $MachinePrecision] * N[(y / N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1:\\
\;\;\;\;\frac{y}{z} \cdot \frac{x}{z \cdot z}\\
\mathbf{elif}\;z \leq 0.75:\\
\;\;\;\;\frac{x}{z} \cdot \left(\frac{y}{z} - y\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{z} \cdot \frac{y}{z \cdot z}\\
\end{array}
\end{array}
if z < -1Initial program 85.6%
associate-*l*85.6%
times-frac97.3%
distribute-lft-in97.3%
fma-def97.3%
*-rgt-identity97.3%
Simplified97.3%
*-commutative97.3%
frac-times85.6%
fma-udef85.6%
distribute-lft1-in85.6%
associate-*r*85.6%
frac-times95.7%
clear-num95.7%
frac-times97.4%
*-un-lft-identity97.4%
Applied egg-rr97.4%
Taylor expanded in z around inf 96.4%
*-un-lft-identity96.4%
times-frac94.6%
clear-num94.7%
Applied egg-rr94.7%
if -1 < z < 0.75Initial program 81.6%
associate-*l*81.6%
times-frac95.3%
distribute-lft-in95.3%
fma-def95.3%
*-rgt-identity95.3%
Simplified95.3%
Taylor expanded in z around 0 94.5%
neg-mul-194.5%
+-commutative94.5%
unsub-neg94.5%
Simplified94.5%
if 0.75 < z Initial program 88.5%
associate-*l*88.5%
times-frac91.0%
distribute-lft-in91.0%
fma-def91.0%
*-rgt-identity91.0%
Simplified91.0%
Taylor expanded in z around inf 88.1%
unpow288.1%
Simplified88.1%
Final simplification92.8%
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.78) (/ (* x (- (/ y z) y)) z) (* (/ 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.78) {
tmp = (x * ((y / z) - y)) / z;
} 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.78d0) then
tmp = (x * ((y / z) - y)) / z
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.78) {
tmp = (x * ((y / z) - y)) / z;
} 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.78: tmp = (x * ((y / z) - y)) / z 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(x / Float64(z * z))); elseif (z <= 0.78) tmp = Float64(Float64(x * Float64(Float64(y / z) - y)) / z); else tmp = Float64(Float64(x / z) * 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 (z <= -1.0)
tmp = (y / z) * (x / (z * z));
elseif (z <= 0.78)
tmp = (x * ((y / z) - y)) / z;
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[(x / N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 0.78], N[(N[(x * N[(N[(y / z), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], N[(N[(x / z), $MachinePrecision] * N[(y / N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1:\\
\;\;\;\;\frac{y}{z} \cdot \frac{x}{z \cdot z}\\
\mathbf{elif}\;z \leq 0.78:\\
\;\;\;\;\frac{x \cdot \left(\frac{y}{z} - y\right)}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{z} \cdot \frac{y}{z \cdot z}\\
\end{array}
\end{array}
if z < -1Initial program 85.6%
associate-*l*85.6%
times-frac97.3%
distribute-lft-in97.3%
fma-def97.3%
*-rgt-identity97.3%
Simplified97.3%
*-commutative97.3%
frac-times85.6%
fma-udef85.6%
distribute-lft1-in85.6%
associate-*r*85.6%
frac-times95.7%
clear-num95.7%
frac-times97.4%
*-un-lft-identity97.4%
Applied egg-rr97.4%
Taylor expanded in z around inf 96.4%
*-un-lft-identity96.4%
times-frac94.6%
clear-num94.7%
Applied egg-rr94.7%
if -1 < z < 0.78000000000000003Initial program 81.6%
associate-*l*81.6%
times-frac95.3%
distribute-lft-in95.3%
fma-def95.3%
*-rgt-identity95.3%
Simplified95.3%
Taylor expanded in z around 0 94.5%
neg-mul-194.5%
+-commutative94.5%
unsub-neg94.5%
Simplified94.5%
Taylor expanded in x around 0 94.1%
if 0.78000000000000003 < z Initial program 88.5%
associate-*l*88.5%
times-frac91.0%
distribute-lft-in91.0%
fma-def91.0%
*-rgt-identity91.0%
Simplified91.0%
Taylor expanded in z around inf 88.1%
unpow288.1%
Simplified88.1%
Final simplification92.6%
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(Float64(x / 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[(N[(x / z), $MachinePrecision] * y), $MachinePrecision] / z), $MachinePrecision] / N[(z + 1.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\frac{\frac{\frac{x}{z} \cdot y}{z}}{z + 1}
\end{array}
Initial program 84.4%
associate-*l*84.4%
times-frac94.7%
distribute-lft-in94.7%
fma-def94.7%
*-rgt-identity94.7%
Simplified94.7%
frac-times84.4%
fma-udef84.4%
distribute-lft-in73.9%
*-un-lft-identity73.9%
distribute-rgt-in84.4%
associate-/r*85.5%
times-frac96.0%
Applied egg-rr96.0%
associate-*r/97.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 (/ (* x (/ y z)) (+ z (* z z))))
assert(x < y);
double code(double x, double y, double z) {
return (x * (y / z)) / (z + (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 = (x * (y / z)) / (z + (z * z))
end function
assert x < y;
public static double code(double x, double y, double z) {
return (x * (y / z)) / (z + (z * z));
}
[x, y] = sort([x, y]) def code(x, y, z): return (x * (y / z)) / (z + (z * z))
x, y = sort([x, y]) function code(x, y, z) return Float64(Float64(x * Float64(y / z)) / Float64(z + Float64(z * z))) end
x, y = num2cell(sort([x, y])){:}
function tmp = code(x, y, z)
tmp = (x * (y / z)) / (z + (z * z));
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_] := N[(N[(x * N[(y / z), $MachinePrecision]), $MachinePrecision] / N[(z + N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\frac{x \cdot \frac{y}{z}}{z + z \cdot z}
\end{array}
Initial program 84.4%
associate-*l*84.4%
times-frac94.7%
distribute-lft-in94.7%
fma-def94.7%
*-rgt-identity94.7%
Simplified94.7%
frac-times84.4%
fma-udef84.4%
distribute-lft-in73.9%
*-un-lft-identity73.9%
distribute-rgt-in84.4%
associate-/r*85.5%
times-frac96.0%
Applied egg-rr96.0%
frac-2neg96.0%
associate-*r/97.2%
distribute-frac-neg97.2%
distribute-rgt-neg-out97.2%
associate-/r*96.1%
times-frac93.5%
frac-2neg93.5%
Applied egg-rr93.5%
frac-times96.1%
associate-*l/88.3%
associate-*r/94.8%
+-commutative94.8%
distribute-lft-in94.8%
*-rgt-identity94.8%
Applied egg-rr94.8%
Final simplification94.8%
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 / z) * Float64(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 / z), $MachinePrecision] * N[(y / z), $MachinePrecision]), $MachinePrecision] / N[(z + 1.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\frac{\frac{x}{z} \cdot \frac{y}{z}}{z + 1}
\end{array}
Initial program 84.4%
associate-*l*84.4%
times-frac94.7%
distribute-lft-in94.7%
fma-def94.7%
*-rgt-identity94.7%
Simplified94.7%
frac-times84.4%
fma-udef84.4%
distribute-lft-in73.9%
*-un-lft-identity73.9%
distribute-rgt-in84.4%
associate-/r*85.5%
times-frac96.0%
Applied egg-rr96.0%
Final simplification96.0%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z) :precision binary64 (if (<= x -3.1e+76) (* x (/ y (* z z))) (* (/ x z) (/ y z))))
assert(x < y);
double code(double x, double y, double z) {
double tmp;
if (x <= -3.1e+76) {
tmp = x * (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 (x <= (-3.1d+76)) then
tmp = x * (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 (x <= -3.1e+76) {
tmp = x * (y / (z * z));
} else {
tmp = (x / z) * (y / z);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z): tmp = 0 if x <= -3.1e+76: tmp = x * (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 (x <= -3.1e+76) tmp = Float64(x * Float64(y / 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 (x <= -3.1e+76)
tmp = x * (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[LessEqual[x, -3.1e+76], N[(x * N[(y / 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}\;x \leq -3.1 \cdot 10^{+76}:\\
\;\;\;\;x \cdot \frac{y}{z \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{z} \cdot \frac{y}{z}\\
\end{array}
\end{array}
if x < -3.10000000000000011e76Initial program 83.6%
associate-*l*83.6%
times-frac93.1%
distribute-lft-in93.1%
fma-def93.1%
*-rgt-identity93.1%
Simplified93.1%
Taylor expanded in z around 0 71.3%
*-commutative71.3%
unpow271.3%
associate-*r/78.8%
Simplified78.8%
if -3.10000000000000011e76 < x Initial program 84.6%
associate-*l*84.6%
times-frac95.0%
distribute-lft-in95.0%
fma-def95.0%
*-rgt-identity95.0%
Simplified95.0%
Taylor expanded in z around 0 77.5%
Final simplification77.7%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z) :precision binary64 (if (<= y 1.6e-16) (* (/ x z) (/ y z)) (* y (/ x (* z z)))))
assert(x < y);
double code(double x, double y, double z) {
double tmp;
if (y <= 1.6e-16) {
tmp = (x / z) * (y / 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.6d-16) then
tmp = (x / z) * (y / 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.6e-16) {
tmp = (x / z) * (y / z);
} else {
tmp = y * (x / (z * z));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z): tmp = 0 if y <= 1.6e-16: tmp = (x / z) * (y / 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.6e-16) tmp = Float64(Float64(x / z) * Float64(y / 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.6e-16)
tmp = (x / z) * (y / 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.6e-16], N[(N[(x / z), $MachinePrecision] * N[(y / 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.6 \cdot 10^{-16}:\\
\;\;\;\;\frac{x}{z} \cdot \frac{y}{z}\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{x}{z \cdot z}\\
\end{array}
\end{array}
if y < 1.60000000000000011e-16Initial program 84.0%
associate-*l*84.0%
times-frac95.1%
distribute-lft-in95.2%
fma-def95.2%
*-rgt-identity95.2%
Simplified95.2%
Taylor expanded in z around 0 77.5%
if 1.60000000000000011e-16 < y Initial program 85.9%
times-frac93.3%
Simplified93.3%
Taylor expanded in z around 0 80.6%
Final simplification78.3%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z) :precision binary64 (if (<= y 2e+76) (/ x (* z (/ z y))) (* y (/ x (* z z)))))
assert(x < y);
double code(double x, double y, double z) {
double tmp;
if (y <= 2e+76) {
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 <= 2d+76) 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 <= 2e+76) {
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 <= 2e+76: 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 <= 2e+76) tmp = Float64(x / Float64(z * Float64(z / y))); 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 <= 2e+76)
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, 2e+76], N[(x / N[(z * N[(z / y), $MachinePrecision]), $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 2 \cdot 10^{+76}:\\
\;\;\;\;\frac{x}{z \cdot \frac{z}{y}}\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{x}{z \cdot z}\\
\end{array}
\end{array}
if y < 2.0000000000000001e76Initial program 85.1%
/-rgt-identity85.1%
associate-/l*85.0%
associate-/l/85.6%
associate-*l*86.5%
associate-*r/86.5%
*-rgt-identity86.5%
associate-*l*91.2%
associate-*r/91.2%
distribute-lft-in91.2%
fma-def91.2%
*-rgt-identity91.2%
Simplified91.2%
Taylor expanded in z around 0 75.1%
if 2.0000000000000001e76 < y Initial program 81.1%
times-frac90.7%
Simplified90.7%
Taylor expanded in z around 0 80.1%
Final simplification75.9%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z) :precision binary64 (if (<= x -2.3e-79) (/ x (* z (/ z y))) (/ y (* z (/ z x)))))
assert(x < y);
double code(double x, double y, double z) {
double tmp;
if (x <= -2.3e-79) {
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 (x <= (-2.3d-79)) 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 (x <= -2.3e-79) {
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 x <= -2.3e-79: 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 (x <= -2.3e-79) 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 (x <= -2.3e-79)
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[x, -2.3e-79], 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}\;x \leq -2.3 \cdot 10^{-79}:\\
\;\;\;\;\frac{x}{z \cdot \frac{z}{y}}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{z \cdot \frac{z}{x}}\\
\end{array}
\end{array}
if x < -2.30000000000000012e-79Initial program 82.1%
/-rgt-identity82.1%
associate-/l*82.1%
associate-/l/86.7%
associate-*l*88.0%
associate-*r/88.0%
*-rgt-identity88.0%
associate-*l*94.2%
associate-*r/92.9%
distribute-lft-in92.9%
fma-def92.9%
*-rgt-identity92.9%
Simplified92.9%
Taylor expanded in z around 0 76.9%
if -2.30000000000000012e-79 < x Initial program 85.4%
associate-*l*85.4%
times-frac94.9%
distribute-lft-in94.9%
fma-def94.9%
*-rgt-identity94.9%
Simplified94.9%
Taylor expanded in z around 0 69.9%
*-commutative69.9%
unpow269.9%
associate-*r/68.9%
Simplified68.9%
frac-2neg68.9%
div-inv68.6%
add-sqr-sqrt37.1%
sqrt-unprod44.3%
sqr-neg44.3%
sqrt-unprod16.2%
add-sqr-sqrt35.1%
distribute-rgt-neg-in35.1%
Applied egg-rr35.1%
associate-*r/35.1%
*-rgt-identity35.1%
associate-/r*32.1%
Simplified32.1%
Taylor expanded in x around 0 33.4%
mul-1-neg33.4%
unpow233.4%
times-frac32.5%
distribute-rgt-neg-in32.5%
distribute-frac-neg32.5%
Simplified32.5%
frac-times33.4%
*-commutative33.4%
add-sqr-sqrt14.1%
sqrt-unprod54.2%
sqr-neg54.2%
sqrt-unprod48.1%
add-sqr-sqrt69.9%
frac-times76.5%
clear-num76.9%
frac-times78.2%
*-un-lft-identity78.2%
Applied egg-rr78.2%
Final simplification77.8%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z) :precision binary64 (if (<= z -1e-310) (* (/ x z) (- y)) (/ x (/ z y))))
assert(x < y);
double code(double x, double y, double z) {
double tmp;
if (z <= -1e-310) {
tmp = (x / z) * -y;
} else {
tmp = x / (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 (z <= (-1d-310)) then
tmp = (x / z) * -y
else
tmp = x / (z / y)
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 = (x / z) * -y;
} else {
tmp = x / (z / y);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z): tmp = 0 if z <= -1e-310: tmp = (x / z) * -y else: tmp = x / (z / y) return tmp
x, y = sort([x, y]) function code(x, y, z) tmp = 0.0 if (z <= -1e-310) tmp = Float64(Float64(x / z) * Float64(-y)); else tmp = Float64(x / Float64(z / y)); 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 = (x / z) * -y;
else
tmp = x / (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[z, -1e-310], N[(N[(x / z), $MachinePrecision] * (-y)), $MachinePrecision], N[(x / N[(z / y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1 \cdot 10^{-310}:\\
\;\;\;\;\frac{x}{z} \cdot \left(-y\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\frac{z}{y}}\\
\end{array}
\end{array}
if z < -9.999999999999969e-311Initial program 85.3%
associate-*l*85.3%
times-frac97.8%
distribute-lft-in97.8%
fma-def97.8%
*-rgt-identity97.8%
Simplified97.8%
Taylor expanded in z around 0 67.6%
neg-mul-167.6%
+-commutative67.6%
unsub-neg67.6%
Simplified67.6%
Taylor expanded in z around inf 44.4%
neg-mul-144.4%
Simplified44.4%
if -9.999999999999969e-311 < z Initial program 83.6%
associate-*l*83.6%
times-frac91.8%
distribute-lft-in91.8%
fma-def91.8%
*-rgt-identity91.8%
Simplified91.8%
Taylor expanded in z around 0 63.7%
neg-mul-163.7%
+-commutative63.7%
unsub-neg63.7%
Simplified63.7%
Taylor expanded in z around inf 19.7%
neg-mul-119.7%
Simplified19.7%
associate-*l/18.3%
div-inv18.3%
add-sqr-sqrt10.6%
sqrt-unprod24.2%
sqr-neg24.2%
sqrt-unprod13.1%
add-sqr-sqrt33.2%
associate-*r*37.5%
div-inv37.5%
clear-num38.9%
un-div-inv38.9%
Applied egg-rr38.9%
Final simplification41.5%
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 z) (- x)) (/ x (/ z y))))
assert(x < y);
double code(double x, double y, double z) {
double tmp;
if (z <= -1e-310) {
tmp = (y / z) * -x;
} else {
tmp = x / (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 (z <= (-1d-310)) then
tmp = (y / z) * -x
else
tmp = x / (z / y)
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 / z) * -x;
} else {
tmp = x / (z / y);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z): tmp = 0 if z <= -1e-310: tmp = (y / z) * -x else: tmp = x / (z / y) return tmp
x, y = sort([x, y]) function code(x, y, z) tmp = 0.0 if (z <= -1e-310) tmp = Float64(Float64(y / z) * Float64(-x)); else tmp = Float64(x / Float64(z / y)); 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 / z) * -x;
else
tmp = x / (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[z, -1e-310], N[(N[(y / z), $MachinePrecision] * (-x)), $MachinePrecision], N[(x / N[(z / y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1 \cdot 10^{-310}:\\
\;\;\;\;\frac{y}{z} \cdot \left(-x\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\frac{z}{y}}\\
\end{array}
\end{array}
if z < -9.999999999999969e-311Initial program 85.3%
associate-*l*85.3%
times-frac97.8%
distribute-lft-in97.8%
fma-def97.8%
*-rgt-identity97.8%
Simplified97.8%
Taylor expanded in z around 0 67.6%
neg-mul-167.6%
+-commutative67.6%
unsub-neg67.6%
Simplified67.6%
Taylor expanded in z around inf 39.7%
mul-1-neg39.7%
associate-*l/45.2%
distribute-rgt-neg-in45.2%
Simplified45.2%
if -9.999999999999969e-311 < z Initial program 83.6%
associate-*l*83.6%
times-frac91.8%
distribute-lft-in91.8%
fma-def91.8%
*-rgt-identity91.8%
Simplified91.8%
Taylor expanded in z around 0 63.7%
neg-mul-163.7%
+-commutative63.7%
unsub-neg63.7%
Simplified63.7%
Taylor expanded in z around inf 19.7%
neg-mul-119.7%
Simplified19.7%
associate-*l/18.3%
div-inv18.3%
add-sqr-sqrt10.6%
sqrt-unprod24.2%
sqr-neg24.2%
sqrt-unprod13.1%
add-sqr-sqrt33.2%
associate-*r*37.5%
div-inv37.5%
clear-num38.9%
un-div-inv38.9%
Applied egg-rr38.9%
Final simplification41.9%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z) :precision binary64 (if (<= x -1e+51) (/ x (/ z y)) (/ y (/ z x))))
assert(x < y);
double code(double x, double y, double z) {
double tmp;
if (x <= -1e+51) {
tmp = x / (z / y);
} 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 (x <= (-1d+51)) then
tmp = x / (z / y)
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 (x <= -1e+51) {
tmp = x / (z / y);
} else {
tmp = y / (z / x);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z): tmp = 0 if x <= -1e+51: tmp = x / (z / y) else: tmp = y / (z / x) return tmp
x, y = sort([x, y]) function code(x, y, z) tmp = 0.0 if (x <= -1e+51) tmp = Float64(x / Float64(z / y)); else tmp = Float64(y / Float64(z / x)); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z)
tmp = 0.0;
if (x <= -1e+51)
tmp = x / (z / y);
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[x, -1e+51], N[(x / N[(z / y), $MachinePrecision]), $MachinePrecision], N[(y / N[(z / x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1 \cdot 10^{+51}:\\
\;\;\;\;\frac{x}{\frac{z}{y}}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{\frac{z}{x}}\\
\end{array}
\end{array}
if x < -1e51Initial program 84.8%
associate-*l*84.8%
times-frac93.6%
distribute-lft-in93.6%
fma-def93.6%
*-rgt-identity93.6%
Simplified93.6%
Taylor expanded in z around 0 48.0%
neg-mul-148.0%
+-commutative48.0%
unsub-neg48.0%
Simplified48.0%
Taylor expanded in z around inf 32.5%
neg-mul-132.5%
Simplified32.5%
associate-*l/30.6%
div-inv30.6%
add-sqr-sqrt18.2%
sqrt-unprod27.7%
sqr-neg27.7%
sqrt-unprod5.2%
add-sqr-sqrt12.6%
associate-*r*21.8%
div-inv21.8%
clear-num25.4%
un-div-inv25.4%
Applied egg-rr25.4%
if -1e51 < x Initial program 84.3%
associate-*l*84.3%
times-frac94.9%
distribute-lft-in94.9%
fma-def94.9%
*-rgt-identity94.9%
Simplified94.9%
Taylor expanded in z around 0 70.0%
neg-mul-170.0%
+-commutative70.0%
unsub-neg70.0%
Simplified70.0%
Taylor expanded in z around inf 31.2%
neg-mul-131.2%
Simplified31.2%
*-commutative31.2%
clear-num32.2%
un-div-inv32.2%
add-sqr-sqrt17.9%
sqrt-unprod28.9%
sqr-neg28.9%
sqrt-unprod14.2%
add-sqr-sqrt33.0%
Applied egg-rr33.0%
Final simplification31.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))))
assert(x < y);
double code(double x, double y, double z) {
return x * (y / (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 = x * (y / (z * z))
end function
assert x < y;
public static double code(double x, double y, double z) {
return x * (y / (z * z));
}
[x, y] = sort([x, y]) def code(x, y, z): return x * (y / (z * z))
x, y = sort([x, y]) function code(x, y, z) return Float64(x * Float64(y / Float64(z * z))) end
x, y = num2cell(sort([x, y])){:}
function tmp = code(x, y, z)
tmp = x * (y / (z * z));
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_] := N[(x * N[(y / N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
x \cdot \frac{y}{z \cdot z}
\end{array}
Initial program 84.4%
associate-*l*84.4%
times-frac94.7%
distribute-lft-in94.7%
fma-def94.7%
*-rgt-identity94.7%
Simplified94.7%
Taylor expanded in z around 0 70.0%
*-commutative70.0%
unpow270.0%
associate-*r/70.6%
Simplified70.6%
Final simplification70.6%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z) :precision binary64 (* x (/ y z)))
assert(x < y);
double code(double x, double y, double z) {
return x * (y / 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 * (y / z)
end function
assert x < y;
public static double code(double x, double y, double z) {
return x * (y / z);
}
[x, y] = sort([x, y]) def code(x, y, z): return x * (y / z)
x, y = sort([x, y]) function code(x, y, z) return Float64(x * Float64(y / z)) end
x, y = num2cell(sort([x, y])){:}
function tmp = code(x, y, z)
tmp = x * (y / z);
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_] := N[(x * N[(y / z), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
x \cdot \frac{y}{z}
\end{array}
Initial program 84.4%
associate-*l*84.4%
times-frac94.7%
distribute-lft-in94.7%
fma-def94.7%
*-rgt-identity94.7%
Simplified94.7%
Taylor expanded in z around 0 65.6%
neg-mul-165.6%
+-commutative65.6%
unsub-neg65.6%
Simplified65.6%
Taylor expanded in z around inf 31.5%
neg-mul-131.5%
Simplified31.5%
expm1-log1p-u25.0%
expm1-udef36.5%
add-sqr-sqrt20.7%
sqrt-unprod32.9%
sqr-neg32.9%
sqrt-unprod15.8%
add-sqr-sqrt34.7%
Applied egg-rr34.7%
expm1-def23.5%
expm1-log1p28.5%
associate-*l/25.9%
associate-*r/30.3%
Simplified30.3%
Final simplification30.3%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z) :precision binary64 (/ x (/ z y)))
assert(x < y);
double code(double x, double y, double z) {
return x / (z / 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 / y)
end function
assert x < y;
public static double code(double x, double y, double z) {
return x / (z / y);
}
[x, y] = sort([x, y]) def code(x, y, z): return x / (z / y)
x, y = sort([x, y]) function code(x, y, z) return Float64(x / Float64(z / y)) end
x, y = num2cell(sort([x, y])){:}
function tmp = code(x, y, z)
tmp = x / (z / y);
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_] := N[(x / N[(z / y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\frac{x}{\frac{z}{y}}
\end{array}
Initial program 84.4%
associate-*l*84.4%
times-frac94.7%
distribute-lft-in94.7%
fma-def94.7%
*-rgt-identity94.7%
Simplified94.7%
Taylor expanded in z around 0 65.6%
neg-mul-165.6%
+-commutative65.6%
unsub-neg65.6%
Simplified65.6%
Taylor expanded in z around inf 31.5%
neg-mul-131.5%
Simplified31.5%
associate-*l/28.5%
div-inv28.5%
add-sqr-sqrt15.7%
sqrt-unprod28.0%
sqr-neg28.0%
sqrt-unprod11.3%
add-sqr-sqrt25.9%
associate-*r*30.3%
div-inv30.3%
clear-num31.0%
un-div-inv31.0%
Applied egg-rr31.0%
Final simplification31.0%
(FPCore (x y z) :precision binary64 (if (< z 249.6182814532307) (/ (* y (/ x z)) (+ z (* z z))) (/ (* (/ (/ y z) (+ 1.0 z)) x) z)))
double code(double x, double y, double z) {
double tmp;
if (z < 249.6182814532307) {
tmp = (y * (x / z)) / (z + (z * z));
} else {
tmp = (((y / z) / (1.0 + z)) * x) / z;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (z < 249.6182814532307d0) then
tmp = (y * (x / z)) / (z + (z * z))
else
tmp = (((y / z) / (1.0d0 + z)) * x) / z
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z < 249.6182814532307) {
tmp = (y * (x / z)) / (z + (z * z));
} else {
tmp = (((y / z) / (1.0 + z)) * x) / z;
}
return tmp;
}
def code(x, y, z): tmp = 0 if z < 249.6182814532307: tmp = (y * (x / z)) / (z + (z * z)) else: tmp = (((y / z) / (1.0 + z)) * x) / z return tmp
function code(x, y, z) tmp = 0.0 if (z < 249.6182814532307) tmp = Float64(Float64(y * Float64(x / z)) / Float64(z + Float64(z * z))); else tmp = Float64(Float64(Float64(Float64(y / z) / Float64(1.0 + z)) * x) / z); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z < 249.6182814532307) tmp = (y * (x / z)) / (z + (z * z)); else tmp = (((y / z) / (1.0 + z)) * x) / z; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Less[z, 249.6182814532307], N[(N[(y * N[(x / z), $MachinePrecision]), $MachinePrecision] / N[(z + N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(y / z), $MachinePrecision] / N[(1.0 + z), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision] / z), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z < 249.6182814532307:\\
\;\;\;\;\frac{y \cdot \frac{x}{z}}{z + z \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\frac{y}{z}}{1 + z} \cdot x}{z}\\
\end{array}
\end{array}
herbie shell --seed 2023230
(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))))