
(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 (/ (/ (/ y z) (/ z x)) (+ z 1.0)))
assert(x < y);
double code(double x, double y, double z) {
return ((y / z) / (z / x)) / (z + 1.0);
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = ((y / z) / (z / x)) / (z + 1.0d0)
end function
assert x < y;
public static double code(double x, double y, double z) {
return ((y / z) / (z / x)) / (z + 1.0);
}
[x, y] = sort([x, y]) def code(x, y, z): return ((y / z) / (z / x)) / (z + 1.0)
x, y = sort([x, y]) function code(x, y, z) return Float64(Float64(Float64(y / z) / Float64(z / x)) / Float64(z + 1.0)) end
x, y = num2cell(sort([x, y])){:}
function tmp = code(x, y, z)
tmp = ((y / z) / (z / x)) / (z + 1.0);
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_] := N[(N[(N[(y / z), $MachinePrecision] / N[(z / x), $MachinePrecision]), $MachinePrecision] / N[(z + 1.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\frac{\frac{\frac{y}{z}}{\frac{z}{x}}}{z + 1}
\end{array}
Initial program 81.4%
associate-*l*81.4%
times-frac94.6%
associate-/r*97.3%
associate-*r/98.6%
Simplified98.6%
Taylor expanded in x around 0 83.2%
unpow283.2%
associate-/r*87.9%
associate-*r/96.5%
*-commutative96.5%
associate-*l/92.5%
associate-/r/98.6%
Simplified98.6%
Final simplification98.6%
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.76))) (* (/ 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.76)) {
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.76d0))) 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.76)) {
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.76): 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.76)) 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.76)))
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.76]], $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.76\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.76000000000000001 < z Initial program 82.1%
*-commutative82.1%
sqr-neg82.1%
times-frac91.9%
sqr-neg91.9%
Simplified91.9%
Taylor expanded in z around inf 90.0%
if -1 < z < 0.76000000000000001Initial program 80.8%
associate-*l*80.8%
times-frac97.4%
associate-/r*97.4%
associate-*r/97.4%
Simplified97.4%
Taylor expanded in x around 0 80.8%
unpow280.8%
associate-/r*88.6%
associate-*r/96.1%
*-commutative96.1%
associate-*l/87.7%
associate-/r/97.5%
Simplified97.5%
Taylor expanded in z around 0 68.4%
+-commutative68.4%
unpow268.4%
associate-/l*66.0%
*-rgt-identity66.0%
associate-*r/64.8%
mul-1-neg64.8%
associate-*l/62.6%
fma-def62.6%
associate-/r/62.2%
associate-*l/62.6%
*-lft-identity62.6%
associate-/r*73.0%
fma-neg73.0%
associate-*r/81.3%
associate-*l/82.7%
distribute-lft-out--94.7%
Simplified94.7%
Final simplification92.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.76))) (* (/ x z) (/ y (* z z))) (/ (* x (- (/ y z) y)) z)))
assert(x < y);
double code(double x, double y, double z) {
double tmp;
if ((z <= -1.0) || !(z <= 0.76)) {
tmp = (x / z) * (y / (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.0d0)) .or. (.not. (z <= 0.76d0))) then
tmp = (x / z) * (y / (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.0) || !(z <= 0.76)) {
tmp = (x / z) * (y / (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.0) or not (z <= 0.76): tmp = (x / z) * (y / (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.0) || !(z <= 0.76)) tmp = Float64(Float64(x / z) * Float64(y / 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.0) || ~((z <= 0.76)))
tmp = (x / z) * (y / (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.0], N[Not[LessEqual[z, 0.76]], $MachinePrecision]], N[(N[(x / z), $MachinePrecision] * N[(y / 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 \lor \neg \left(z \leq 0.76\right):\\
\;\;\;\;\frac{x}{z} \cdot \frac{y}{z \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot \left(\frac{y}{z} - y\right)}{z}\\
\end{array}
\end{array}
if z < -1 or 0.76000000000000001 < z Initial program 82.1%
*-commutative82.1%
sqr-neg82.1%
times-frac91.9%
sqr-neg91.9%
Simplified91.9%
Taylor expanded in z around inf 90.0%
if -1 < z < 0.76000000000000001Initial program 80.8%
associate-*l*80.8%
times-frac97.4%
associate-/r*97.4%
associate-*r/97.4%
Simplified97.4%
Taylor expanded in z around 0 68.4%
+-commutative68.4%
unpow268.4%
times-frac84.8%
mul-1-neg84.8%
associate-*l/82.7%
distribute-rgt-neg-in82.7%
distribute-lft-out94.7%
Simplified94.7%
Taylor expanded in x around 0 93.3%
Final simplification91.6%
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.76))) (/ (/ x z) (* z (/ z y))) (/ (* x (- (/ y z) y)) z)))
assert(x < y);
double code(double x, double y, double z) {
double tmp;
if ((z <= -1.0) || !(z <= 0.76)) {
tmp = (x / z) / (z * (z / y));
} 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.0d0)) .or. (.not. (z <= 0.76d0))) then
tmp = (x / z) / (z * (z / y))
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.0) || !(z <= 0.76)) {
tmp = (x / z) / (z * (z / y));
} else {
tmp = (x * ((y / z) - y)) / z;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z): tmp = 0 if (z <= -1.0) or not (z <= 0.76): tmp = (x / z) / (z * (z / y)) 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.0) || !(z <= 0.76)) tmp = Float64(Float64(x / z) / Float64(z * Float64(z / y))); 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.0) || ~((z <= 0.76)))
tmp = (x / z) / (z * (z / y));
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.0], N[Not[LessEqual[z, 0.76]], $MachinePrecision]], N[(N[(x / z), $MachinePrecision] / N[(z * N[(z / y), $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 \lor \neg \left(z \leq 0.76\right):\\
\;\;\;\;\frac{\frac{x}{z}}{z \cdot \frac{z}{y}}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot \left(\frac{y}{z} - y\right)}{z}\\
\end{array}
\end{array}
if z < -1 or 0.76000000000000001 < z Initial program 82.1%
*-commutative82.1%
sqr-neg82.1%
times-frac91.9%
sqr-neg91.9%
Simplified91.9%
frac-times82.1%
*-commutative82.1%
associate-/r*85.5%
frac-times99.7%
associate-/l*97.0%
div-inv96.9%
clear-num97.0%
Applied egg-rr97.0%
Taylor expanded in z around inf 90.0%
unpow290.0%
associate-*r/95.1%
Simplified95.1%
if -1 < z < 0.76000000000000001Initial program 80.8%
associate-*l*80.8%
times-frac97.4%
associate-/r*97.4%
associate-*r/97.4%
Simplified97.4%
Taylor expanded in z around 0 68.4%
+-commutative68.4%
unpow268.4%
times-frac84.8%
mul-1-neg84.8%
associate-*l/82.7%
distribute-rgt-neg-in82.7%
distribute-lft-out94.7%
Simplified94.7%
Taylor expanded in x around 0 93.3%
Final simplification94.2%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z) :precision binary64 (if (<= z -1e-25) (* (/ y (* z z)) (/ x (+ z 1.0))) (if (<= z 0.76) (/ (* x (- (/ y z) y)) z) (/ (/ x z) (* z (/ z y))))))
assert(x < y);
double code(double x, double y, double z) {
double tmp;
if (z <= -1e-25) {
tmp = (y / (z * z)) * (x / (z + 1.0));
} else if (z <= 0.76) {
tmp = (x * ((y / z) - y)) / z;
} else {
tmp = (x / z) / (z * (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-25)) then
tmp = (y / (z * z)) * (x / (z + 1.0d0))
else if (z <= 0.76d0) then
tmp = (x * ((y / z) - y)) / z
else
tmp = (x / z) / (z * (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-25) {
tmp = (y / (z * z)) * (x / (z + 1.0));
} else if (z <= 0.76) {
tmp = (x * ((y / z) - y)) / z;
} else {
tmp = (x / z) / (z * (z / y));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z): tmp = 0 if z <= -1e-25: tmp = (y / (z * z)) * (x / (z + 1.0)) elif z <= 0.76: tmp = (x * ((y / z) - y)) / z else: tmp = (x / z) / (z * (z / y)) return tmp
x, y = sort([x, y]) function code(x, y, z) tmp = 0.0 if (z <= -1e-25) tmp = Float64(Float64(y / Float64(z * z)) * Float64(x / Float64(z + 1.0))); elseif (z <= 0.76) tmp = Float64(Float64(x * Float64(Float64(y / z) - y)) / z); else tmp = Float64(Float64(x / z) / Float64(z * 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-25)
tmp = (y / (z * z)) * (x / (z + 1.0));
elseif (z <= 0.76)
tmp = (x * ((y / z) - y)) / z;
else
tmp = (x / z) / (z * (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-25], N[(N[(y / N[(z * z), $MachinePrecision]), $MachinePrecision] * N[(x / N[(z + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 0.76], N[(N[(x * N[(N[(y / z), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], N[(N[(x / z), $MachinePrecision] / N[(z * N[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1 \cdot 10^{-25}:\\
\;\;\;\;\frac{y}{z \cdot z} \cdot \frac{x}{z + 1}\\
\mathbf{elif}\;z \leq 0.76:\\
\;\;\;\;\frac{x \cdot \left(\frac{y}{z} - y\right)}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{z}}{z \cdot \frac{z}{y}}\\
\end{array}
\end{array}
if z < -1.00000000000000004e-25Initial program 80.1%
*-commutative80.1%
sqr-neg80.1%
times-frac92.0%
sqr-neg92.0%
Simplified92.0%
if -1.00000000000000004e-25 < z < 0.76000000000000001Initial program 80.2%
associate-*l*80.2%
times-frac97.3%
associate-/r*97.3%
associate-*r/97.3%
Simplified97.3%
Taylor expanded in z around 0 68.4%
+-commutative68.4%
unpow268.4%
times-frac85.4%
mul-1-neg85.4%
associate-*l/82.8%
distribute-rgt-neg-in82.8%
distribute-lft-out95.8%
Simplified95.8%
Taylor expanded in x around 0 95.0%
if 0.76000000000000001 < z Initial program 85.2%
*-commutative85.2%
sqr-neg85.2%
times-frac92.7%
sqr-neg92.7%
Simplified92.7%
frac-times85.2%
*-commutative85.2%
associate-/r*86.4%
frac-times99.8%
associate-/l*98.4%
div-inv98.4%
clear-num98.4%
Applied egg-rr98.4%
Taylor expanded in z around inf 92.0%
unpow292.0%
associate-*r/97.7%
Simplified97.7%
Final simplification94.8%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z) :precision binary64 (if (or (<= z -4e+52) (not (<= z 5e+56))) (* y (/ x (* z z))) (* (/ y z) (/ x z))))
assert(x < y);
double code(double x, double y, double z) {
double tmp;
if ((z <= -4e+52) || !(z <= 5e+56)) {
tmp = y * (x / (z * z));
} else {
tmp = (y / z) * (x / z);
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if ((z <= (-4d+52)) .or. (.not. (z <= 5d+56))) then
tmp = y * (x / (z * z))
else
tmp = (y / z) * (x / z)
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -4e+52) || !(z <= 5e+56)) {
tmp = y * (x / (z * z));
} else {
tmp = (y / z) * (x / z);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z): tmp = 0 if (z <= -4e+52) or not (z <= 5e+56): tmp = y * (x / (z * z)) else: tmp = (y / z) * (x / z) return tmp
x, y = sort([x, y]) function code(x, y, z) tmp = 0.0 if ((z <= -4e+52) || !(z <= 5e+56)) tmp = Float64(y * Float64(x / Float64(z * z))); else tmp = Float64(Float64(y / z) * Float64(x / z)); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z)
tmp = 0.0;
if ((z <= -4e+52) || ~((z <= 5e+56)))
tmp = y * (x / (z * z));
else
tmp = (y / z) * (x / z);
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_] := If[Or[LessEqual[z, -4e+52], N[Not[LessEqual[z, 5e+56]], $MachinePrecision]], N[(y * N[(x / N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y / z), $MachinePrecision] * N[(x / z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4 \cdot 10^{+52} \lor \neg \left(z \leq 5 \cdot 10^{+56}\right):\\
\;\;\;\;y \cdot \frac{x}{z \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{z} \cdot \frac{x}{z}\\
\end{array}
\end{array}
if z < -4e52 or 5.00000000000000024e56 < z Initial program 79.7%
*-commutative79.7%
associate-*r/84.0%
sqr-neg84.0%
associate-*l*84.0%
associate-*l*84.0%
sqr-neg84.0%
associate-*l*84.0%
distribute-lft-in84.0%
fma-def84.0%
*-rgt-identity84.0%
Simplified84.0%
Taylor expanded in z around 0 73.0%
unpow273.0%
Simplified73.0%
if -4e52 < z < 5.00000000000000024e56Initial program 82.6%
associate-*l*82.6%
times-frac97.2%
associate-/r*97.2%
associate-*r/97.8%
Simplified97.8%
Taylor expanded in z around 0 58.7%
+-commutative58.7%
unpow258.7%
times-frac72.4%
mul-1-neg72.4%
associate-*l/70.6%
distribute-rgt-neg-in70.6%
distribute-lft-out80.6%
Simplified80.6%
Taylor expanded in z around 0 81.4%
Final simplification77.9%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z) :precision binary64 (if (<= z -4e+52) (* y (/ x (* z z))) (if (<= z 1.35e-40) (* (/ y z) (/ x z)) (* x (/ y (* z z))))))
assert(x < y);
double code(double x, double y, double z) {
double tmp;
if (z <= -4e+52) {
tmp = y * (x / (z * z));
} else if (z <= 1.35e-40) {
tmp = (y / z) * (x / z);
} else {
tmp = x * (y / (z * z));
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (z <= (-4d+52)) then
tmp = y * (x / (z * z))
else if (z <= 1.35d-40) then
tmp = (y / z) * (x / z)
else
tmp = x * (y / (z * z))
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z) {
double tmp;
if (z <= -4e+52) {
tmp = y * (x / (z * z));
} else if (z <= 1.35e-40) {
tmp = (y / z) * (x / z);
} else {
tmp = x * (y / (z * z));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z): tmp = 0 if z <= -4e+52: tmp = y * (x / (z * z)) elif z <= 1.35e-40: tmp = (y / z) * (x / z) else: tmp = x * (y / (z * z)) return tmp
x, y = sort([x, y]) function code(x, y, z) tmp = 0.0 if (z <= -4e+52) tmp = Float64(y * Float64(x / Float64(z * z))); elseif (z <= 1.35e-40) tmp = Float64(Float64(y / z) * Float64(x / z)); else tmp = Float64(x * Float64(y / Float64(z * z))); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z)
tmp = 0.0;
if (z <= -4e+52)
tmp = y * (x / (z * z));
elseif (z <= 1.35e-40)
tmp = (y / z) * (x / z);
else
tmp = x * (y / (z * z));
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_] := If[LessEqual[z, -4e+52], N[(y * N[(x / N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.35e-40], N[(N[(y / z), $MachinePrecision] * N[(x / z), $MachinePrecision]), $MachinePrecision], N[(x * N[(y / N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4 \cdot 10^{+52}:\\
\;\;\;\;y \cdot \frac{x}{z \cdot z}\\
\mathbf{elif}\;z \leq 1.35 \cdot 10^{-40}:\\
\;\;\;\;\frac{y}{z} \cdot \frac{x}{z}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{y}{z \cdot z}\\
\end{array}
\end{array}
if z < -4e52Initial program 76.4%
*-commutative76.4%
associate-*r/79.0%
sqr-neg79.0%
associate-*l*79.0%
associate-*l*79.0%
sqr-neg79.0%
associate-*l*79.0%
distribute-lft-in79.0%
fma-def79.0%
*-rgt-identity79.0%
Simplified79.0%
Taylor expanded in z around 0 67.1%
unpow267.1%
Simplified67.1%
if -4e52 < z < 1.35e-40Initial program 80.5%
associate-*l*80.5%
times-frac97.5%
associate-/r*97.5%
associate-*r/98.2%
Simplified98.2%
Taylor expanded in z around 0 60.9%
+-commutative60.9%
unpow260.9%
times-frac77.0%
mul-1-neg77.0%
associate-*l/74.9%
distribute-rgt-neg-in74.9%
distribute-lft-out86.5%
Simplified86.5%
Taylor expanded in z around 0 86.6%
if 1.35e-40 < z Initial program 86.3%
*-commutative86.3%
sqr-neg86.3%
times-frac92.3%
sqr-neg92.3%
Simplified92.3%
Taylor expanded in z around 0 70.1%
Final simplification77.9%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z) :precision binary64 (if (<= z -4e+52) (* y (/ x (* z z))) (if (<= z 7.4e-41) (* (/ y z) (/ x z)) (/ x (/ (* z z) y)))))
assert(x < y);
double code(double x, double y, double z) {
double tmp;
if (z <= -4e+52) {
tmp = y * (x / (z * z));
} else if (z <= 7.4e-41) {
tmp = (y / z) * (x / z);
} else {
tmp = x / ((z * 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 <= (-4d+52)) then
tmp = y * (x / (z * z))
else if (z <= 7.4d-41) then
tmp = (y / z) * (x / z)
else
tmp = x / ((z * 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 <= -4e+52) {
tmp = y * (x / (z * z));
} else if (z <= 7.4e-41) {
tmp = (y / z) * (x / z);
} else {
tmp = x / ((z * z) / y);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z): tmp = 0 if z <= -4e+52: tmp = y * (x / (z * z)) elif z <= 7.4e-41: tmp = (y / z) * (x / z) else: tmp = x / ((z * z) / y) return tmp
x, y = sort([x, y]) function code(x, y, z) tmp = 0.0 if (z <= -4e+52) tmp = Float64(y * Float64(x / Float64(z * z))); elseif (z <= 7.4e-41) tmp = Float64(Float64(y / z) * Float64(x / z)); else tmp = Float64(x / Float64(Float64(z * z) / y)); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z)
tmp = 0.0;
if (z <= -4e+52)
tmp = y * (x / (z * z));
elseif (z <= 7.4e-41)
tmp = (y / z) * (x / z);
else
tmp = x / ((z * 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, -4e+52], N[(y * N[(x / N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 7.4e-41], N[(N[(y / z), $MachinePrecision] * N[(x / z), $MachinePrecision]), $MachinePrecision], N[(x / N[(N[(z * z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4 \cdot 10^{+52}:\\
\;\;\;\;y \cdot \frac{x}{z \cdot z}\\
\mathbf{elif}\;z \leq 7.4 \cdot 10^{-41}:\\
\;\;\;\;\frac{y}{z} \cdot \frac{x}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\frac{z \cdot z}{y}}\\
\end{array}
\end{array}
if z < -4e52Initial program 76.4%
*-commutative76.4%
associate-*r/79.0%
sqr-neg79.0%
associate-*l*79.0%
associate-*l*79.0%
sqr-neg79.0%
associate-*l*79.0%
distribute-lft-in79.0%
fma-def79.0%
*-rgt-identity79.0%
Simplified79.0%
Taylor expanded in z around 0 67.1%
unpow267.1%
Simplified67.1%
if -4e52 < z < 7.4000000000000004e-41Initial program 80.5%
associate-*l*80.5%
times-frac97.5%
associate-/r*97.5%
associate-*r/98.2%
Simplified98.2%
Taylor expanded in z around 0 60.9%
+-commutative60.9%
unpow260.9%
times-frac77.0%
mul-1-neg77.0%
associate-*l/74.9%
distribute-rgt-neg-in74.9%
distribute-lft-out86.5%
Simplified86.5%
Taylor expanded in z around 0 86.6%
if 7.4000000000000004e-41 < z Initial program 86.3%
*-commutative86.3%
associate-*r/91.3%
sqr-neg91.3%
associate-*l*91.3%
associate-*l*91.3%
sqr-neg91.3%
associate-*l*91.3%
distribute-lft-in91.3%
fma-def91.3%
*-rgt-identity91.3%
Simplified91.3%
Taylor expanded in z around 0 71.3%
unpow271.3%
Simplified71.3%
associate-*r/66.4%
*-commutative66.4%
associate-/l*70.1%
Applied egg-rr70.1%
Final simplification77.9%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z) :precision binary64 (/ (* (/ y z) (/ x z)) (+ z 1.0)))
assert(x < y);
double code(double x, double y, double z) {
return ((y / z) * (x / z)) / (z + 1.0);
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = ((y / z) * (x / z)) / (z + 1.0d0)
end function
assert x < y;
public static double code(double x, double y, double z) {
return ((y / z) * (x / z)) / (z + 1.0);
}
[x, y] = sort([x, y]) def code(x, y, z): return ((y / z) * (x / z)) / (z + 1.0)
x, y = sort([x, y]) function code(x, y, z) return Float64(Float64(Float64(y / z) * Float64(x / z)) / Float64(z + 1.0)) end
x, y = num2cell(sort([x, y])){:}
function tmp = code(x, y, z)
tmp = ((y / z) * (x / z)) / (z + 1.0);
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_] := N[(N[(N[(y / z), $MachinePrecision] * N[(x / z), $MachinePrecision]), $MachinePrecision] / N[(z + 1.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\frac{\frac{y}{z} \cdot \frac{x}{z}}{z + 1}
\end{array}
Initial program 81.4%
associate-*l*81.4%
times-frac94.6%
associate-/r*97.3%
associate-*r/98.6%
Simplified98.6%
Final simplification98.6%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z) :precision binary64 (if (<= x -2.2e+62) (/ x (* z (/ z y))) (/ y (* z (/ z x)))))
assert(x < y);
double code(double x, double y, double z) {
double tmp;
if (x <= -2.2e+62) {
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.2d+62)) 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.2e+62) {
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.2e+62: 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.2e+62) 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.2e+62)
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.2e+62], 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.2 \cdot 10^{+62}:\\
\;\;\;\;\frac{x}{z \cdot \frac{z}{y}}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{z \cdot \frac{z}{x}}\\
\end{array}
\end{array}
if x < -2.20000000000000015e62Initial program 77.9%
*-commutative77.9%
associate-*r/90.1%
sqr-neg90.1%
associate-*l*90.1%
associate-*l*90.1%
sqr-neg90.1%
associate-*l*90.1%
distribute-lft-in90.1%
fma-def90.1%
*-rgt-identity90.1%
Simplified90.1%
Taylor expanded in z around 0 64.9%
unpow264.9%
Simplified64.9%
associate-*r/59.6%
frac-times53.0%
clear-num53.0%
frac-times67.1%
*-un-lft-identity67.1%
Applied egg-rr67.1%
if -2.20000000000000015e62 < x Initial program 82.1%
*-commutative82.1%
associate-*r/81.5%
sqr-neg81.5%
associate-*l*81.5%
associate-*l*81.5%
sqr-neg81.5%
associate-*l*81.5%
distribute-lft-in81.5%
fma-def81.5%
*-rgt-identity81.5%
Simplified81.5%
Taylor expanded in z around 0 70.0%
unpow270.0%
Simplified70.0%
associate-*r/68.4%
frac-times74.2%
clear-num74.2%
div-inv74.2%
associate-/l/76.6%
Applied egg-rr76.6%
Final simplification75.1%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z) :precision binary64 (if (<= z -2e-310) (* x (- (/ y z))) (* y (/ x z))))
assert(x < y);
double code(double x, double y, double z) {
double tmp;
if (z <= -2e-310) {
tmp = x * -(y / z);
} else {
tmp = y * (x / z);
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (z <= (-2d-310)) then
tmp = x * -(y / z)
else
tmp = y * (x / z)
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z) {
double tmp;
if (z <= -2e-310) {
tmp = x * -(y / z);
} else {
tmp = y * (x / z);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z): tmp = 0 if z <= -2e-310: tmp = x * -(y / z) else: tmp = y * (x / z) return tmp
x, y = sort([x, y]) function code(x, y, z) tmp = 0.0 if (z <= -2e-310) tmp = Float64(x * Float64(-Float64(y / z))); else tmp = Float64(y * Float64(x / z)); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z)
tmp = 0.0;
if (z <= -2e-310)
tmp = x * -(y / z);
else
tmp = y * (x / z);
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_] := If[LessEqual[z, -2e-310], N[(x * (-N[(y / z), $MachinePrecision])), $MachinePrecision], N[(y * N[(x / z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2 \cdot 10^{-310}:\\
\;\;\;\;x \cdot \left(-\frac{y}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{x}{z}\\
\end{array}
\end{array}
if z < -1.999999999999994e-310Initial program 80.1%
associate-*l*80.1%
times-frac94.6%
associate-/r*96.8%
associate-*r/98.9%
Simplified98.9%
Taylor expanded in z around 0 51.5%
+-commutative51.5%
unpow251.5%
times-frac59.6%
mul-1-neg59.6%
associate-*l/62.8%
distribute-rgt-neg-in62.8%
distribute-lft-out62.8%
Simplified62.8%
Taylor expanded in z around inf 31.3%
mul-1-neg31.3%
associate-*l/36.5%
associate-*l/31.3%
associate-*r/36.5%
distribute-rgt-neg-in36.5%
Simplified36.5%
if -1.999999999999994e-310 < z Initial program 82.8%
associate-*l*82.8%
times-frac94.6%
associate-/r*97.7%
associate-*r/98.3%
Simplified98.3%
Taylor expanded in z around 0 44.0%
+-commutative44.0%
unpow244.0%
times-frac52.0%
mul-1-neg52.0%
associate-*l/54.4%
distribute-rgt-neg-in54.4%
distribute-lft-out66.2%
Simplified66.2%
Taylor expanded in z around inf 18.0%
mul-1-neg18.0%
associate-*l/22.8%
associate-*l/18.0%
associate-*r/18.7%
distribute-rgt-neg-in18.7%
Simplified18.7%
expm1-log1p-u18.6%
expm1-udef33.3%
add-sqr-sqrt20.4%
sqrt-unprod41.0%
sqr-neg41.0%
sqrt-unprod24.7%
add-sqr-sqrt43.2%
Applied egg-rr43.2%
expm1-def29.3%
expm1-log1p33.6%
associate-*r/30.6%
associate-*l/37.6%
*-commutative37.6%
Simplified37.6%
Final simplification37.1%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z) :precision binary64 (if (<= z -2e-310) (* y (/ (- x) z)) (* y (/ x z))))
assert(x < y);
double code(double x, double y, double z) {
double tmp;
if (z <= -2e-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 <= (-2d-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 <= -2e-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 <= -2e-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 <= -2e-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 <= -2e-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, -2e-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 -2 \cdot 10^{-310}:\\
\;\;\;\;y \cdot \frac{-x}{z}\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{x}{z}\\
\end{array}
\end{array}
if z < -1.999999999999994e-310Initial program 80.1%
associate-*l*80.1%
times-frac94.6%
associate-/r*96.8%
associate-*r/98.9%
Simplified98.9%
Taylor expanded in z around 0 51.5%
+-commutative51.5%
unpow251.5%
times-frac59.6%
mul-1-neg59.6%
associate-*l/62.8%
distribute-rgt-neg-in62.8%
distribute-lft-out62.8%
Simplified62.8%
Taylor expanded in z around inf 36.5%
mul-1-neg36.5%
Simplified36.5%
if -1.999999999999994e-310 < z Initial program 82.8%
associate-*l*82.8%
times-frac94.6%
associate-/r*97.7%
associate-*r/98.3%
Simplified98.3%
Taylor expanded in z around 0 44.0%
+-commutative44.0%
unpow244.0%
times-frac52.0%
mul-1-neg52.0%
associate-*l/54.4%
distribute-rgt-neg-in54.4%
distribute-lft-out66.2%
Simplified66.2%
Taylor expanded in z around inf 18.0%
mul-1-neg18.0%
associate-*l/22.8%
associate-*l/18.0%
associate-*r/18.7%
distribute-rgt-neg-in18.7%
Simplified18.7%
expm1-log1p-u18.6%
expm1-udef33.3%
add-sqr-sqrt20.4%
sqrt-unprod41.0%
sqr-neg41.0%
sqrt-unprod24.7%
add-sqr-sqrt43.2%
Applied egg-rr43.2%
expm1-def29.3%
expm1-log1p33.6%
associate-*r/30.6%
associate-*l/37.6%
*-commutative37.6%
Simplified37.6%
Final simplification37.1%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z) :precision binary64 (if (<= z -2e-310) (/ (- x) (/ z y)) (* y (/ x z))))
assert(x < y);
double code(double x, double y, double z) {
double tmp;
if (z <= -2e-310) {
tmp = -x / (z / y);
} 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 <= (-2d-310)) then
tmp = -x / (z / y)
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 <= -2e-310) {
tmp = -x / (z / y);
} else {
tmp = y * (x / z);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z): tmp = 0 if z <= -2e-310: tmp = -x / (z / y) else: tmp = y * (x / z) return tmp
x, y = sort([x, y]) function code(x, y, z) tmp = 0.0 if (z <= -2e-310) tmp = Float64(Float64(-x) / Float64(z / y)); 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 <= -2e-310)
tmp = -x / (z / y);
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, -2e-310], N[((-x) / N[(z / y), $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 -2 \cdot 10^{-310}:\\
\;\;\;\;\frac{-x}{\frac{z}{y}}\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{x}{z}\\
\end{array}
\end{array}
if z < -1.999999999999994e-310Initial program 80.1%
associate-*l*80.1%
times-frac94.6%
associate-/r*96.8%
associate-*r/98.9%
Simplified98.9%
Taylor expanded in z around 0 51.5%
+-commutative51.5%
unpow251.5%
times-frac59.6%
mul-1-neg59.6%
associate-*l/62.8%
distribute-rgt-neg-in62.8%
distribute-lft-out62.8%
Simplified62.8%
Taylor expanded in z around inf 31.3%
mul-1-neg31.3%
associate-*l/36.5%
associate-*l/31.3%
associate-*r/36.5%
distribute-rgt-neg-in36.5%
Simplified36.5%
add-sqr-sqrt24.6%
sqrt-unprod32.0%
sqr-neg32.0%
sqrt-unprod13.2%
add-sqr-sqrt18.8%
clear-num19.6%
div-inv19.6%
frac-2neg19.6%
frac-2neg19.6%
add-sqr-sqrt19.6%
sqrt-unprod29.2%
sqr-neg29.2%
sqrt-unprod0.0%
add-sqr-sqrt36.5%
distribute-frac-neg36.5%
frac-2neg36.5%
Applied egg-rr36.5%
if -1.999999999999994e-310 < z Initial program 82.8%
associate-*l*82.8%
times-frac94.6%
associate-/r*97.7%
associate-*r/98.3%
Simplified98.3%
Taylor expanded in z around 0 44.0%
+-commutative44.0%
unpow244.0%
times-frac52.0%
mul-1-neg52.0%
associate-*l/54.4%
distribute-rgt-neg-in54.4%
distribute-lft-out66.2%
Simplified66.2%
Taylor expanded in z around inf 18.0%
mul-1-neg18.0%
associate-*l/22.8%
associate-*l/18.0%
associate-*r/18.7%
distribute-rgt-neg-in18.7%
Simplified18.7%
expm1-log1p-u18.6%
expm1-udef33.3%
add-sqr-sqrt20.4%
sqrt-unprod41.0%
sqr-neg41.0%
sqrt-unprod24.7%
add-sqr-sqrt43.2%
Applied egg-rr43.2%
expm1-def29.3%
expm1-log1p33.6%
associate-*r/30.6%
associate-*l/37.6%
*-commutative37.6%
Simplified37.6%
Final simplification37.1%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z) :precision binary64 (* y (/ x (* z z))))
assert(x < y);
double code(double x, double y, double z) {
return y * (x / (z * z));
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = y * (x / (z * z))
end function
assert x < y;
public static double code(double x, double y, double z) {
return y * (x / (z * z));
}
[x, y] = sort([x, y]) def code(x, y, z): return y * (x / (z * z))
x, y = sort([x, y]) function code(x, y, z) return Float64(y * Float64(x / Float64(z * z))) end
x, y = num2cell(sort([x, y])){:}
function tmp = code(x, y, z)
tmp = y * (x / (z * z));
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_] := N[(y * N[(x / N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
y \cdot \frac{x}{z \cdot z}
\end{array}
Initial program 81.4%
*-commutative81.4%
associate-*r/82.8%
sqr-neg82.8%
associate-*l*82.8%
associate-*l*82.8%
sqr-neg82.8%
associate-*l*82.8%
distribute-lft-in82.8%
fma-def82.8%
*-rgt-identity82.8%
Simplified82.8%
Taylor expanded in z around 0 69.2%
unpow269.2%
Simplified69.2%
Final simplification69.2%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z) :precision binary64 (* (/ y z) x))
assert(x < y);
double code(double x, double y, double z) {
return (y / z) * x;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = (y / z) * x
end function
assert x < y;
public static double code(double x, double y, double z) {
return (y / z) * x;
}
[x, y] = sort([x, y]) def code(x, y, z): return (y / z) * x
x, y = sort([x, y]) function code(x, y, z) return Float64(Float64(y / z) * x) end
x, y = num2cell(sort([x, y])){:}
function tmp = code(x, y, z)
tmp = (y / z) * x;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_] := N[(N[(y / z), $MachinePrecision] * x), $MachinePrecision]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\frac{y}{z} \cdot x
\end{array}
Initial program 81.4%
associate-*l*81.4%
times-frac94.6%
associate-/r*97.3%
associate-*r/98.6%
Simplified98.6%
Taylor expanded in z around 0 47.7%
+-commutative47.7%
unpow247.7%
times-frac55.8%
mul-1-neg55.8%
associate-*l/58.6%
distribute-rgt-neg-in58.6%
distribute-lft-out64.5%
Simplified64.5%
Taylor expanded in z around inf 24.7%
mul-1-neg24.7%
associate-*l/29.7%
associate-*l/24.7%
associate-*r/27.6%
distribute-rgt-neg-in27.6%
Simplified27.6%
expm1-log1p-u23.0%
expm1-udef35.8%
add-sqr-sqrt23.1%
sqrt-unprod38.5%
sqr-neg38.5%
sqrt-unprod22.2%
add-sqr-sqrt36.4%
Applied egg-rr36.4%
expm1-def23.8%
expm1-log1p26.2%
associate-*r/23.6%
associate-*l/28.6%
*-commutative28.6%
Simplified28.6%
Taylor expanded in y around 0 23.6%
associate-*r/26.2%
Simplified26.2%
Final simplification26.2%
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 81.4%
associate-*l*81.4%
times-frac94.6%
associate-/r*97.3%
associate-*r/98.6%
Simplified98.6%
Taylor expanded in z around 0 47.7%
+-commutative47.7%
unpow247.7%
times-frac55.8%
mul-1-neg55.8%
associate-*l/58.6%
distribute-rgt-neg-in58.6%
distribute-lft-out64.5%
Simplified64.5%
Taylor expanded in z around inf 24.7%
mul-1-neg24.7%
associate-*l/29.7%
associate-*l/24.7%
associate-*r/27.6%
distribute-rgt-neg-in27.6%
Simplified27.6%
expm1-log1p-u23.0%
expm1-udef35.8%
add-sqr-sqrt23.1%
sqrt-unprod38.5%
sqr-neg38.5%
sqrt-unprod22.2%
add-sqr-sqrt36.4%
Applied egg-rr36.4%
expm1-def23.8%
expm1-log1p26.2%
associate-*r/23.6%
associate-*l/28.6%
*-commutative28.6%
Simplified28.6%
Final simplification28.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 2023271
(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))))