
(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 16 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 (<= z -5.2e-77) (* (/ y (+ z 1.0)) (/ x (* z z))) (if (<= z 0.76) (/ (* x (- (/ y z) y)) z) (/ (/ y (* z (/ z x))) z))))
assert(x < y);
double code(double x, double y, double z) {
double tmp;
if (z <= -5.2e-77) {
tmp = (y / (z + 1.0)) * (x / (z * z));
} else if (z <= 0.76) {
tmp = (x * ((y / z) - y)) / z;
} else {
tmp = (y / (z * (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 (z <= (-5.2d-77)) then
tmp = (y / (z + 1.0d0)) * (x / (z * z))
else if (z <= 0.76d0) then
tmp = (x * ((y / z) - y)) / z
else
tmp = (y / (z * (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 (z <= -5.2e-77) {
tmp = (y / (z + 1.0)) * (x / (z * z));
} else if (z <= 0.76) {
tmp = (x * ((y / z) - y)) / z;
} else {
tmp = (y / (z * (z / x))) / z;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z): tmp = 0 if z <= -5.2e-77: tmp = (y / (z + 1.0)) * (x / (z * z)) elif z <= 0.76: tmp = (x * ((y / z) - y)) / z else: tmp = (y / (z * (z / x))) / z return tmp
x, y = sort([x, y]) function code(x, y, z) tmp = 0.0 if (z <= -5.2e-77) tmp = Float64(Float64(y / Float64(z + 1.0)) * Float64(x / Float64(z * z))); elseif (z <= 0.76) tmp = Float64(Float64(x * Float64(Float64(y / z) - y)) / z); else tmp = Float64(Float64(y / Float64(z * Float64(z / x))) / z); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z)
tmp = 0.0;
if (z <= -5.2e-77)
tmp = (y / (z + 1.0)) * (x / (z * z));
elseif (z <= 0.76)
tmp = (x * ((y / z) - y)) / z;
else
tmp = (y / (z * (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[LessEqual[z, -5.2e-77], N[(N[(y / N[(z + 1.0), $MachinePrecision]), $MachinePrecision] * N[(x / N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 0.76], N[(N[(x * N[(N[(y / z), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], N[(N[(y / N[(z * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.2 \cdot 10^{-77}:\\
\;\;\;\;\frac{y}{z + 1} \cdot \frac{x}{z \cdot z}\\
\mathbf{elif}\;z \leq 0.76:\\
\;\;\;\;\frac{x \cdot \left(\frac{y}{z} - y\right)}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{y}{z \cdot \frac{z}{x}}}{z}\\
\end{array}
\end{array}
if z < -5.2000000000000002e-77Initial program 92.7%
times-frac99.7%
Simplified99.7%
if -5.2000000000000002e-77 < z < 0.76000000000000001Initial program 81.0%
associate-*l*81.0%
times-frac95.9%
distribute-lft-in96.0%
fma-def96.0%
*-rgt-identity96.0%
Simplified96.0%
Taylor expanded in z around 0 95.4%
neg-mul-195.4%
+-commutative95.4%
unsub-neg95.4%
Simplified95.4%
Taylor expanded in x around 0 96.9%
if 0.76000000000000001 < z Initial program 76.7%
associate-*l*76.7%
times-frac90.4%
distribute-lft-in90.4%
fma-def90.4%
*-rgt-identity90.4%
Simplified90.4%
*-commutative90.4%
associate-*l/91.7%
fma-udef91.7%
distribute-lft1-in91.7%
frac-times98.9%
associate-*r/98.5%
Applied egg-rr98.5%
Taylor expanded in z around inf 87.5%
unpow287.5%
associate-*r/91.8%
Simplified91.8%
associate-/r*97.7%
associate-*r/97.2%
associate-/l*97.6%
div-inv97.6%
clear-num97.7%
Applied egg-rr97.7%
Final simplification97.8%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z) :precision binary64 (if (or (<= z -1.0) (not (<= z 1.0))) (* (/ x z) (/ y (* z z))) (/ (* x (/ y z)) z)))
assert(x < y);
double code(double x, double y, double z) {
double tmp;
if ((z <= -1.0) || !(z <= 1.0)) {
tmp = (x / z) * (y / (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 <= (-1.0d0)) .or. (.not. (z <= 1.0d0))) then
tmp = (x / z) * (y / (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 <= -1.0) || !(z <= 1.0)) {
tmp = (x / z) * (y / (z * z));
} else {
tmp = (x * (y / z)) / z;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z): tmp = 0 if (z <= -1.0) or not (z <= 1.0): tmp = (x / z) * (y / (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 <= -1.0) || !(z <= 1.0)) tmp = Float64(Float64(x / z) * Float64(y / 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 <= -1.0) || ~((z <= 1.0)))
tmp = (x / z) * (y / (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, -1.0], N[Not[LessEqual[z, 1.0]], $MachinePrecision]], N[(N[(x / z), $MachinePrecision] * N[(y / 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 -1 \lor \neg \left(z \leq 1\right):\\
\;\;\;\;\frac{x}{z} \cdot \frac{y}{z \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot \frac{y}{z}}{z}\\
\end{array}
\end{array}
if z < -1 or 1 < z Initial program 83.2%
associate-*l*83.2%
times-frac93.8%
distribute-lft-in93.8%
fma-def93.8%
*-rgt-identity93.8%
Simplified93.8%
Taylor expanded in z around inf 92.9%
unpow292.9%
Simplified92.9%
if -1 < z < 1Initial program 82.5%
associate-*l*82.5%
times-frac96.3%
distribute-lft-in96.3%
fma-def96.3%
*-rgt-identity96.3%
Simplified96.3%
*-commutative96.3%
associate-*l/97.7%
fma-udef97.6%
distribute-lft1-in97.7%
frac-times90.1%
associate-*r/97.7%
Applied egg-rr97.7%
Taylor expanded in z around 0 86.8%
associate-*r/94.3%
Simplified94.3%
Taylor expanded in y around 0 86.8%
associate-*l/93.6%
*-commutative93.6%
Simplified93.6%
Final simplification93.3%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z) :precision binary64 (if (<= z -1.0) (/ x (* z (* z (/ z y)))) (if (<= z 1.0) (/ (* x (/ y z)) z) (* (/ x z) (/ y (* z z))))))
assert(x < y);
double code(double x, double y, double z) {
double tmp;
if (z <= -1.0) {
tmp = x / (z * (z * (z / y)));
} else if (z <= 1.0) {
tmp = (x * (y / z)) / 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 = x / (z * (z * (z / y)))
else if (z <= 1.0d0) then
tmp = (x * (y / z)) / 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 = x / (z * (z * (z / y)));
} else if (z <= 1.0) {
tmp = (x * (y / z)) / 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 = x / (z * (z * (z / y))) elif z <= 1.0: tmp = (x * (y / z)) / 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(x / Float64(z * Float64(z * Float64(z / y)))); elseif (z <= 1.0) tmp = Float64(Float64(x * Float64(y / z)) / 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 = x / (z * (z * (z / y)));
elseif (z <= 1.0)
tmp = (x * (y / z)) / 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[(x / N[(z * N[(z * N[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.0], N[(N[(x * N[(y / z), $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{x}{z \cdot \left(z \cdot \frac{z}{y}\right)}\\
\mathbf{elif}\;z \leq 1:\\
\;\;\;\;\frac{x \cdot \frac{y}{z}}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{z} \cdot \frac{y}{z \cdot z}\\
\end{array}
\end{array}
if z < -1Initial program 92.4%
/-rgt-identity92.4%
associate-/l*92.4%
associate-/l/96.0%
associate-*l*97.9%
associate-*r/97.8%
*-rgt-identity97.8%
associate-*l*98.0%
associate-*r/97.9%
distribute-lft-in97.9%
fma-def97.9%
*-rgt-identity97.9%
Simplified97.9%
Taylor expanded in z around inf 95.7%
unpow295.7%
Simplified95.7%
associate-/l*95.7%
associate-/r/95.7%
Applied egg-rr95.7%
if -1 < z < 1Initial program 82.5%
associate-*l*82.5%
times-frac96.3%
distribute-lft-in96.3%
fma-def96.3%
*-rgt-identity96.3%
Simplified96.3%
*-commutative96.3%
associate-*l/97.7%
fma-udef97.6%
distribute-lft1-in97.7%
frac-times90.1%
associate-*r/97.7%
Applied egg-rr97.7%
Taylor expanded in z around 0 86.8%
associate-*r/94.3%
Simplified94.3%
Taylor expanded in y around 0 86.8%
associate-*l/93.6%
*-commutative93.6%
Simplified93.6%
if 1 < z Initial program 76.7%
associate-*l*76.7%
times-frac90.4%
distribute-lft-in90.4%
fma-def90.4%
*-rgt-identity90.4%
Simplified90.4%
Taylor expanded in z around inf 90.4%
unpow290.4%
Simplified90.4%
Final simplification93.1%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z) :precision binary64 (if (<= z -1.0) (/ x (* z (* z (/ z y)))) (if (<= z 1.0) (/ (* x (/ y z)) z) (/ (* y (/ x (* z z))) z))))
assert(x < y);
double code(double x, double y, double z) {
double tmp;
if (z <= -1.0) {
tmp = x / (z * (z * (z / y)));
} else if (z <= 1.0) {
tmp = (x * (y / z)) / z;
} else {
tmp = (y * (x / (z * 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 = x / (z * (z * (z / y)))
else if (z <= 1.0d0) then
tmp = (x * (y / z)) / z
else
tmp = (y * (x / (z * 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 = x / (z * (z * (z / y)));
} else if (z <= 1.0) {
tmp = (x * (y / z)) / z;
} else {
tmp = (y * (x / (z * z))) / z;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z): tmp = 0 if z <= -1.0: tmp = x / (z * (z * (z / y))) elif z <= 1.0: tmp = (x * (y / z)) / z else: tmp = (y * (x / (z * z))) / z return tmp
x, y = sort([x, y]) function code(x, y, z) tmp = 0.0 if (z <= -1.0) tmp = Float64(x / Float64(z * Float64(z * Float64(z / y)))); elseif (z <= 1.0) tmp = Float64(Float64(x * Float64(y / z)) / z); else tmp = Float64(Float64(y * Float64(x / Float64(z * 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 = x / (z * (z * (z / y)));
elseif (z <= 1.0)
tmp = (x * (y / z)) / z;
else
tmp = (y * (x / (z * 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[(x / N[(z * N[(z * N[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.0], N[(N[(x * N[(y / z), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], N[(N[(y * N[(x / N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1:\\
\;\;\;\;\frac{x}{z \cdot \left(z \cdot \frac{z}{y}\right)}\\
\mathbf{elif}\;z \leq 1:\\
\;\;\;\;\frac{x \cdot \frac{y}{z}}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{y \cdot \frac{x}{z \cdot z}}{z}\\
\end{array}
\end{array}
if z < -1Initial program 92.4%
/-rgt-identity92.4%
associate-/l*92.4%
associate-/l/96.0%
associate-*l*97.9%
associate-*r/97.8%
*-rgt-identity97.8%
associate-*l*98.0%
associate-*r/97.9%
distribute-lft-in97.9%
fma-def97.9%
*-rgt-identity97.9%
Simplified97.9%
Taylor expanded in z around inf 95.7%
unpow295.7%
Simplified95.7%
associate-/l*95.7%
associate-/r/95.7%
Applied egg-rr95.7%
if -1 < z < 1Initial program 82.5%
associate-*l*82.5%
times-frac96.3%
distribute-lft-in96.3%
fma-def96.3%
*-rgt-identity96.3%
Simplified96.3%
*-commutative96.3%
associate-*l/97.7%
fma-udef97.6%
distribute-lft1-in97.7%
frac-times90.1%
associate-*r/97.7%
Applied egg-rr97.7%
Taylor expanded in z around 0 86.8%
associate-*r/94.3%
Simplified94.3%
Taylor expanded in y around 0 86.8%
associate-*l/93.6%
*-commutative93.6%
Simplified93.6%
if 1 < z Initial program 76.7%
associate-*l*76.7%
times-frac90.4%
distribute-lft-in90.4%
fma-def90.4%
*-rgt-identity90.4%
Simplified90.4%
*-commutative90.4%
associate-*l/91.7%
fma-udef91.7%
distribute-lft1-in91.7%
frac-times98.9%
associate-*r/98.5%
Applied egg-rr98.5%
Taylor expanded in z around inf 87.5%
unpow287.5%
associate-*r/91.8%
Simplified91.8%
Final simplification93.5%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z) :precision binary64 (if (<= z -1.0) (/ x (* z (* z (/ z y)))) (if (<= z 1.0) (/ (* x (/ y z)) z) (/ (* y (/ (/ x z) z)) z))))
assert(x < y);
double code(double x, double y, double z) {
double tmp;
if (z <= -1.0) {
tmp = x / (z * (z * (z / y)));
} else if (z <= 1.0) {
tmp = (x * (y / z)) / z;
} else {
tmp = (y * ((x / z) / 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 = x / (z * (z * (z / y)))
else if (z <= 1.0d0) then
tmp = (x * (y / z)) / z
else
tmp = (y * ((x / z) / 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 = x / (z * (z * (z / y)));
} else if (z <= 1.0) {
tmp = (x * (y / z)) / z;
} else {
tmp = (y * ((x / z) / z)) / z;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z): tmp = 0 if z <= -1.0: tmp = x / (z * (z * (z / y))) elif z <= 1.0: tmp = (x * (y / z)) / z else: tmp = (y * ((x / z) / z)) / z return tmp
x, y = sort([x, y]) function code(x, y, z) tmp = 0.0 if (z <= -1.0) tmp = Float64(x / Float64(z * Float64(z * Float64(z / y)))); elseif (z <= 1.0) tmp = Float64(Float64(x * Float64(y / z)) / z); else tmp = Float64(Float64(y * Float64(Float64(x / z) / 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 = x / (z * (z * (z / y)));
elseif (z <= 1.0)
tmp = (x * (y / z)) / z;
else
tmp = (y * ((x / z) / 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[(x / N[(z * N[(z * N[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.0], N[(N[(x * N[(y / z), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], N[(N[(y * N[(N[(x / z), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1:\\
\;\;\;\;\frac{x}{z \cdot \left(z \cdot \frac{z}{y}\right)}\\
\mathbf{elif}\;z \leq 1:\\
\;\;\;\;\frac{x \cdot \frac{y}{z}}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{y \cdot \frac{\frac{x}{z}}{z}}{z}\\
\end{array}
\end{array}
if z < -1Initial program 92.4%
/-rgt-identity92.4%
associate-/l*92.4%
associate-/l/96.0%
associate-*l*97.9%
associate-*r/97.8%
*-rgt-identity97.8%
associate-*l*98.0%
associate-*r/97.9%
distribute-lft-in97.9%
fma-def97.9%
*-rgt-identity97.9%
Simplified97.9%
Taylor expanded in z around inf 95.7%
unpow295.7%
Simplified95.7%
associate-/l*95.7%
associate-/r/95.7%
Applied egg-rr95.7%
if -1 < z < 1Initial program 82.5%
associate-*l*82.5%
times-frac96.3%
distribute-lft-in96.3%
fma-def96.3%
*-rgt-identity96.3%
Simplified96.3%
*-commutative96.3%
associate-*l/97.7%
fma-udef97.6%
distribute-lft1-in97.7%
frac-times90.1%
associate-*r/97.7%
Applied egg-rr97.7%
Taylor expanded in z around 0 86.8%
associate-*r/94.3%
Simplified94.3%
Taylor expanded in y around 0 86.8%
associate-*l/93.6%
*-commutative93.6%
Simplified93.6%
if 1 < z Initial program 76.7%
associate-*l*76.7%
times-frac90.4%
distribute-lft-in90.4%
fma-def90.4%
*-rgt-identity90.4%
Simplified90.4%
*-commutative90.4%
associate-*l/91.7%
fma-udef91.7%
distribute-lft1-in91.7%
frac-times98.9%
associate-*r/98.5%
Applied egg-rr98.5%
Taylor expanded in z around inf 87.5%
unpow287.5%
associate-*r/91.8%
associate-/r*97.7%
Simplified97.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 (<= z -1.0) (/ x (* z (* z (/ z y)))) (if (<= z 0.76) (/ (* x (- (/ y z) y)) z) (/ (* y (/ (/ x z) z)) z))))
assert(x < y);
double code(double x, double y, double z) {
double tmp;
if (z <= -1.0) {
tmp = x / (z * (z * (z / y)));
} else if (z <= 0.76) {
tmp = (x * ((y / z) - y)) / z;
} else {
tmp = (y * ((x / z) / 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 = x / (z * (z * (z / y)))
else if (z <= 0.76d0) then
tmp = (x * ((y / z) - y)) / z
else
tmp = (y * ((x / z) / 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 = x / (z * (z * (z / y)));
} else if (z <= 0.76) {
tmp = (x * ((y / z) - y)) / z;
} else {
tmp = (y * ((x / z) / z)) / z;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z): tmp = 0 if z <= -1.0: tmp = x / (z * (z * (z / y))) elif z <= 0.76: tmp = (x * ((y / z) - y)) / z else: tmp = (y * ((x / z) / z)) / z return tmp
x, y = sort([x, y]) function code(x, y, z) tmp = 0.0 if (z <= -1.0) tmp = Float64(x / Float64(z * Float64(z * Float64(z / y)))); elseif (z <= 0.76) tmp = Float64(Float64(x * Float64(Float64(y / z) - y)) / z); else tmp = Float64(Float64(y * Float64(Float64(x / z) / 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 = x / (z * (z * (z / y)));
elseif (z <= 0.76)
tmp = (x * ((y / z) - y)) / z;
else
tmp = (y * ((x / z) / 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[(x / N[(z * N[(z * N[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 0.76], N[(N[(x * N[(N[(y / z), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], N[(N[(y * N[(N[(x / z), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1:\\
\;\;\;\;\frac{x}{z \cdot \left(z \cdot \frac{z}{y}\right)}\\
\mathbf{elif}\;z \leq 0.76:\\
\;\;\;\;\frac{x \cdot \left(\frac{y}{z} - y\right)}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{y \cdot \frac{\frac{x}{z}}{z}}{z}\\
\end{array}
\end{array}
if z < -1Initial program 92.4%
/-rgt-identity92.4%
associate-/l*92.4%
associate-/l/96.0%
associate-*l*97.9%
associate-*r/97.8%
*-rgt-identity97.8%
associate-*l*98.0%
associate-*r/97.9%
distribute-lft-in97.9%
fma-def97.9%
*-rgt-identity97.9%
Simplified97.9%
Taylor expanded in z around inf 95.7%
unpow295.7%
Simplified95.7%
associate-/l*95.7%
associate-/r/95.7%
Applied egg-rr95.7%
if -1 < z < 0.76000000000000001Initial program 82.5%
associate-*l*82.5%
times-frac96.3%
distribute-lft-in96.3%
fma-def96.3%
*-rgt-identity96.3%
Simplified96.3%
Taylor expanded in z around 0 93.7%
neg-mul-193.7%
+-commutative93.7%
unsub-neg93.7%
Simplified93.7%
Taylor expanded in x around 0 94.4%
if 0.76000000000000001 < z Initial program 76.7%
associate-*l*76.7%
times-frac90.4%
distribute-lft-in90.4%
fma-def90.4%
*-rgt-identity90.4%
Simplified90.4%
*-commutative90.4%
associate-*l/91.7%
fma-udef91.7%
distribute-lft1-in91.7%
frac-times98.9%
associate-*r/98.5%
Applied egg-rr98.5%
Taylor expanded in z around inf 87.5%
unpow287.5%
associate-*r/91.8%
associate-/r*97.7%
Simplified97.7%
Final simplification95.6%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z) :precision binary64 (if (<= z -1.0) (/ x (* z (* z (/ z y)))) (if (<= z 0.76) (/ (* x (- (/ y z) y)) z) (/ (/ y (* z (/ z x))) z))))
assert(x < y);
double code(double x, double y, double z) {
double tmp;
if (z <= -1.0) {
tmp = x / (z * (z * (z / y)));
} else if (z <= 0.76) {
tmp = (x * ((y / z) - y)) / z;
} else {
tmp = (y / (z * (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 (z <= (-1.0d0)) then
tmp = x / (z * (z * (z / y)))
else if (z <= 0.76d0) then
tmp = (x * ((y / z) - y)) / z
else
tmp = (y / (z * (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 (z <= -1.0) {
tmp = x / (z * (z * (z / y)));
} else if (z <= 0.76) {
tmp = (x * ((y / z) - y)) / z;
} else {
tmp = (y / (z * (z / x))) / z;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z): tmp = 0 if z <= -1.0: tmp = x / (z * (z * (z / y))) elif z <= 0.76: tmp = (x * ((y / z) - y)) / z else: tmp = (y / (z * (z / x))) / z return tmp
x, y = sort([x, y]) function code(x, y, z) tmp = 0.0 if (z <= -1.0) tmp = Float64(x / Float64(z * Float64(z * Float64(z / y)))); elseif (z <= 0.76) tmp = Float64(Float64(x * Float64(Float64(y / z) - y)) / z); else tmp = Float64(Float64(y / Float64(z * Float64(z / x))) / 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 = x / (z * (z * (z / y)));
elseif (z <= 0.76)
tmp = (x * ((y / z) - y)) / z;
else
tmp = (y / (z * (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[LessEqual[z, -1.0], N[(x / N[(z * N[(z * N[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 0.76], N[(N[(x * N[(N[(y / z), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], N[(N[(y / N[(z * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1:\\
\;\;\;\;\frac{x}{z \cdot \left(z \cdot \frac{z}{y}\right)}\\
\mathbf{elif}\;z \leq 0.76:\\
\;\;\;\;\frac{x \cdot \left(\frac{y}{z} - y\right)}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{y}{z \cdot \frac{z}{x}}}{z}\\
\end{array}
\end{array}
if z < -1Initial program 92.4%
/-rgt-identity92.4%
associate-/l*92.4%
associate-/l/96.0%
associate-*l*97.9%
associate-*r/97.8%
*-rgt-identity97.8%
associate-*l*98.0%
associate-*r/97.9%
distribute-lft-in97.9%
fma-def97.9%
*-rgt-identity97.9%
Simplified97.9%
Taylor expanded in z around inf 95.7%
unpow295.7%
Simplified95.7%
associate-/l*95.7%
associate-/r/95.7%
Applied egg-rr95.7%
if -1 < z < 0.76000000000000001Initial program 82.5%
associate-*l*82.5%
times-frac96.3%
distribute-lft-in96.3%
fma-def96.3%
*-rgt-identity96.3%
Simplified96.3%
Taylor expanded in z around 0 93.7%
neg-mul-193.7%
+-commutative93.7%
unsub-neg93.7%
Simplified93.7%
Taylor expanded in x around 0 94.4%
if 0.76000000000000001 < z Initial program 76.7%
associate-*l*76.7%
times-frac90.4%
distribute-lft-in90.4%
fma-def90.4%
*-rgt-identity90.4%
Simplified90.4%
*-commutative90.4%
associate-*l/91.7%
fma-udef91.7%
distribute-lft1-in91.7%
frac-times98.9%
associate-*r/98.5%
Applied egg-rr98.5%
Taylor expanded in z around inf 87.5%
unpow287.5%
associate-*r/91.8%
Simplified91.8%
associate-/r*97.7%
associate-*r/97.2%
associate-/l*97.6%
div-inv97.6%
clear-num97.7%
Applied egg-rr97.7%
Final simplification95.6%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z) :precision binary64 (if (<= z 5.5e+34) (* (/ x z) (/ y (+ z (* z z)))) (/ (/ y (* z (/ z x))) z)))
assert(x < y);
double code(double x, double y, double z) {
double tmp;
if (z <= 5.5e+34) {
tmp = (x / z) * (y / (z + (z * z)));
} else {
tmp = (y / (z * (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 (z <= 5.5d+34) then
tmp = (x / z) * (y / (z + (z * z)))
else
tmp = (y / (z * (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 (z <= 5.5e+34) {
tmp = (x / z) * (y / (z + (z * z)));
} else {
tmp = (y / (z * (z / x))) / z;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z): tmp = 0 if z <= 5.5e+34: tmp = (x / z) * (y / (z + (z * z))) else: tmp = (y / (z * (z / x))) / z return tmp
x, y = sort([x, y]) function code(x, y, z) tmp = 0.0 if (z <= 5.5e+34) tmp = Float64(Float64(x / z) * Float64(y / Float64(z + Float64(z * z)))); else tmp = Float64(Float64(y / Float64(z * Float64(z / x))) / z); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z)
tmp = 0.0;
if (z <= 5.5e+34)
tmp = (x / z) * (y / (z + (z * z)));
else
tmp = (y / (z * (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[LessEqual[z, 5.5e+34], N[(N[(x / z), $MachinePrecision] * N[(y / N[(z + N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y / N[(z * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq 5.5 \cdot 10^{+34}:\\
\;\;\;\;\frac{x}{z} \cdot \frac{y}{z + z \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{y}{z \cdot \frac{z}{x}}}{z}\\
\end{array}
\end{array}
if z < 5.4999999999999996e34Initial program 85.3%
associate-*l*85.3%
times-frac97.0%
distribute-lft-in97.0%
fma-def97.0%
*-rgt-identity97.0%
Simplified97.0%
*-commutative97.0%
associate-*l/97.4%
fma-udef97.4%
distribute-lft1-in97.4%
frac-times93.0%
associate-*r/97.4%
Applied egg-rr97.4%
associate-/l*93.9%
associate-/r/97.0%
Applied egg-rr97.0%
Taylor expanded in y around 0 97.0%
distribute-lft-in97.0%
*-rgt-identity97.0%
Simplified97.0%
if 5.4999999999999996e34 < z Initial program 75.2%
associate-*l*75.2%
times-frac89.2%
distribute-lft-in89.2%
fma-def89.2%
*-rgt-identity89.2%
Simplified89.2%
*-commutative89.2%
associate-*l/92.1%
fma-udef92.1%
distribute-lft1-in92.1%
frac-times98.8%
associate-*r/99.8%
Applied egg-rr99.8%
Taylor expanded in z around inf 87.4%
unpow287.4%
associate-*r/92.2%
Simplified92.2%
associate-/r*98.9%
associate-*r/98.3%
associate-/l*98.8%
div-inv98.8%
clear-num98.9%
Applied egg-rr98.9%
Final simplification97.4%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z) :precision binary64 (/ (* (/ y (+ z 1.0)) (/ x z)) z))
assert(x < y);
double code(double x, double y, double z) {
return ((y / (z + 1.0)) * (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 / (z + 1.0d0)) * (x / z)) / z
end function
assert x < y;
public static double code(double x, double y, double z) {
return ((y / (z + 1.0)) * (x / z)) / z;
}
[x, y] = sort([x, y]) def code(x, y, z): return ((y / (z + 1.0)) * (x / z)) / z
x, y = sort([x, y]) function code(x, y, z) return Float64(Float64(Float64(y / Float64(z + 1.0)) * Float64(x / z)) / z) end
x, y = num2cell(sort([x, y])){:}
function tmp = code(x, y, z)
tmp = ((y / (z + 1.0)) * (x / z)) / z;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_] := N[(N[(N[(y / N[(z + 1.0), $MachinePrecision]), $MachinePrecision] * N[(x / z), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\frac{\frac{y}{z + 1} \cdot \frac{x}{z}}{z}
\end{array}
Initial program 82.8%
associate-*l*82.9%
times-frac95.1%
distribute-lft-in95.1%
fma-def95.1%
*-rgt-identity95.1%
Simplified95.1%
*-commutative95.1%
associate-*l/96.2%
fma-udef96.1%
distribute-lft1-in96.2%
frac-times94.4%
associate-*r/98.0%
Applied egg-rr98.0%
Final simplification98.0%
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 82.8%
associate-*l*82.9%
times-frac95.1%
distribute-lft-in95.1%
fma-def95.1%
*-rgt-identity95.1%
Simplified95.1%
*-commutative95.1%
associate-*l/96.2%
fma-udef96.1%
distribute-lft1-in96.2%
frac-times94.4%
associate-*r/98.0%
Applied egg-rr98.0%
associate-/l*95.1%
associate-/r/97.0%
Applied egg-rr97.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 (<= y 2.5e+56) (* (/ x z) (/ y z)) (* y (/ (/ x z) z))))
assert(x < y);
double code(double x, double y, double z) {
double tmp;
if (y <= 2.5e+56) {
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 <= 2.5d+56) 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 <= 2.5e+56) {
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 <= 2.5e+56: 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 <= 2.5e+56) tmp = Float64(Float64(x / z) * Float64(y / z)); else tmp = Float64(y * Float64(Float64(x / z) / z)); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z)
tmp = 0.0;
if (y <= 2.5e+56)
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, 2.5e+56], N[(N[(x / z), $MachinePrecision] * N[(y / z), $MachinePrecision]), $MachinePrecision], N[(y * N[(N[(x / z), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 2.5 \cdot 10^{+56}:\\
\;\;\;\;\frac{x}{z} \cdot \frac{y}{z}\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{\frac{x}{z}}{z}\\
\end{array}
\end{array}
if y < 2.50000000000000012e56Initial program 81.8%
associate-*l*81.8%
times-frac94.6%
distribute-lft-in94.6%
fma-def94.6%
*-rgt-identity94.6%
Simplified94.6%
Taylor expanded in z around 0 67.5%
unpow267.5%
associate-/l/67.2%
associate-*r/73.0%
associate-*l/73.5%
Simplified73.5%
if 2.50000000000000012e56 < y Initial program 87.4%
/-rgt-identity87.4%
associate-/l*87.4%
associate-/l/85.3%
associate-*l*93.6%
associate-*r/93.6%
*-rgt-identity93.6%
associate-*l*93.6%
associate-*r/93.5%
distribute-lft-in93.3%
fma-def93.5%
*-rgt-identity93.5%
Simplified93.5%
Taylor expanded in z around 0 63.9%
associate-/r*70.0%
associate-/r/77.7%
Applied egg-rr77.7%
Final simplification74.2%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z) :precision binary64 (if (<= x -5.5e-72) (/ x (* z (/ z y))) (* y (/ (/ x z) z))))
assert(x < y);
double code(double x, double y, double z) {
double tmp;
if (x <= -5.5e-72) {
tmp = x / (z * (z / y));
} else {
tmp = y * ((x / z) / z);
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (x <= (-5.5d-72)) then
tmp = x / (z * (z / y))
else
tmp = y * ((x / z) / z)
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z) {
double tmp;
if (x <= -5.5e-72) {
tmp = x / (z * (z / y));
} else {
tmp = y * ((x / z) / z);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z): tmp = 0 if x <= -5.5e-72: tmp = x / (z * (z / y)) else: tmp = y * ((x / z) / z) return tmp
x, y = sort([x, y]) function code(x, y, z) tmp = 0.0 if (x <= -5.5e-72) tmp = Float64(x / Float64(z * Float64(z / y))); else tmp = Float64(y * Float64(Float64(x / z) / z)); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z)
tmp = 0.0;
if (x <= -5.5e-72)
tmp = x / (z * (z / y));
else
tmp = y * ((x / z) / z);
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_] := If[LessEqual[x, -5.5e-72], N[(x / N[(z * N[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * N[(N[(x / z), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -5.5 \cdot 10^{-72}:\\
\;\;\;\;\frac{x}{z \cdot \frac{z}{y}}\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{\frac{x}{z}}{z}\\
\end{array}
\end{array}
if x < -5.49999999999999994e-72Initial program 86.8%
/-rgt-identity86.8%
associate-/l*86.8%
associate-/l/89.2%
associate-*l*91.6%
associate-*r/91.7%
*-rgt-identity91.7%
associate-*l*93.7%
associate-*r/92.9%
distribute-lft-in92.9%
fma-def92.9%
*-rgt-identity92.9%
Simplified92.9%
Taylor expanded in z around 0 70.0%
if -5.49999999999999994e-72 < x Initial program 81.1%
/-rgt-identity81.1%
associate-/l*81.1%
associate-/l/81.2%
associate-*l*83.3%
associate-*r/83.3%
*-rgt-identity83.3%
associate-*l*90.2%
associate-*r/89.2%
distribute-lft-in89.1%
fma-def89.2%
*-rgt-identity89.2%
Simplified89.2%
Taylor expanded in z around 0 70.9%
associate-/r*75.5%
associate-/r/73.8%
Applied egg-rr73.8%
Final simplification72.7%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z) :precision binary64 (if (<= x -2.8e-73) (/ x (* z (/ z y))) (/ y (* z (/ z x)))))
assert(x < y);
double code(double x, double y, double z) {
double tmp;
if (x <= -2.8e-73) {
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.8d-73)) 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.8e-73) {
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.8e-73: 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.8e-73) 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.8e-73)
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.8e-73], 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.8 \cdot 10^{-73}:\\
\;\;\;\;\frac{x}{z \cdot \frac{z}{y}}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{z \cdot \frac{z}{x}}\\
\end{array}
\end{array}
if x < -2.80000000000000012e-73Initial program 86.8%
/-rgt-identity86.8%
associate-/l*86.8%
associate-/l/89.2%
associate-*l*91.6%
associate-*r/91.7%
*-rgt-identity91.7%
associate-*l*93.7%
associate-*r/92.9%
distribute-lft-in92.9%
fma-def92.9%
*-rgt-identity92.9%
Simplified92.9%
Taylor expanded in z around 0 70.0%
if -2.80000000000000012e-73 < x Initial program 81.1%
associate-*l*81.1%
times-frac96.0%
distribute-lft-in96.0%
fma-def96.0%
*-rgt-identity96.0%
Simplified96.0%
Taylor expanded in z around 0 66.3%
unpow266.3%
associate-/l*69.4%
Simplified69.4%
associate-/l*74.8%
associate-/r/74.8%
Applied egg-rr74.8%
Final simplification73.3%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z) :precision binary64 (if (<= z -1e-310) (* y (/ (- x) z)) (* y (/ x z))))
assert(x < y);
double code(double x, double y, double z) {
double tmp;
if (z <= -1e-310) {
tmp = y * (-x / 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 (z <= (-1d-310)) then
tmp = y * (-x / 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 (z <= -1e-310) {
tmp = y * (-x / z);
} else {
tmp = y * (x / z);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z): tmp = 0 if z <= -1e-310: tmp = y * (-x / z) else: tmp = y * (x / z) return tmp
x, y = sort([x, y]) function code(x, y, z) tmp = 0.0 if (z <= -1e-310) tmp = Float64(y * Float64(Float64(-x) / z)); else tmp = Float64(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 (z <= -1e-310)
tmp = y * (-x / 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[z, -1e-310], N[(y * N[((-x) / z), $MachinePrecision]), $MachinePrecision], N[(y * N[(x / z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1 \cdot 10^{-310}:\\
\;\;\;\;y \cdot \frac{-x}{z}\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{x}{z}\\
\end{array}
\end{array}
if z < -9.999999999999969e-311Initial program 85.7%
associate-*l*85.7%
times-frac98.4%
distribute-lft-in98.3%
fma-def98.4%
*-rgt-identity98.4%
Simplified98.4%
Taylor expanded in z around 0 72.6%
neg-mul-172.6%
+-commutative72.6%
unsub-neg72.6%
Simplified72.6%
Taylor expanded in z around inf 37.8%
neg-mul-137.8%
Simplified37.8%
if -9.999999999999969e-311 < z Initial program 80.4%
associate-*l*80.5%
times-frac92.4%
distribute-lft-in92.4%
fma-def92.4%
*-rgt-identity92.4%
Simplified92.4%
Taylor expanded in z around 0 61.9%
neg-mul-161.9%
+-commutative61.9%
unsub-neg61.9%
Simplified61.9%
Taylor expanded in z around inf 17.3%
neg-mul-117.3%
Simplified17.3%
associate-*l/15.3%
associate-/l*18.7%
add-sqr-sqrt10.8%
sqrt-unprod29.6%
sqr-neg29.6%
sqrt-unprod19.2%
add-sqr-sqrt38.2%
Applied egg-rr38.2%
associate-/r/36.2%
Applied egg-rr36.2%
Final simplification36.9%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z) :precision binary64 (* (/ x z) (/ y z)))
assert(x < y);
double code(double x, double y, double z) {
return (x / z) * (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 / z) * (y / z)
end function
assert x < y;
public static double code(double x, double y, double z) {
return (x / z) * (y / z);
}
[x, y] = sort([x, y]) def code(x, y, z): return (x / z) * (y / z)
x, y = sort([x, y]) function code(x, y, z) return Float64(Float64(x / z) * Float64(y / z)) end
x, y = num2cell(sort([x, y])){:}
function tmp = code(x, y, z)
tmp = (x / z) * (y / 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[(y / z), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\frac{x}{z} \cdot \frac{y}{z}
\end{array}
Initial program 82.8%
associate-*l*82.9%
times-frac95.1%
distribute-lft-in95.1%
fma-def95.1%
*-rgt-identity95.1%
Simplified95.1%
Taylor expanded in z around 0 69.1%
unpow269.1%
associate-/l/67.7%
associate-*r/72.8%
associate-*l/72.8%
Simplified72.8%
Final simplification72.8%
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 82.8%
associate-*l*82.9%
times-frac95.1%
distribute-lft-in95.1%
fma-def95.1%
*-rgt-identity95.1%
Simplified95.1%
Taylor expanded in z around 0 66.8%
neg-mul-166.8%
+-commutative66.8%
unsub-neg66.8%
Simplified66.8%
Taylor expanded in z around inf 26.7%
neg-mul-126.7%
Simplified26.7%
associate-*l/23.3%
associate-/l*28.1%
add-sqr-sqrt14.8%
sqrt-unprod30.5%
sqr-neg30.5%
sqrt-unprod16.4%
add-sqr-sqrt30.6%
Applied egg-rr30.6%
associate-/r/29.6%
Applied egg-rr29.6%
Final simplification29.6%
(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 2023200
(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))))