
(FPCore (x y z) :precision binary64 (/ (* x y) (* (* z z) (+ z 1.0))))
double code(double x, double y, double z) {
return (x * y) / ((z * z) * (z + 1.0));
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = (x * y) / ((z * z) * (z + 1.0d0))
end function
public static double code(double x, double y, double z) {
return (x * y) / ((z * z) * (z + 1.0));
}
def code(x, y, z): return (x * y) / ((z * z) * (z + 1.0))
function code(x, y, z) return Float64(Float64(x * y) / Float64(Float64(z * z) * Float64(z + 1.0))) end
function tmp = code(x, y, z) tmp = (x * y) / ((z * z) * (z + 1.0)); end
code[x_, y_, z_] := N[(N[(x * y), $MachinePrecision] / N[(N[(z * z), $MachinePrecision] * N[(z + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x \cdot y}{\left(z \cdot z\right) \cdot \left(z + 1\right)}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 15 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z) :precision binary64 (/ (* x y) (* (* z z) (+ z 1.0))))
double code(double x, double y, double z) {
return (x * y) / ((z * z) * (z + 1.0));
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = (x * y) / ((z * z) * (z + 1.0d0))
end function
public static double code(double x, double y, double z) {
return (x * y) / ((z * z) * (z + 1.0));
}
def code(x, y, z): return (x * y) / ((z * z) * (z + 1.0))
function code(x, y, z) return Float64(Float64(x * y) / Float64(Float64(z * z) * Float64(z + 1.0))) end
function tmp = code(x, y, z) tmp = (x * y) / ((z * z) * (z + 1.0)); end
code[x_, y_, z_] := N[(N[(x * y), $MachinePrecision] / N[(N[(z * z), $MachinePrecision] * N[(z + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x \cdot y}{\left(z \cdot z\right) \cdot \left(z + 1\right)}
\end{array}
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z) :precision binary64 (if (<= z -4.3e-150) (* (/ y (+ z 1.0)) (/ x (* z z))) (if (<= z 1.0) (/ (* x (/ y z)) z) (/ (/ y z) (* z (/ z x))))))
assert(x < y);
double code(double x, double y, double z) {
double tmp;
if (z <= -4.3e-150) {
tmp = (y / (z + 1.0)) * (x / (z * z));
} else if (z <= 1.0) {
tmp = (x * (y / z)) / z;
} else {
tmp = (y / z) / (z * (z / x));
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (z <= (-4.3d-150)) then
tmp = (y / (z + 1.0d0)) * (x / (z * z))
else if (z <= 1.0d0) then
tmp = (x * (y / z)) / z
else
tmp = (y / z) / (z * (z / x))
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z) {
double tmp;
if (z <= -4.3e-150) {
tmp = (y / (z + 1.0)) * (x / (z * z));
} else if (z <= 1.0) {
tmp = (x * (y / z)) / z;
} else {
tmp = (y / z) / (z * (z / x));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z): tmp = 0 if z <= -4.3e-150: tmp = (y / (z + 1.0)) * (x / (z * z)) elif z <= 1.0: tmp = (x * (y / z)) / z else: tmp = (y / z) / (z * (z / x)) return tmp
x, y = sort([x, y]) function code(x, y, z) tmp = 0.0 if (z <= -4.3e-150) tmp = Float64(Float64(y / Float64(z + 1.0)) * Float64(x / Float64(z * z))); elseif (z <= 1.0) tmp = Float64(Float64(x * Float64(y / z)) / z); else tmp = Float64(Float64(y / z) / 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 (z <= -4.3e-150)
tmp = (y / (z + 1.0)) * (x / (z * z));
elseif (z <= 1.0)
tmp = (x * (y / z)) / z;
else
tmp = (y / z) / (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[z, -4.3e-150], N[(N[(y / N[(z + 1.0), $MachinePrecision]), $MachinePrecision] * N[(x / N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.0], N[(N[(x * N[(y / z), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], N[(N[(y / z), $MachinePrecision] / N[(z * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.3 \cdot 10^{-150}:\\
\;\;\;\;\frac{y}{z + 1} \cdot \frac{x}{z \cdot z}\\
\mathbf{elif}\;z \leq 1:\\
\;\;\;\;\frac{x \cdot \frac{y}{z}}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{y}{z}}{z \cdot \frac{z}{x}}\\
\end{array}
\end{array}
if z < -4.30000000000000004e-150Initial program 85.2%
times-frac95.3%
Simplified95.3%
if -4.30000000000000004e-150 < z < 1Initial program 78.9%
times-frac73.5%
Simplified73.5%
Taylor expanded in z around 0 73.5%
associate-*l/78.9%
times-frac95.0%
*-commutative95.0%
associate-*r/96.8%
Applied egg-rr96.8%
if 1 < z Initial program 84.2%
associate-*l*84.2%
times-frac92.2%
distribute-lft-in92.2%
fma-def92.2%
*-rgt-identity92.2%
Simplified92.2%
Taylor expanded in z around inf 92.0%
unpow292.0%
Simplified92.0%
clear-num91.9%
associate-/r*98.3%
frac-times99.4%
*-un-lft-identity99.4%
*-commutative99.4%
Applied egg-rr99.4%
Final simplification97.1%
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 82.7%
associate-*l*82.7%
times-frac93.3%
distribute-lft-in93.3%
fma-def93.3%
*-rgt-identity93.3%
Simplified93.3%
Taylor expanded in z around inf 92.7%
unpow292.7%
Simplified92.7%
if -1 < z < 1Initial program 82.4%
times-frac79.0%
Simplified79.0%
Taylor expanded in z around 0 77.6%
associate-*l/81.1%
times-frac94.0%
*-commutative94.0%
associate-*r/94.1%
Applied egg-rr94.1%
Final simplification93.3%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z) :precision binary64 (if (or (<= z -1.0) (not (<= z 1.0))) (* (/ 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(Float64(y / 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[(N[(y / z), $MachinePrecision] / z), $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{\frac{y}{z}}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot \frac{y}{z}}{z}\\
\end{array}
\end{array}
if z < -1 or 1 < z Initial program 82.7%
associate-*l*82.7%
times-frac93.3%
distribute-lft-in93.3%
fma-def93.3%
*-rgt-identity93.3%
Simplified93.3%
Taylor expanded in z around inf 92.7%
unpow292.7%
associate-/r*98.4%
Simplified98.4%
if -1 < z < 1Initial program 82.4%
times-frac79.0%
Simplified79.0%
Taylor expanded in z around 0 77.6%
associate-*l/81.1%
times-frac94.0%
*-commutative94.0%
associate-*r/94.1%
Applied egg-rr94.1%
Final simplification96.3%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z) :precision binary64 (if (or (<= z -1.0) (not (<= z 0.75))) (* (/ x z) (/ (/ y z) z)) (/ (- (/ y z) y) (/ z x))))
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 = ((y / z) - y) / (z / x);
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if ((z <= (-1.0d0)) .or. (.not. (z <= 0.75d0))) then
tmp = (x / z) * ((y / z) / z)
else
tmp = ((y / z) - y) / (z / x)
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -1.0) || !(z <= 0.75)) {
tmp = (x / z) * ((y / z) / z);
} else {
tmp = ((y / z) - y) / (z / x);
}
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 = ((y / z) - y) / (z / x) 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(Float64(y / z) / z)); else tmp = Float64(Float64(Float64(y / z) - 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 ((z <= -1.0) || ~((z <= 0.75)))
tmp = (x / z) * ((y / z) / z);
else
tmp = ((y / z) - 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[Or[LessEqual[z, -1.0], N[Not[LessEqual[z, 0.75]], $MachinePrecision]], N[(N[(x / z), $MachinePrecision] * N[(N[(y / z), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], N[(N[(N[(y / z), $MachinePrecision] - y), $MachinePrecision] / N[(z / x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1 \lor \neg \left(z \leq 0.75\right):\\
\;\;\;\;\frac{x}{z} \cdot \frac{\frac{y}{z}}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{y}{z} - y}{\frac{z}{x}}\\
\end{array}
\end{array}
if z < -1 or 0.75 < z Initial program 82.7%
associate-*l*82.7%
times-frac93.3%
distribute-lft-in93.3%
fma-def93.3%
*-rgt-identity93.3%
Simplified93.3%
Taylor expanded in z around inf 92.7%
unpow292.7%
associate-/r*98.4%
Simplified98.4%
if -1 < z < 0.75Initial program 82.4%
associate-*l*82.4%
times-frac95.3%
distribute-lft-in95.3%
fma-def95.3%
*-rgt-identity95.3%
Simplified95.3%
Taylor expanded in z around 0 94.3%
neg-mul-194.3%
+-commutative94.3%
unsub-neg94.3%
Simplified94.3%
*-commutative94.3%
clear-num94.2%
un-div-inv94.8%
Applied egg-rr94.8%
Final simplification96.6%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z) :precision binary64 (if (<= z -1.0) (/ (/ x z) (* z (/ z y))) (if (<= z 0.75) (/ (- (/ y z) y) (/ z x)) (* (/ x z) (/ (/ y z) z)))))
assert(x < y);
double code(double x, double y, double z) {
double tmp;
if (z <= -1.0) {
tmp = (x / z) / (z * (z / y));
} else if (z <= 0.75) {
tmp = ((y / z) - y) / (z / x);
} else {
tmp = (x / z) * ((y / z) / z);
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (z <= (-1.0d0)) then
tmp = (x / z) / (z * (z / y))
else if (z <= 0.75d0) then
tmp = ((y / z) - y) / (z / x)
else
tmp = (x / z) * ((y / z) / z)
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z) {
double tmp;
if (z <= -1.0) {
tmp = (x / z) / (z * (z / y));
} else if (z <= 0.75) {
tmp = ((y / z) - y) / (z / x);
} else {
tmp = (x / z) * ((y / z) / z);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z): tmp = 0 if z <= -1.0: tmp = (x / z) / (z * (z / y)) elif z <= 0.75: tmp = ((y / z) - y) / (z / x) else: tmp = (x / z) * ((y / z) / z) return tmp
x, y = sort([x, y]) function code(x, y, z) tmp = 0.0 if (z <= -1.0) tmp = Float64(Float64(x / z) / Float64(z * Float64(z / y))); elseif (z <= 0.75) tmp = Float64(Float64(Float64(y / z) - y) / Float64(z / x)); else tmp = Float64(Float64(x / z) * Float64(Float64(y / z) / z)); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z)
tmp = 0.0;
if (z <= -1.0)
tmp = (x / z) / (z * (z / y));
elseif (z <= 0.75)
tmp = ((y / z) - y) / (z / x);
else
tmp = (x / z) * ((y / z) / z);
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_] := If[LessEqual[z, -1.0], N[(N[(x / z), $MachinePrecision] / N[(z * N[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 0.75], N[(N[(N[(y / z), $MachinePrecision] - y), $MachinePrecision] / N[(z / x), $MachinePrecision]), $MachinePrecision], N[(N[(x / z), $MachinePrecision] * N[(N[(y / z), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1:\\
\;\;\;\;\frac{\frac{x}{z}}{z \cdot \frac{z}{y}}\\
\mathbf{elif}\;z \leq 0.75:\\
\;\;\;\;\frac{\frac{y}{z} - y}{\frac{z}{x}}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{z} \cdot \frac{\frac{y}{z}}{z}\\
\end{array}
\end{array}
if z < -1Initial program 80.8%
associate-*l*80.8%
times-frac94.7%
distribute-lft-in94.7%
fma-def94.7%
*-rgt-identity94.7%
Simplified94.7%
*-commutative94.7%
associate-*l/93.1%
fma-udef93.1%
distribute-lft1-in93.1%
frac-times98.0%
clear-num98.0%
frac-times99.7%
*-un-lft-identity99.7%
Applied egg-rr99.7%
Taylor expanded in z around inf 93.6%
unpow293.6%
associate-/l*98.6%
associate-/r/98.6%
Simplified98.6%
if -1 < z < 0.75Initial program 82.4%
associate-*l*82.4%
times-frac95.3%
distribute-lft-in95.3%
fma-def95.3%
*-rgt-identity95.3%
Simplified95.3%
Taylor expanded in z around 0 94.3%
neg-mul-194.3%
+-commutative94.3%
unsub-neg94.3%
Simplified94.3%
*-commutative94.3%
clear-num94.2%
un-div-inv94.8%
Applied egg-rr94.8%
if 0.75 < z Initial program 84.2%
associate-*l*84.2%
times-frac92.2%
distribute-lft-in92.2%
fma-def92.2%
*-rgt-identity92.2%
Simplified92.2%
Taylor expanded in z around inf 92.0%
unpow292.0%
associate-/r*98.3%
Simplified98.3%
Final simplification96.6%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z) :precision binary64 (if (<= z -1.0) (/ (/ x z) (* z (/ z y))) (if (<= z 0.75) (/ (- (/ y z) y) (/ z x)) (/ (/ y z) (* z (/ z x))))))
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.75) {
tmp = ((y / z) - y) / (z / x);
} else {
tmp = (y / z) / (z * (z / x));
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (z <= (-1.0d0)) then
tmp = (x / z) / (z * (z / y))
else if (z <= 0.75d0) then
tmp = ((y / z) - y) / (z / x)
else
tmp = (y / z) / (z * (z / x))
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z) {
double tmp;
if (z <= -1.0) {
tmp = (x / z) / (z * (z / y));
} else if (z <= 0.75) {
tmp = ((y / z) - y) / (z / x);
} else {
tmp = (y / z) / (z * (z / x));
}
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.75: tmp = ((y / z) - y) / (z / x) else: tmp = (y / z) / (z * (z / x)) return tmp
x, y = sort([x, y]) function code(x, y, z) tmp = 0.0 if (z <= -1.0) tmp = Float64(Float64(x / z) / Float64(z * Float64(z / y))); elseif (z <= 0.75) tmp = Float64(Float64(Float64(y / z) - y) / Float64(z / x)); else tmp = Float64(Float64(y / z) / 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 (z <= -1.0)
tmp = (x / z) / (z * (z / y));
elseif (z <= 0.75)
tmp = ((y / z) - y) / (z / x);
else
tmp = (y / z) / (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[z, -1.0], N[(N[(x / z), $MachinePrecision] / N[(z * N[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 0.75], N[(N[(N[(y / z), $MachinePrecision] - y), $MachinePrecision] / N[(z / x), $MachinePrecision]), $MachinePrecision], N[(N[(y / z), $MachinePrecision] / N[(z * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1:\\
\;\;\;\;\frac{\frac{x}{z}}{z \cdot \frac{z}{y}}\\
\mathbf{elif}\;z \leq 0.75:\\
\;\;\;\;\frac{\frac{y}{z} - y}{\frac{z}{x}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{y}{z}}{z \cdot \frac{z}{x}}\\
\end{array}
\end{array}
if z < -1Initial program 80.8%
associate-*l*80.8%
times-frac94.7%
distribute-lft-in94.7%
fma-def94.7%
*-rgt-identity94.7%
Simplified94.7%
*-commutative94.7%
associate-*l/93.1%
fma-udef93.1%
distribute-lft1-in93.1%
frac-times98.0%
clear-num98.0%
frac-times99.7%
*-un-lft-identity99.7%
Applied egg-rr99.7%
Taylor expanded in z around inf 93.6%
unpow293.6%
associate-/l*98.6%
associate-/r/98.6%
Simplified98.6%
if -1 < z < 0.75Initial program 82.4%
associate-*l*82.4%
times-frac95.3%
distribute-lft-in95.3%
fma-def95.3%
*-rgt-identity95.3%
Simplified95.3%
Taylor expanded in z around 0 94.3%
neg-mul-194.3%
+-commutative94.3%
unsub-neg94.3%
Simplified94.3%
*-commutative94.3%
clear-num94.2%
un-div-inv94.8%
Applied egg-rr94.8%
if 0.75 < z Initial program 84.2%
associate-*l*84.2%
times-frac92.2%
distribute-lft-in92.2%
fma-def92.2%
*-rgt-identity92.2%
Simplified92.2%
Taylor expanded in z around inf 92.0%
unpow292.0%
Simplified92.0%
clear-num91.9%
associate-/r*98.3%
frac-times99.4%
*-un-lft-identity99.4%
*-commutative99.4%
Applied egg-rr99.4%
Final simplification97.0%
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.75) (/ (* x (- (/ y z) y)) z) (/ (/ y z) (* z (/ z x))))))
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.75) {
tmp = (x * ((y / z) - y)) / z;
} else {
tmp = (y / z) / (z * (z / x));
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (z <= (-1.0d0)) then
tmp = (x / z) / (z * (z / y))
else if (z <= 0.75d0) then
tmp = (x * ((y / z) - y)) / z
else
tmp = (y / z) / (z * (z / x))
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z) {
double tmp;
if (z <= -1.0) {
tmp = (x / z) / (z * (z / y));
} else if (z <= 0.75) {
tmp = (x * ((y / z) - y)) / z;
} else {
tmp = (y / z) / (z * (z / x));
}
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.75: tmp = (x * ((y / z) - y)) / z else: tmp = (y / z) / (z * (z / x)) return tmp
x, y = sort([x, y]) function code(x, y, z) tmp = 0.0 if (z <= -1.0) tmp = Float64(Float64(x / z) / Float64(z * Float64(z / y))); elseif (z <= 0.75) tmp = Float64(Float64(x * Float64(Float64(y / z) - y)) / z); else tmp = Float64(Float64(y / z) / 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 (z <= -1.0)
tmp = (x / z) / (z * (z / y));
elseif (z <= 0.75)
tmp = (x * ((y / z) - y)) / z;
else
tmp = (y / z) / (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[z, -1.0], N[(N[(x / z), $MachinePrecision] / N[(z * N[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 0.75], N[(N[(x * N[(N[(y / z), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], N[(N[(y / z), $MachinePrecision] / N[(z * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1:\\
\;\;\;\;\frac{\frac{x}{z}}{z \cdot \frac{z}{y}}\\
\mathbf{elif}\;z \leq 0.75:\\
\;\;\;\;\frac{x \cdot \left(\frac{y}{z} - y\right)}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{y}{z}}{z \cdot \frac{z}{x}}\\
\end{array}
\end{array}
if z < -1Initial program 80.8%
associate-*l*80.8%
times-frac94.7%
distribute-lft-in94.7%
fma-def94.7%
*-rgt-identity94.7%
Simplified94.7%
*-commutative94.7%
associate-*l/93.1%
fma-udef93.1%
distribute-lft1-in93.1%
frac-times98.0%
clear-num98.0%
frac-times99.7%
*-un-lft-identity99.7%
Applied egg-rr99.7%
Taylor expanded in z around inf 93.6%
unpow293.6%
associate-/l*98.6%
associate-/r/98.6%
Simplified98.6%
if -1 < z < 0.75Initial program 82.4%
associate-*l*82.4%
times-frac95.3%
distribute-lft-in95.3%
fma-def95.3%
*-rgt-identity95.3%
Simplified95.3%
*-commutative95.3%
associate-*l/93.9%
fma-udef93.9%
distribute-lft1-in93.9%
frac-times87.9%
associate-*r/93.9%
Applied egg-rr93.9%
Taylor expanded in z around 0 87.3%
+-commutative87.3%
mul-1-neg87.3%
distribute-lft-neg-out87.3%
associate-*l/91.1%
distribute-rgt-out94.3%
Simplified94.3%
if 0.75 < z Initial program 84.2%
associate-*l*84.2%
times-frac92.2%
distribute-lft-in92.2%
fma-def92.2%
*-rgt-identity92.2%
Simplified92.2%
Taylor expanded in z around inf 92.0%
unpow292.0%
Simplified92.0%
clear-num91.9%
associate-/r*98.3%
frac-times99.4%
*-un-lft-identity99.4%
*-commutative99.4%
Applied egg-rr99.4%
Final simplification96.7%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z) :precision binary64 (/ (/ x z) (* z (/ (+ z 1.0) y))))
assert(x < y);
double code(double x, double y, double z) {
return (x / z) / (z * ((z + 1.0) / y));
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = (x / z) / (z * ((z + 1.0d0) / y))
end function
assert x < y;
public static double code(double x, double y, double z) {
return (x / z) / (z * ((z + 1.0) / y));
}
[x, y] = sort([x, y]) def code(x, y, z): return (x / z) / (z * ((z + 1.0) / y))
x, y = sort([x, y]) function code(x, y, z) return Float64(Float64(x / z) / Float64(z * Float64(Float64(z + 1.0) / y))) end
x, y = num2cell(sort([x, y])){:}
function tmp = code(x, y, z)
tmp = (x / z) / (z * ((z + 1.0) / y));
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_] := N[(N[(x / z), $MachinePrecision] / N[(z * N[(N[(z + 1.0), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\frac{\frac{x}{z}}{z \cdot \frac{z + 1}{y}}
\end{array}
Initial program 82.5%
associate-*l*82.5%
times-frac94.3%
distribute-lft-in94.3%
fma-def94.3%
*-rgt-identity94.3%
Simplified94.3%
*-commutative94.3%
associate-*l/92.5%
fma-udef92.5%
distribute-lft1-in92.5%
frac-times93.6%
clear-num93.5%
frac-times97.2%
*-un-lft-identity97.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 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(Float64(x / z) * 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[(N[(x / z), $MachinePrecision] * N[(y / N[(z + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\frac{\frac{x}{z} \cdot \frac{y}{z + 1}}{z}
\end{array}
Initial program 82.5%
associate-*l*82.5%
times-frac94.3%
distribute-lft-in94.3%
fma-def94.3%
*-rgt-identity94.3%
Simplified94.3%
*-commutative94.3%
associate-*l/92.5%
fma-udef92.5%
distribute-lft1-in92.5%
frac-times93.6%
associate-*r/95.5%
Applied egg-rr95.5%
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 (<= x -2.3e+225) (not (<= x 7e-232))) (* (/ y z) (- x)) (* (/ x z) (- y))))
assert(x < y);
double code(double x, double y, double z) {
double tmp;
if ((x <= -2.3e+225) || !(x <= 7e-232)) {
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 ((x <= (-2.3d+225)) .or. (.not. (x <= 7d-232))) 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 ((x <= -2.3e+225) || !(x <= 7e-232)) {
tmp = (y / z) * -x;
} else {
tmp = (x / z) * -y;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z): tmp = 0 if (x <= -2.3e+225) or not (x <= 7e-232): 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 ((x <= -2.3e+225) || !(x <= 7e-232)) tmp = Float64(Float64(y / z) * Float64(-x)); else tmp = Float64(Float64(x / z) * Float64(-y)); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z)
tmp = 0.0;
if ((x <= -2.3e+225) || ~((x <= 7e-232)))
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[Or[LessEqual[x, -2.3e+225], N[Not[LessEqual[x, 7e-232]], $MachinePrecision]], N[(N[(y / z), $MachinePrecision] * (-x)), $MachinePrecision], N[(N[(x / z), $MachinePrecision] * (-y)), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.3 \cdot 10^{+225} \lor \neg \left(x \leq 7 \cdot 10^{-232}\right):\\
\;\;\;\;\frac{y}{z} \cdot \left(-x\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{z} \cdot \left(-y\right)\\
\end{array}
\end{array}
if x < -2.3e225 or 6.9999999999999996e-232 < x Initial program 81.3%
associate-*l*81.3%
times-frac92.2%
distribute-lft-in92.2%
fma-def92.2%
*-rgt-identity92.2%
Simplified92.2%
Taylor expanded in z around 0 56.9%
neg-mul-156.9%
+-commutative56.9%
unsub-neg56.9%
Simplified56.9%
Taylor expanded in z around inf 19.6%
mul-1-neg19.6%
associate-/l*25.7%
associate-/r/27.2%
distribute-rgt-neg-out27.2%
Simplified27.2%
if -2.3e225 < x < 6.9999999999999996e-232Initial program 83.9%
associate-*l*83.9%
times-frac96.6%
distribute-lft-in96.6%
fma-def96.6%
*-rgt-identity96.6%
Simplified96.6%
Taylor expanded in z around 0 76.6%
neg-mul-176.6%
+-commutative76.6%
unsub-neg76.6%
Simplified76.6%
Taylor expanded in z around inf 29.7%
mul-1-neg29.7%
associate-*r/39.1%
distribute-lft-neg-out39.1%
*-commutative39.1%
Simplified39.1%
Final simplification32.8%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z) :precision binary64 (if (<= x -3.4e+32) (* x (/ y (* z z))) (* y (/ x (* z z)))))
assert(x < y);
double code(double x, double y, double z) {
double tmp;
if (x <= -3.4e+32) {
tmp = x * (y / (z * z));
} else {
tmp = y * (x / (z * z));
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (x <= (-3.4d+32)) then
tmp = x * (y / (z * z))
else
tmp = y * (x / (z * z))
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z) {
double tmp;
if (x <= -3.4e+32) {
tmp = x * (y / (z * z));
} else {
tmp = y * (x / (z * z));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z): tmp = 0 if x <= -3.4e+32: tmp = x * (y / (z * z)) else: tmp = y * (x / (z * z)) return tmp
x, y = sort([x, y]) function code(x, y, z) tmp = 0.0 if (x <= -3.4e+32) tmp = Float64(x * Float64(y / Float64(z * 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 (x <= -3.4e+32)
tmp = x * (y / (z * z));
else
tmp = y * (x / (z * z));
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_] := If[LessEqual[x, -3.4e+32], N[(x * N[(y / N[(z * z), $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}\;x \leq -3.4 \cdot 10^{+32}:\\
\;\;\;\;x \cdot \frac{y}{z \cdot z}\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{x}{z \cdot z}\\
\end{array}
\end{array}
if x < -3.39999999999999979e32Initial program 79.3%
associate-*l*79.3%
times-frac85.0%
distribute-lft-in85.0%
fma-def85.0%
*-rgt-identity85.0%
Simplified85.0%
*-commutative85.0%
associate-*l/83.2%
fma-udef83.2%
distribute-lft1-in83.2%
frac-times89.9%
clear-num89.9%
frac-times91.5%
*-un-lft-identity91.5%
Applied egg-rr91.5%
Taylor expanded in z around 0 59.0%
unpow259.0%
associate-/l*57.2%
associate-*r/53.8%
associate-/l/52.8%
rem-square-sqrt27.3%
associate-*l/27.3%
associate-*r/27.3%
associate-/r/30.8%
*-commutative30.8%
associate-*l*35.8%
associate-*r/35.8%
associate-*l/35.9%
rem-square-sqrt63.0%
associate-/l/68.0%
Simplified68.0%
if -3.39999999999999979e32 < x Initial program 83.5%
times-frac87.5%
Simplified87.5%
Taylor expanded in z around 0 75.4%
Final simplification73.7%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z) :precision binary64 (if (<= x -2.25e+35) (* x (/ y (* z z))) (* (/ x z) (/ y z))))
assert(x < y);
double code(double x, double y, double z) {
double tmp;
if (x <= -2.25e+35) {
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 <= (-2.25d+35)) 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 <= -2.25e+35) {
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 <= -2.25e+35: 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 <= -2.25e+35) 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 <= -2.25e+35)
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, -2.25e+35], 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 -2.25 \cdot 10^{+35}:\\
\;\;\;\;x \cdot \frac{y}{z \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{z} \cdot \frac{y}{z}\\
\end{array}
\end{array}
if x < -2.2499999999999998e35Initial program 79.0%
associate-*l*79.0%
times-frac84.8%
distribute-lft-in84.8%
fma-def84.8%
*-rgt-identity84.8%
Simplified84.8%
*-commutative84.8%
associate-*l/82.9%
fma-udef82.9%
distribute-lft1-in82.9%
frac-times89.8%
clear-num89.7%
frac-times91.4%
*-un-lft-identity91.4%
Applied egg-rr91.4%
Taylor expanded in z around 0 60.0%
unpow260.0%
associate-/l*58.1%
associate-*r/54.6%
associate-/l/53.6%
rem-square-sqrt27.7%
associate-*l/27.7%
associate-*r/27.7%
associate-/r/31.3%
*-commutative31.3%
associate-*l*36.3%
associate-*r/36.4%
associate-*l/36.4%
rem-square-sqrt64.0%
associate-/l/69.1%
Simplified69.1%
if -2.2499999999999998e35 < x Initial program 83.5%
associate-*l*83.5%
times-frac97.0%
distribute-lft-in97.0%
fma-def97.0%
*-rgt-identity97.0%
Simplified97.0%
Taylor expanded in z around 0 72.3%
unpow272.3%
associate-/l/76.1%
associate-*r/80.5%
associate-*l/81.4%
Simplified81.4%
Final simplification78.7%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z) :precision binary64 (if (<= y 2.2e-57) (/ x (* z (/ z y))) (/ y (/ z (/ x z)))))
assert(x < y);
double code(double x, double y, double z) {
double tmp;
if (y <= 2.2e-57) {
tmp = x / (z * (z / y));
} else {
tmp = y / (z / (x / z));
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (y <= 2.2d-57) then
tmp = x / (z * (z / y))
else
tmp = y / (z / (x / z))
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z) {
double tmp;
if (y <= 2.2e-57) {
tmp = x / (z * (z / y));
} else {
tmp = y / (z / (x / z));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z): tmp = 0 if y <= 2.2e-57: tmp = x / (z * (z / y)) else: tmp = y / (z / (x / z)) return tmp
x, y = sort([x, y]) function code(x, y, z) tmp = 0.0 if (y <= 2.2e-57) tmp = Float64(x / Float64(z * Float64(z / y))); else tmp = Float64(y / Float64(z / Float64(x / z))); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z)
tmp = 0.0;
if (y <= 2.2e-57)
tmp = x / (z * (z / y));
else
tmp = y / (z / (x / z));
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_] := If[LessEqual[y, 2.2e-57], N[(x / N[(z * N[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y / N[(z / N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 2.2 \cdot 10^{-57}:\\
\;\;\;\;\frac{x}{z \cdot \frac{z}{y}}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{\frac{z}{\frac{x}{z}}}\\
\end{array}
\end{array}
if y < 2.19999999999999999e-57Initial program 84.1%
/-rgt-identity84.1%
associate-/l*84.1%
associate-/l/88.6%
associate-*l*89.1%
associate-*r/89.1%
*-rgt-identity89.1%
associate-*l*93.4%
associate-*r/92.9%
distribute-lft-in92.9%
fma-def92.9%
*-rgt-identity92.9%
Simplified92.9%
Taylor expanded in z around 0 76.5%
if 2.19999999999999999e-57 < y Initial program 78.9%
associate-*l*78.9%
times-frac92.6%
distribute-lft-in92.6%
fma-def92.6%
*-rgt-identity92.6%
Simplified92.6%
Taylor expanded in z around 0 67.9%
unpow267.9%
associate-/l*73.2%
associate-/l*77.9%
Simplified77.9%
Final simplification76.9%
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 82.5%
associate-*l*82.5%
times-frac94.3%
distribute-lft-in94.3%
fma-def94.3%
*-rgt-identity94.3%
Simplified94.3%
*-commutative94.3%
associate-*l/92.5%
fma-udef92.5%
distribute-lft1-in92.5%
frac-times93.6%
clear-num93.5%
frac-times97.2%
*-un-lft-identity97.2%
Applied egg-rr97.2%
Taylor expanded in z around 0 69.6%
unpow269.6%
associate-/l*71.6%
associate-*r/75.4%
associate-/l/74.6%
rem-square-sqrt36.9%
associate-*l/36.9%
associate-*r/37.6%
associate-/r/38.4%
*-commutative38.4%
associate-*l*35.5%
associate-*r/35.5%
associate-*l/35.5%
rem-square-sqrt71.4%
associate-/l/72.1%
Simplified72.1%
Final simplification72.1%
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(Float64(x / z) * Float64(-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[(N[(x / z), $MachinePrecision] * (-y)), $MachinePrecision]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\frac{x}{z} \cdot \left(-y\right)
\end{array}
Initial program 82.5%
associate-*l*82.5%
times-frac94.3%
distribute-lft-in94.3%
fma-def94.3%
*-rgt-identity94.3%
Simplified94.3%
Taylor expanded in z around 0 66.2%
neg-mul-166.2%
+-commutative66.2%
unsub-neg66.2%
Simplified66.2%
Taylor expanded in z around inf 24.4%
mul-1-neg24.4%
associate-*r/32.4%
distribute-lft-neg-out32.4%
*-commutative32.4%
Simplified32.4%
Final simplification32.4%
(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 2023224
(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))))