
(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 19 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
(let* ((t_0 (* (+ z 1.0) (* z z))) (t_1 (/ (/ y z) (* z (/ z x)))))
(if (<= t_0 -2e+21)
t_1
(if (<= t_0 2e-238)
(/ (* (/ x z) y) z)
(if (<= t_0 5e+300) (/ (* x y) t_0) t_1)))))assert(x < y);
double code(double x, double y, double z) {
double t_0 = (z + 1.0) * (z * z);
double t_1 = (y / z) / (z * (z / x));
double tmp;
if (t_0 <= -2e+21) {
tmp = t_1;
} else if (t_0 <= 2e-238) {
tmp = ((x / z) * y) / z;
} else if (t_0 <= 5e+300) {
tmp = (x * y) / t_0;
} else {
tmp = t_1;
}
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) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = (z + 1.0d0) * (z * z)
t_1 = (y / z) / (z * (z / x))
if (t_0 <= (-2d+21)) then
tmp = t_1
else if (t_0 <= 2d-238) then
tmp = ((x / z) * y) / z
else if (t_0 <= 5d+300) then
tmp = (x * y) / t_0
else
tmp = t_1
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z) {
double t_0 = (z + 1.0) * (z * z);
double t_1 = (y / z) / (z * (z / x));
double tmp;
if (t_0 <= -2e+21) {
tmp = t_1;
} else if (t_0 <= 2e-238) {
tmp = ((x / z) * y) / z;
} else if (t_0 <= 5e+300) {
tmp = (x * y) / t_0;
} else {
tmp = t_1;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z): t_0 = (z + 1.0) * (z * z) t_1 = (y / z) / (z * (z / x)) tmp = 0 if t_0 <= -2e+21: tmp = t_1 elif t_0 <= 2e-238: tmp = ((x / z) * y) / z elif t_0 <= 5e+300: tmp = (x * y) / t_0 else: tmp = t_1 return tmp
x, y = sort([x, y]) function code(x, y, z) t_0 = Float64(Float64(z + 1.0) * Float64(z * z)) t_1 = Float64(Float64(y / z) / Float64(z * Float64(z / x))) tmp = 0.0 if (t_0 <= -2e+21) tmp = t_1; elseif (t_0 <= 2e-238) tmp = Float64(Float64(Float64(x / z) * y) / z); elseif (t_0 <= 5e+300) tmp = Float64(Float64(x * y) / t_0); else tmp = t_1; end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z)
t_0 = (z + 1.0) * (z * z);
t_1 = (y / z) / (z * (z / x));
tmp = 0.0;
if (t_0 <= -2e+21)
tmp = t_1;
elseif (t_0 <= 2e-238)
tmp = ((x / z) * y) / z;
elseif (t_0 <= 5e+300)
tmp = (x * y) / t_0;
else
tmp = t_1;
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(z + 1.0), $MachinePrecision] * N[(z * z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(y / z), $MachinePrecision] / N[(z * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -2e+21], t$95$1, If[LessEqual[t$95$0, 2e-238], N[(N[(N[(x / z), $MachinePrecision] * y), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[t$95$0, 5e+300], N[(N[(x * y), $MachinePrecision] / t$95$0), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_0 := \left(z + 1\right) \cdot \left(z \cdot z\right)\\
t_1 := \frac{\frac{y}{z}}{z \cdot \frac{z}{x}}\\
\mathbf{if}\;t_0 \leq -2 \cdot 10^{+21}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t_0 \leq 2 \cdot 10^{-238}:\\
\;\;\;\;\frac{\frac{x}{z} \cdot y}{z}\\
\mathbf{elif}\;t_0 \leq 5 \cdot 10^{+300}:\\
\;\;\;\;\frac{x \cdot y}{t_0}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if (*.f64 (*.f64 z z) (+.f64 z 1)) < -2e21 or 5.00000000000000026e300 < (*.f64 (*.f64 z z) (+.f64 z 1)) Initial program 87.9%
*-commutative87.9%
associate-*r/89.1%
sqr-neg89.1%
associate-*l*89.1%
associate-*l*89.1%
sqr-neg89.1%
associate-*l*89.1%
distribute-lft-in89.1%
fma-def89.1%
*-rgt-identity89.1%
Simplified89.1%
associate-*r/87.9%
*-commutative87.9%
associate-/r*93.2%
associate-*r/95.9%
fma-udef95.9%
distribute-lft1-in95.9%
frac-times99.4%
clear-num99.3%
frac-times96.6%
*-un-lft-identity96.6%
Applied egg-rr96.6%
Taylor expanded in z around inf 94.7%
unpow294.7%
associate-*r/96.0%
Simplified96.0%
if -2e21 < (*.f64 (*.f64 z z) (+.f64 z 1)) < 2e-238Initial program 75.0%
*-commutative75.0%
associate-*r/77.3%
sqr-neg77.3%
associate-*l*77.3%
associate-*l*77.3%
sqr-neg77.3%
associate-*l*77.3%
distribute-lft-in77.3%
fma-def77.3%
*-rgt-identity77.3%
Simplified77.3%
Taylor expanded in z around 0 77.3%
unpow277.3%
Simplified77.3%
*-commutative77.3%
associate-/r*91.5%
associate-/r/98.0%
div-inv97.5%
clear-num97.5%
associate-*r/97.8%
Applied egg-rr97.8%
if 2e-238 < (*.f64 (*.f64 z z) (+.f64 z 1)) < 5.00000000000000026e300Initial program 98.3%
Final simplification97.2%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y z)
:precision binary64
(if (<= z -1.0)
(/ (/ y z) (* z (/ z x)))
(if (<= z 3.4e-109)
(/ (* y (- (/ x z) x)) z)
(* (/ y (* z z)) (/ x (+ z 1.0))))))assert(x < y);
double code(double x, double y, double z) {
double tmp;
if (z <= -1.0) {
tmp = (y / z) / (z * (z / x));
} else if (z <= 3.4e-109) {
tmp = (y * ((x / z) - x)) / z;
} else {
tmp = (y / (z * z)) * (x / (z + 1.0));
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (z <= (-1.0d0)) then
tmp = (y / z) / (z * (z / x))
else if (z <= 3.4d-109) then
tmp = (y * ((x / z) - x)) / z
else
tmp = (y / (z * z)) * (x / (z + 1.0d0))
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z) {
double tmp;
if (z <= -1.0) {
tmp = (y / z) / (z * (z / x));
} else if (z <= 3.4e-109) {
tmp = (y * ((x / z) - x)) / z;
} else {
tmp = (y / (z * z)) * (x / (z + 1.0));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z): tmp = 0 if z <= -1.0: tmp = (y / z) / (z * (z / x)) elif z <= 3.4e-109: tmp = (y * ((x / z) - x)) / z else: tmp = (y / (z * z)) * (x / (z + 1.0)) return tmp
x, y = sort([x, y]) function code(x, y, z) tmp = 0.0 if (z <= -1.0) tmp = Float64(Float64(y / z) / Float64(z * Float64(z / x))); elseif (z <= 3.4e-109) tmp = Float64(Float64(y * Float64(Float64(x / z) - x)) / z); else tmp = Float64(Float64(y / Float64(z * z)) * Float64(x / Float64(z + 1.0))); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z)
tmp = 0.0;
if (z <= -1.0)
tmp = (y / z) / (z * (z / x));
elseif (z <= 3.4e-109)
tmp = (y * ((x / z) - x)) / z;
else
tmp = (y / (z * z)) * (x / (z + 1.0));
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_] := If[LessEqual[z, -1.0], N[(N[(y / z), $MachinePrecision] / N[(z * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.4e-109], N[(N[(y * N[(N[(x / z), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], N[(N[(y / N[(z * z), $MachinePrecision]), $MachinePrecision] * N[(x / N[(z + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1:\\
\;\;\;\;\frac{\frac{y}{z}}{z \cdot \frac{z}{x}}\\
\mathbf{elif}\;z \leq 3.4 \cdot 10^{-109}:\\
\;\;\;\;\frac{y \cdot \left(\frac{x}{z} - x\right)}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{z \cdot z} \cdot \frac{x}{z + 1}\\
\end{array}
\end{array}
if z < -1Initial program 89.7%
*-commutative89.7%
associate-*r/91.6%
sqr-neg91.6%
associate-*l*91.6%
associate-*l*91.6%
sqr-neg91.6%
associate-*l*91.6%
distribute-lft-in91.6%
fma-def91.6%
*-rgt-identity91.6%
Simplified91.6%
associate-*r/89.6%
*-commutative89.6%
associate-/r*92.6%
associate-*r/97.4%
fma-udef97.4%
distribute-lft1-in97.4%
frac-times99.0%
clear-num98.9%
frac-times97.1%
*-un-lft-identity97.1%
Applied egg-rr97.1%
Taylor expanded in z around inf 95.1%
unpow295.1%
associate-*r/96.1%
Simplified96.1%
if -1 < z < 3.40000000000000012e-109Initial program 82.2%
*-commutative82.2%
associate-*r/81.4%
sqr-neg81.4%
associate-*l*81.4%
associate-*l*81.4%
sqr-neg81.4%
associate-*l*81.4%
distribute-lft-in81.4%
fma-def81.4%
*-rgt-identity81.4%
Simplified81.4%
Taylor expanded in z around 0 67.3%
unpow267.3%
*-commutative67.3%
times-frac80.8%
mul-1-neg80.8%
*-commutative80.8%
associate-*r/77.1%
distribute-lft-neg-in77.1%
distribute-rgt-out95.1%
Simplified95.1%
Taylor expanded in y around 0 96.8%
if 3.40000000000000012e-109 < z Initial program 90.7%
*-commutative90.7%
sqr-neg90.7%
times-frac96.7%
sqr-neg96.7%
Simplified96.7%
Final simplification96.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 1.0))) (* (/ x z) (/ y (* z z))) (/ (* (/ x z) y) z)))
assert(x < y);
double code(double x, double y, double z) {
double tmp;
if ((z <= -1.0) || !(z <= 1.0)) {
tmp = (x / z) * (y / (z * z));
} else {
tmp = ((x / z) * y) / z;
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if ((z <= (-1.0d0)) .or. (.not. (z <= 1.0d0))) then
tmp = (x / z) * (y / (z * z))
else
tmp = ((x / z) * y) / z
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -1.0) || !(z <= 1.0)) {
tmp = (x / z) * (y / (z * z));
} else {
tmp = ((x / z) * y) / z;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z): tmp = 0 if (z <= -1.0) or not (z <= 1.0): tmp = (x / z) * (y / (z * z)) else: tmp = ((x / z) * y) / z return tmp
x, y = sort([x, y]) function code(x, y, z) tmp = 0.0 if ((z <= -1.0) || !(z <= 1.0)) tmp = Float64(Float64(x / z) * Float64(y / Float64(z * z))); else tmp = Float64(Float64(Float64(x / 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 <= 1.0)))
tmp = (x / z) * (y / (z * z));
else
tmp = ((x / z) * y) / z;
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_] := If[Or[LessEqual[z, -1.0], N[Not[LessEqual[z, 1.0]], $MachinePrecision]], N[(N[(x / z), $MachinePrecision] * N[(y / N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x / z), $MachinePrecision] * y), $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{\frac{x}{z} \cdot y}{z}\\
\end{array}
\end{array}
if z < -1 or 1 < z Initial program 89.5%
*-commutative89.5%
sqr-neg89.5%
times-frac97.3%
sqr-neg97.3%
Simplified97.3%
Taylor expanded in z around inf 96.2%
if -1 < z < 1Initial program 84.2%
*-commutative84.2%
associate-*r/83.4%
sqr-neg83.4%
associate-*l*83.4%
associate-*l*83.4%
sqr-neg83.4%
associate-*l*83.4%
distribute-lft-in83.4%
fma-def83.4%
*-rgt-identity83.4%
Simplified83.4%
Taylor expanded in z around 0 81.9%
unpow281.9%
Simplified81.9%
*-commutative81.9%
associate-/r*90.5%
associate-/r/94.5%
div-inv94.1%
clear-num94.1%
associate-*r/94.9%
Applied egg-rr94.9%
Final simplification95.5%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z) :precision binary64 (if (or (<= z -1.0) (not (<= z 0.75))) (/ (/ y z) (* z (/ z x))) (/ (* y (- (/ x z) x)) z)))
assert(x < y);
double code(double x, double y, double z) {
double tmp;
if ((z <= -1.0) || !(z <= 0.75)) {
tmp = (y / z) / (z * (z / x));
} else {
tmp = (y * ((x / 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)) .or. (.not. (z <= 0.75d0))) then
tmp = (y / z) / (z * (z / x))
else
tmp = (y * ((x / 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) || !(z <= 0.75)) {
tmp = (y / z) / (z * (z / x));
} else {
tmp = (y * ((x / z) - x)) / z;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z): tmp = 0 if (z <= -1.0) or not (z <= 0.75): tmp = (y / z) / (z * (z / x)) else: tmp = (y * ((x / z) - x)) / z 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(y / z) / Float64(z * Float64(z / x))); else tmp = Float64(Float64(y * Float64(Float64(x / 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) || ~((z <= 0.75)))
tmp = (y / z) / (z * (z / x));
else
tmp = (y * ((x / 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, -1.0], N[Not[LessEqual[z, 0.75]], $MachinePrecision]], N[(N[(y / z), $MachinePrecision] / N[(z * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y * N[(N[(x / z), $MachinePrecision] - x), $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.75\right):\\
\;\;\;\;\frac{\frac{y}{z}}{z \cdot \frac{z}{x}}\\
\mathbf{else}:\\
\;\;\;\;\frac{y \cdot \left(\frac{x}{z} - x\right)}{z}\\
\end{array}
\end{array}
if z < -1 or 0.75 < z Initial program 89.5%
*-commutative89.5%
associate-*r/88.8%
sqr-neg88.8%
associate-*l*88.8%
associate-*l*88.8%
sqr-neg88.8%
associate-*l*88.8%
distribute-lft-in88.8%
fma-def88.8%
*-rgt-identity88.8%
Simplified88.8%
associate-*r/89.5%
*-commutative89.5%
associate-/r*94.0%
associate-*r/95.6%
fma-udef95.6%
distribute-lft1-in95.6%
frac-times98.0%
clear-num98.0%
frac-times95.1%
*-un-lft-identity95.1%
Applied egg-rr95.1%
Taylor expanded in z around inf 92.9%
unpow292.9%
associate-*r/94.0%
Simplified94.0%
if -1 < z < 0.75Initial program 84.2%
*-commutative84.2%
associate-*r/83.4%
sqr-neg83.4%
associate-*l*83.4%
associate-*l*83.4%
sqr-neg83.4%
associate-*l*83.4%
distribute-lft-in83.4%
fma-def83.4%
*-rgt-identity83.4%
Simplified83.4%
Taylor expanded in z around 0 66.9%
unpow266.9%
*-commutative66.9%
times-frac78.3%
mul-1-neg78.3%
*-commutative78.3%
associate-*r/75.1%
distribute-lft-neg-in75.1%
distribute-rgt-out94.9%
Simplified94.9%
Taylor expanded in y around 0 95.7%
Final simplification94.9%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z) :precision binary64 (if (<= z -1.0) (* (/ x z) (/ y (* z z))) (if (<= z 1.0) (/ (* (/ x 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) * (y / (z * z));
} else if (z <= 1.0) {
tmp = ((x / 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) * (y / (z * z))
else if (z <= 1.0d0) then
tmp = ((x / 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) * (y / (z * z));
} else if (z <= 1.0) {
tmp = ((x / 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) * (y / (z * z)) elif z <= 1.0: tmp = ((x / 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(y / Float64(z * z))); elseif (z <= 1.0) tmp = Float64(Float64(Float64(x / z) * y) / z); else tmp = Float64(y / Float64(Float64(z * 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) * (y / (z * z));
elseif (z <= 1.0)
tmp = ((x / 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[(y / N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.0], N[(N[(N[(x / z), $MachinePrecision] * y), $MachinePrecision] / z), $MachinePrecision], N[(y / N[(N[(z * z), $MachinePrecision] * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1:\\
\;\;\;\;\frac{x}{z} \cdot \frac{y}{z \cdot z}\\
\mathbf{elif}\;z \leq 1:\\
\;\;\;\;\frac{\frac{x}{z} \cdot y}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{\left(z \cdot z\right) \cdot \frac{z}{x}}\\
\end{array}
\end{array}
if z < -1Initial program 89.7%
*-commutative89.7%
sqr-neg89.7%
times-frac99.0%
sqr-neg99.0%
Simplified99.0%
Taylor expanded in z around inf 97.9%
if -1 < z < 1Initial program 84.2%
*-commutative84.2%
associate-*r/83.4%
sqr-neg83.4%
associate-*l*83.4%
associate-*l*83.4%
sqr-neg83.4%
associate-*l*83.4%
distribute-lft-in83.4%
fma-def83.4%
*-rgt-identity83.4%
Simplified83.4%
Taylor expanded in z around 0 81.9%
unpow281.9%
Simplified81.9%
*-commutative81.9%
associate-/r*90.5%
associate-/r/94.5%
div-inv94.1%
clear-num94.1%
associate-*r/94.9%
Applied egg-rr94.9%
if 1 < z Initial program 89.3%
*-commutative89.3%
sqr-neg89.3%
times-frac95.7%
sqr-neg95.7%
Simplified95.7%
Taylor expanded in z around inf 94.6%
*-commutative94.6%
clear-num94.5%
frac-times90.6%
*-un-lft-identity90.6%
Applied egg-rr90.6%
Final simplification94.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) (/ y (* z z))) (if (<= z 0.75) (/ (* y (- (/ x z) x)) 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) * (y / (z * z));
} else if (z <= 0.75) {
tmp = (y * ((x / z) - x)) / 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) * (y / (z * z))
else if (z <= 0.75d0) then
tmp = (y * ((x / z) - x)) / 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) * (y / (z * z));
} else if (z <= 0.75) {
tmp = (y * ((x / z) - x)) / 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) * (y / (z * z)) elif z <= 0.75: tmp = (y * ((x / z) - x)) / 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(y / Float64(z * z))); elseif (z <= 0.75) tmp = Float64(Float64(y * Float64(Float64(x / z) - x)) / z); else tmp = Float64(y / Float64(Float64(z * 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) * (y / (z * z));
elseif (z <= 0.75)
tmp = (y * ((x / z) - x)) / 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[(y / N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 0.75], N[(N[(y * N[(N[(x / z), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], N[(y / N[(N[(z * z), $MachinePrecision] * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1:\\
\;\;\;\;\frac{x}{z} \cdot \frac{y}{z \cdot z}\\
\mathbf{elif}\;z \leq 0.75:\\
\;\;\;\;\frac{y \cdot \left(\frac{x}{z} - x\right)}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{\left(z \cdot z\right) \cdot \frac{z}{x}}\\
\end{array}
\end{array}
if z < -1Initial program 89.7%
*-commutative89.7%
sqr-neg89.7%
times-frac99.0%
sqr-neg99.0%
Simplified99.0%
Taylor expanded in z around inf 97.9%
if -1 < z < 0.75Initial program 84.2%
*-commutative84.2%
associate-*r/83.4%
sqr-neg83.4%
associate-*l*83.4%
associate-*l*83.4%
sqr-neg83.4%
associate-*l*83.4%
distribute-lft-in83.4%
fma-def83.4%
*-rgt-identity83.4%
Simplified83.4%
Taylor expanded in z around 0 66.9%
unpow266.9%
*-commutative66.9%
times-frac78.3%
mul-1-neg78.3%
*-commutative78.3%
associate-*r/75.1%
distribute-lft-neg-in75.1%
distribute-rgt-out94.9%
Simplified94.9%
Taylor expanded in y around 0 95.7%
if 0.75 < z Initial program 89.3%
*-commutative89.3%
sqr-neg89.3%
times-frac95.7%
sqr-neg95.7%
Simplified95.7%
Taylor expanded in z around inf 94.6%
*-commutative94.6%
clear-num94.5%
frac-times90.6%
*-un-lft-identity90.6%
Applied egg-rr90.6%
Final simplification95.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) (/ (/ y z) (* z (/ z x))) (if (<= z 0.75) (/ (* y (- (/ x z) x)) z) (/ (/ (/ (* x y) z) z) z))))
assert(x < y);
double code(double x, double y, double z) {
double tmp;
if (z <= -1.0) {
tmp = (y / z) / (z * (z / x));
} else if (z <= 0.75) {
tmp = (y * ((x / z) - x)) / z;
} else {
tmp = (((x * y) / 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 = (y / z) / (z * (z / x))
else if (z <= 0.75d0) then
tmp = (y * ((x / z) - x)) / z
else
tmp = (((x * y) / 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 = (y / z) / (z * (z / x));
} else if (z <= 0.75) {
tmp = (y * ((x / z) - x)) / z;
} else {
tmp = (((x * y) / z) / z) / z;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z): tmp = 0 if z <= -1.0: tmp = (y / z) / (z * (z / x)) elif z <= 0.75: tmp = (y * ((x / z) - x)) / z else: tmp = (((x * y) / z) / z) / z return tmp
x, y = sort([x, y]) function code(x, y, z) tmp = 0.0 if (z <= -1.0) tmp = Float64(Float64(y / z) / Float64(z * Float64(z / x))); elseif (z <= 0.75) tmp = Float64(Float64(y * Float64(Float64(x / z) - x)) / z); else tmp = Float64(Float64(Float64(Float64(x * y) / 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 = (y / z) / (z * (z / x));
elseif (z <= 0.75)
tmp = (y * ((x / z) - x)) / z;
else
tmp = (((x * y) / 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[(N[(y / z), $MachinePrecision] / N[(z * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 0.75], N[(N[(y * N[(N[(x / z), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], N[(N[(N[(N[(x * y), $MachinePrecision] / z), $MachinePrecision] / z), $MachinePrecision] / z), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1:\\
\;\;\;\;\frac{\frac{y}{z}}{z \cdot \frac{z}{x}}\\
\mathbf{elif}\;z \leq 0.75:\\
\;\;\;\;\frac{y \cdot \left(\frac{x}{z} - x\right)}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\frac{x \cdot y}{z}}{z}}{z}\\
\end{array}
\end{array}
if z < -1Initial program 89.7%
*-commutative89.7%
associate-*r/91.6%
sqr-neg91.6%
associate-*l*91.6%
associate-*l*91.6%
sqr-neg91.6%
associate-*l*91.6%
distribute-lft-in91.6%
fma-def91.6%
*-rgt-identity91.6%
Simplified91.6%
associate-*r/89.6%
*-commutative89.6%
associate-/r*92.6%
associate-*r/97.4%
fma-udef97.4%
distribute-lft1-in97.4%
frac-times99.0%
clear-num98.9%
frac-times97.1%
*-un-lft-identity97.1%
Applied egg-rr97.1%
Taylor expanded in z around inf 95.1%
unpow295.1%
associate-*r/96.1%
Simplified96.1%
if -1 < z < 0.75Initial program 84.2%
*-commutative84.2%
associate-*r/83.4%
sqr-neg83.4%
associate-*l*83.4%
associate-*l*83.4%
sqr-neg83.4%
associate-*l*83.4%
distribute-lft-in83.4%
fma-def83.4%
*-rgt-identity83.4%
Simplified83.4%
Taylor expanded in z around 0 66.9%
unpow266.9%
*-commutative66.9%
times-frac78.3%
mul-1-neg78.3%
*-commutative78.3%
associate-*r/75.1%
distribute-lft-neg-in75.1%
distribute-rgt-out94.9%
Simplified94.9%
Taylor expanded in y around 0 95.7%
if 0.75 < z Initial program 89.3%
*-commutative89.3%
sqr-neg89.3%
times-frac95.7%
sqr-neg95.7%
Simplified95.7%
Taylor expanded in z around inf 94.6%
associate-/r*95.9%
associate-*l/97.1%
associate-*l/95.6%
associate-*r/95.6%
Applied egg-rr95.6%
Final simplification95.8%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z) :precision binary64 (if (<= x -9000000000.0) (* x (/ y (* z z))) (if (<= x 5.5e-178) (* (/ x z) (/ y z)) (* y (/ x (* z z))))))
assert(x < y);
double code(double x, double y, double z) {
double tmp;
if (x <= -9000000000.0) {
tmp = x * (y / (z * z));
} else if (x <= 5.5e-178) {
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 (x <= (-9000000000.0d0)) then
tmp = x * (y / (z * z))
else if (x <= 5.5d-178) 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 (x <= -9000000000.0) {
tmp = x * (y / (z * z));
} else if (x <= 5.5e-178) {
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 x <= -9000000000.0: tmp = x * (y / (z * z)) elif x <= 5.5e-178: 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 (x <= -9000000000.0) tmp = Float64(x * Float64(y / Float64(z * z))); elseif (x <= 5.5e-178) tmp = Float64(Float64(x / z) * Float64(y / z)); else tmp = Float64(y * Float64(x / Float64(z * z))); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z)
tmp = 0.0;
if (x <= -9000000000.0)
tmp = x * (y / (z * z));
elseif (x <= 5.5e-178)
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[x, -9000000000.0], N[(x * N[(y / N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 5.5e-178], N[(N[(x / z), $MachinePrecision] * N[(y / z), $MachinePrecision]), $MachinePrecision], N[(y * N[(x / N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -9000000000:\\
\;\;\;\;x \cdot \frac{y}{z \cdot z}\\
\mathbf{elif}\;x \leq 5.5 \cdot 10^{-178}:\\
\;\;\;\;\frac{x}{z} \cdot \frac{y}{z}\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{x}{z \cdot z}\\
\end{array}
\end{array}
if x < -9e9Initial program 86.3%
*-commutative86.3%
associate-*r/89.9%
sqr-neg89.9%
associate-*l*89.9%
associate-*l*89.9%
sqr-neg89.9%
associate-*l*89.9%
distribute-lft-in90.0%
fma-def90.0%
*-rgt-identity90.0%
Simplified90.0%
Taylor expanded in z around 0 75.8%
unpow275.8%
associate-*l/81.4%
Simplified81.4%
if -9e9 < x < 5.50000000000000028e-178Initial program 78.2%
*-commutative78.2%
associate-*r/76.4%
sqr-neg76.4%
associate-*l*76.4%
associate-*l*76.4%
sqr-neg76.4%
associate-*l*76.4%
distribute-lft-in76.4%
fma-def76.4%
*-rgt-identity76.4%
Simplified76.4%
Taylor expanded in z around 0 50.5%
unpow250.5%
*-commutative50.5%
times-frac69.8%
mul-1-neg69.8%
*-commutative69.8%
associate-*r/67.3%
distribute-lft-neg-in67.3%
distribute-rgt-out71.0%
Simplified71.0%
Taylor expanded in z around 0 81.2%
if 5.50000000000000028e-178 < x Initial program 92.8%
*-commutative92.8%
associate-*r/90.9%
sqr-neg90.9%
associate-*l*90.9%
associate-*l*90.9%
sqr-neg90.9%
associate-*l*90.9%
distribute-lft-in90.9%
fma-def90.9%
*-rgt-identity90.9%
Simplified90.9%
Taylor expanded in z around 0 83.6%
unpow283.6%
Simplified83.6%
Final simplification82.4%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z) :precision binary64 (if (<= x -1600000000.0) (/ x (/ (* z z) y)) (if (<= x 4.2e-178) (* (/ x z) (/ y z)) (* y (/ x (* z z))))))
assert(x < y);
double code(double x, double y, double z) {
double tmp;
if (x <= -1600000000.0) {
tmp = x / ((z * z) / y);
} else if (x <= 4.2e-178) {
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 (x <= (-1600000000.0d0)) then
tmp = x / ((z * z) / y)
else if (x <= 4.2d-178) 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 (x <= -1600000000.0) {
tmp = x / ((z * z) / y);
} else if (x <= 4.2e-178) {
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 x <= -1600000000.0: tmp = x / ((z * z) / y) elif x <= 4.2e-178: 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 (x <= -1600000000.0) tmp = Float64(x / Float64(Float64(z * z) / y)); elseif (x <= 4.2e-178) tmp = Float64(Float64(x / z) * Float64(y / z)); else tmp = Float64(y * Float64(x / Float64(z * z))); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z)
tmp = 0.0;
if (x <= -1600000000.0)
tmp = x / ((z * z) / y);
elseif (x <= 4.2e-178)
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[x, -1600000000.0], N[(x / N[(N[(z * z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 4.2e-178], N[(N[(x / z), $MachinePrecision] * N[(y / z), $MachinePrecision]), $MachinePrecision], N[(y * N[(x / N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1600000000:\\
\;\;\;\;\frac{x}{\frac{z \cdot z}{y}}\\
\mathbf{elif}\;x \leq 4.2 \cdot 10^{-178}:\\
\;\;\;\;\frac{x}{z} \cdot \frac{y}{z}\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{x}{z \cdot z}\\
\end{array}
\end{array}
if x < -1.6e9Initial program 86.3%
*-commutative86.3%
associate-*r/89.9%
sqr-neg89.9%
associate-*l*89.9%
associate-*l*89.9%
sqr-neg89.9%
associate-*l*89.9%
distribute-lft-in90.0%
fma-def90.0%
*-rgt-identity90.0%
Simplified90.0%
Taylor expanded in z around 0 75.8%
unpow275.8%
*-commutative75.8%
associate-/l*81.5%
Simplified81.5%
if -1.6e9 < x < 4.2e-178Initial program 78.2%
*-commutative78.2%
associate-*r/76.4%
sqr-neg76.4%
associate-*l*76.4%
associate-*l*76.4%
sqr-neg76.4%
associate-*l*76.4%
distribute-lft-in76.4%
fma-def76.4%
*-rgt-identity76.4%
Simplified76.4%
Taylor expanded in z around 0 50.5%
unpow250.5%
*-commutative50.5%
times-frac69.8%
mul-1-neg69.8%
*-commutative69.8%
associate-*r/67.3%
distribute-lft-neg-in67.3%
distribute-rgt-out71.0%
Simplified71.0%
Taylor expanded in z around 0 81.2%
if 4.2e-178 < x Initial program 92.8%
*-commutative92.8%
associate-*r/90.9%
sqr-neg90.9%
associate-*l*90.9%
associate-*l*90.9%
sqr-neg90.9%
associate-*l*90.9%
distribute-lft-in90.9%
fma-def90.9%
*-rgt-identity90.9%
Simplified90.9%
Taylor expanded in z around 0 83.6%
unpow283.6%
Simplified83.6%
Final simplification82.4%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z) :precision binary64 (/ (/ (/ x z) (/ z y)) (+ z 1.0)))
assert(x < y);
double code(double x, double y, double z) {
return ((x / z) / (z / y)) / (z + 1.0);
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = ((x / z) / (z / y)) / (z + 1.0d0)
end function
assert x < y;
public static double code(double x, double y, double z) {
return ((x / z) / (z / y)) / (z + 1.0);
}
[x, y] = sort([x, y]) def code(x, y, z): return ((x / z) / (z / y)) / (z + 1.0)
x, y = sort([x, y]) function code(x, y, z) return Float64(Float64(Float64(x / z) / Float64(z / y)) / Float64(z + 1.0)) end
x, y = num2cell(sort([x, y])){:}
function tmp = code(x, y, z)
tmp = ((x / z) / (z / y)) / (z + 1.0);
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_] := N[(N[(N[(x / z), $MachinePrecision] / N[(z / y), $MachinePrecision]), $MachinePrecision] / N[(z + 1.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\frac{\frac{\frac{x}{z}}{\frac{z}{y}}}{z + 1}
\end{array}
Initial program 86.7%
associate-*l*86.7%
times-frac96.4%
associate-/r*96.8%
associate-*r/97.3%
Simplified97.3%
clear-num97.3%
un-div-inv97.5%
Applied egg-rr97.5%
Final simplification97.5%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z) :precision binary64 (/ (* (/ x z) (/ y z)) (+ z 1.0)))
assert(x < y);
double code(double x, double y, double z) {
return ((x / z) * (y / z)) / (z + 1.0);
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = ((x / z) * (y / z)) / (z + 1.0d0)
end function
assert x < y;
public static double code(double x, double y, double z) {
return ((x / z) * (y / z)) / (z + 1.0);
}
[x, y] = sort([x, y]) def code(x, y, z): return ((x / z) * (y / z)) / (z + 1.0)
x, y = sort([x, y]) function code(x, y, z) return Float64(Float64(Float64(x / z) * Float64(y / z)) / Float64(z + 1.0)) end
x, y = num2cell(sort([x, y])){:}
function tmp = code(x, y, z)
tmp = ((x / z) * (y / z)) / (z + 1.0);
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_] := N[(N[(N[(x / z), $MachinePrecision] * N[(y / z), $MachinePrecision]), $MachinePrecision] / N[(z + 1.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\frac{\frac{x}{z} \cdot \frac{y}{z}}{z + 1}
\end{array}
Initial program 86.7%
associate-*l*86.7%
times-frac96.4%
associate-/r*96.8%
associate-*r/97.3%
Simplified97.3%
Final simplification97.3%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z) :precision binary64 (if (<= y 1e+16) (* (/ x z) (/ y z)) (* y (/ x (* z z)))))
assert(x < y);
double code(double x, double y, double z) {
double tmp;
if (y <= 1e+16) {
tmp = (x / z) * (y / z);
} else {
tmp = y * (x / (z * z));
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (y <= 1d+16) then
tmp = (x / z) * (y / z)
else
tmp = y * (x / (z * z))
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z) {
double tmp;
if (y <= 1e+16) {
tmp = (x / z) * (y / z);
} else {
tmp = y * (x / (z * z));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z): tmp = 0 if y <= 1e+16: tmp = (x / z) * (y / z) else: tmp = y * (x / (z * z)) return tmp
x, y = sort([x, y]) function code(x, y, z) tmp = 0.0 if (y <= 1e+16) tmp = Float64(Float64(x / z) * Float64(y / z)); else tmp = Float64(y * Float64(x / Float64(z * z))); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z)
tmp = 0.0;
if (y <= 1e+16)
tmp = (x / z) * (y / z);
else
tmp = y * (x / (z * z));
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_] := If[LessEqual[y, 1e+16], N[(N[(x / z), $MachinePrecision] * N[(y / z), $MachinePrecision]), $MachinePrecision], N[(y * N[(x / N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 10^{+16}:\\
\;\;\;\;\frac{x}{z} \cdot \frac{y}{z}\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{x}{z \cdot z}\\
\end{array}
\end{array}
if y < 1e16Initial program 85.5%
*-commutative85.5%
associate-*r/83.9%
sqr-neg83.9%
associate-*l*83.9%
associate-*l*83.9%
sqr-neg83.9%
associate-*l*83.9%
distribute-lft-in83.9%
fma-def83.9%
*-rgt-identity83.9%
Simplified83.9%
Taylor expanded in z around 0 53.7%
unpow253.7%
*-commutative53.7%
times-frac61.8%
mul-1-neg61.8%
*-commutative61.8%
associate-*r/64.4%
distribute-lft-neg-in64.4%
distribute-rgt-out71.3%
Simplified71.3%
Taylor expanded in z around 0 77.9%
if 1e16 < y Initial program 91.5%
*-commutative91.5%
associate-*r/94.4%
sqr-neg94.4%
associate-*l*94.4%
associate-*l*94.4%
sqr-neg94.4%
associate-*l*94.4%
distribute-lft-in94.4%
fma-def94.4%
*-rgt-identity94.4%
Simplified94.4%
Taylor expanded in z around 0 91.0%
unpow291.0%
Simplified91.0%
Final simplification80.6%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z) :precision binary64 (if (<= x -5.5e-85) (/ x (* z (/ z y))) (/ y (* z (/ z x)))))
assert(x < y);
double code(double x, double y, double z) {
double tmp;
if (x <= -5.5e-85) {
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 <= (-5.5d-85)) 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 <= -5.5e-85) {
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 <= -5.5e-85: 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 <= -5.5e-85) 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 <= -5.5e-85)
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, -5.5e-85], 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 -5.5 \cdot 10^{-85}:\\
\;\;\;\;\frac{x}{z \cdot \frac{z}{y}}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{z \cdot \frac{z}{x}}\\
\end{array}
\end{array}
if x < -5.4999999999999997e-85Initial program 86.0%
*-commutative86.0%
associate-*r/87.9%
sqr-neg87.9%
associate-*l*87.9%
associate-*l*87.9%
sqr-neg87.9%
associate-*l*87.9%
distribute-lft-in87.9%
fma-def87.9%
*-rgt-identity87.9%
Simplified87.9%
Taylor expanded in z around 0 72.0%
unpow272.0%
Simplified72.0%
*-commutative72.0%
associate-/r*70.2%
associate-/r/72.5%
associate-/l/78.1%
Applied egg-rr78.1%
if -5.4999999999999997e-85 < x Initial program 87.0%
*-commutative87.0%
associate-*r/85.3%
sqr-neg85.3%
associate-*l*85.3%
associate-*l*85.3%
sqr-neg85.3%
associate-*l*85.3%
distribute-lft-in85.3%
fma-def85.3%
*-rgt-identity85.3%
Simplified85.3%
associate-*r/87.0%
*-commutative87.0%
associate-/r*93.5%
associate-*r/95.3%
fma-udef95.3%
distribute-lft1-in95.3%
frac-times90.7%
clear-num90.6%
frac-times94.1%
*-un-lft-identity94.1%
Applied egg-rr94.1%
Taylor expanded in z around 0 77.7%
unpow277.7%
associate-/l*79.6%
associate-*r/83.2%
Simplified83.2%
Final simplification81.7%
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))) (/ x (/ z y))))
assert(x < y);
double code(double x, double y, double z) {
double tmp;
if (z <= -2e-310) {
tmp = y * (x / -z);
} else {
tmp = x / (z / y);
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (z <= (-2d-310)) then
tmp = y * (x / -z)
else
tmp = x / (z / y)
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z) {
double tmp;
if (z <= -2e-310) {
tmp = y * (x / -z);
} else {
tmp = x / (z / y);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z): tmp = 0 if z <= -2e-310: tmp = y * (x / -z) else: tmp = x / (z / y) return tmp
x, y = sort([x, y]) function code(x, y, z) tmp = 0.0 if (z <= -2e-310) tmp = Float64(y * Float64(x / Float64(-z))); else tmp = Float64(x / Float64(z / y)); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z)
tmp = 0.0;
if (z <= -2e-310)
tmp = y * (x / -z);
else
tmp = x / (z / y);
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_] := If[LessEqual[z, -2e-310], N[(y * N[(x / (-z)), $MachinePrecision]), $MachinePrecision], N[(x / N[(z / y), $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}:\\
\;\;\;\;\frac{x}{\frac{z}{y}}\\
\end{array}
\end{array}
if z < -1.999999999999994e-310Initial program 88.1%
*-commutative88.1%
associate-*r/88.1%
sqr-neg88.1%
associate-*l*88.1%
associate-*l*88.1%
sqr-neg88.1%
associate-*l*88.1%
distribute-lft-in88.1%
fma-def88.1%
*-rgt-identity88.1%
Simplified88.1%
Taylor expanded in z around 0 61.6%
unpow261.6%
*-commutative61.6%
times-frac67.0%
mul-1-neg67.0%
*-commutative67.0%
associate-*r/68.4%
distribute-lft-neg-in68.4%
distribute-rgt-out68.4%
Simplified68.4%
Taylor expanded in z around inf 36.2%
associate-*r/41.4%
neg-mul-141.4%
distribute-rgt-neg-in41.4%
neg-mul-141.4%
metadata-eval41.4%
times-frac41.4%
*-lft-identity41.4%
neg-mul-141.4%
Simplified41.4%
if -1.999999999999994e-310 < z Initial program 85.4%
*-commutative85.4%
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 38.5%
unpow238.5%
*-commutative38.5%
times-frac44.8%
mul-1-neg44.8%
*-commutative44.8%
associate-*r/46.0%
distribute-lft-neg-in46.0%
distribute-rgt-out66.4%
Simplified66.4%
Taylor expanded in z around inf 14.1%
associate-*r/18.5%
neg-mul-118.5%
distribute-rgt-neg-in18.5%
neg-mul-118.5%
metadata-eval18.5%
times-frac18.5%
*-lft-identity18.5%
neg-mul-118.5%
Simplified18.5%
expm1-log1p-u18.4%
expm1-udef33.3%
add-sqr-sqrt22.5%
sqrt-unprod39.8%
frac-times34.2%
sqr-neg34.2%
frac-times39.8%
sqrt-unprod29.1%
add-sqr-sqrt43.2%
associate-*r/43.3%
Applied egg-rr43.3%
expm1-def24.3%
expm1-log1p34.0%
*-commutative34.0%
associate-/l*41.4%
Simplified41.4%
Final simplification41.4%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z) :precision binary64 (if (<= x -3.2e-269) (* x (/ y z)) (* (/ x z) y)))
assert(x < y);
double code(double x, double y, double z) {
double tmp;
if (x <= -3.2e-269) {
tmp = x * (y / z);
} 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 <= (-3.2d-269)) then
tmp = x * (y / z)
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 <= -3.2e-269) {
tmp = x * (y / z);
} else {
tmp = (x / z) * y;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z): tmp = 0 if x <= -3.2e-269: tmp = x * (y / z) else: tmp = (x / z) * y return tmp
x, y = sort([x, y]) function code(x, y, z) tmp = 0.0 if (x <= -3.2e-269) tmp = Float64(x * Float64(y / z)); else tmp = Float64(Float64(x / z) * y); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z)
tmp = 0.0;
if (x <= -3.2e-269)
tmp = x * (y / z);
else
tmp = (x / z) * y;
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_] := If[LessEqual[x, -3.2e-269], N[(x * N[(y / z), $MachinePrecision]), $MachinePrecision], N[(N[(x / z), $MachinePrecision] * y), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.2 \cdot 10^{-269}:\\
\;\;\;\;x \cdot \frac{y}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{z} \cdot y\\
\end{array}
\end{array}
if x < -3.2000000000000001e-269Initial program 82.3%
*-commutative82.3%
associate-*r/82.9%
sqr-neg82.9%
associate-*l*82.9%
associate-*l*82.9%
sqr-neg82.9%
associate-*l*82.9%
distribute-lft-in82.9%
fma-def82.9%
*-rgt-identity82.9%
Simplified82.9%
Taylor expanded in z around 0 46.6%
unpow246.6%
*-commutative46.6%
times-frac54.8%
mul-1-neg54.8%
*-commutative54.8%
associate-*r/58.0%
distribute-lft-neg-in58.0%
distribute-rgt-out68.2%
Simplified68.2%
Taylor expanded in z around inf 21.3%
associate-*r/23.9%
neg-mul-123.9%
distribute-rgt-neg-in23.9%
neg-mul-123.9%
metadata-eval23.9%
times-frac23.9%
*-lft-identity23.9%
neg-mul-123.9%
Simplified23.9%
expm1-log1p-u18.8%
expm1-udef34.4%
add-sqr-sqrt16.2%
sqrt-unprod29.8%
frac-times25.0%
sqr-neg25.0%
frac-times29.8%
sqrt-unprod18.2%
add-sqr-sqrt34.7%
associate-*r/34.8%
Applied egg-rr34.8%
expm1-def17.4%
expm1-log1p21.8%
*-commutative21.8%
associate-/l*29.6%
Simplified29.6%
*-un-lft-identity29.6%
associate-*l/29.6%
clear-num28.7%
Applied egg-rr28.7%
if -3.2000000000000001e-269 < x Initial program 90.1%
*-commutative90.1%
associate-*r/88.4%
sqr-neg88.4%
associate-*l*88.4%
associate-*l*88.4%
sqr-neg88.4%
associate-*l*88.4%
distribute-lft-in88.4%
fma-def88.4%
*-rgt-identity88.4%
Simplified88.4%
Taylor expanded in z around 0 52.6%
unpow252.6%
*-commutative52.6%
times-frac56.7%
mul-1-neg56.7%
*-commutative56.7%
associate-*r/56.6%
distribute-lft-neg-in56.6%
distribute-rgt-out66.8%
Simplified66.8%
Taylor expanded in z around inf 28.0%
associate-*r/34.4%
neg-mul-134.4%
distribute-rgt-neg-in34.4%
neg-mul-134.4%
metadata-eval34.4%
times-frac34.4%
*-lft-identity34.4%
neg-mul-134.4%
Simplified34.4%
expm1-log1p-u28.4%
expm1-udef39.9%
add-sqr-sqrt30.4%
sqrt-unprod46.2%
frac-times44.6%
sqr-neg44.6%
frac-times46.2%
sqrt-unprod31.4%
add-sqr-sqrt43.2%
associate-*r/43.2%
Applied egg-rr43.2%
expm1-def25.3%
expm1-log1p30.8%
*-commutative30.8%
associate-/l*32.6%
Simplified32.6%
associate-/r/38.5%
Applied egg-rr38.5%
Final simplification34.3%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z) :precision binary64 (if (<= x -1e-268) (/ x (/ z y)) (* (/ x z) y)))
assert(x < y);
double code(double x, double y, double z) {
double tmp;
if (x <= -1e-268) {
tmp = x / (z / y);
} else {
tmp = (x / z) * y;
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (x <= (-1d-268)) then
tmp = x / (z / y)
else
tmp = (x / z) * y
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z) {
double tmp;
if (x <= -1e-268) {
tmp = x / (z / y);
} else {
tmp = (x / z) * y;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z): tmp = 0 if x <= -1e-268: tmp = x / (z / y) else: tmp = (x / z) * y return tmp
x, y = sort([x, y]) function code(x, y, z) tmp = 0.0 if (x <= -1e-268) tmp = Float64(x / Float64(z / y)); else tmp = Float64(Float64(x / z) * y); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z)
tmp = 0.0;
if (x <= -1e-268)
tmp = x / (z / y);
else
tmp = (x / z) * y;
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_] := If[LessEqual[x, -1e-268], N[(x / N[(z / y), $MachinePrecision]), $MachinePrecision], N[(N[(x / z), $MachinePrecision] * y), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1 \cdot 10^{-268}:\\
\;\;\;\;\frac{x}{\frac{z}{y}}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{z} \cdot y\\
\end{array}
\end{array}
if x < -9.99999999999999958e-269Initial program 82.3%
*-commutative82.3%
associate-*r/82.9%
sqr-neg82.9%
associate-*l*82.9%
associate-*l*82.9%
sqr-neg82.9%
associate-*l*82.9%
distribute-lft-in82.9%
fma-def82.9%
*-rgt-identity82.9%
Simplified82.9%
Taylor expanded in z around 0 46.6%
unpow246.6%
*-commutative46.6%
times-frac54.8%
mul-1-neg54.8%
*-commutative54.8%
associate-*r/58.0%
distribute-lft-neg-in58.0%
distribute-rgt-out68.2%
Simplified68.2%
Taylor expanded in z around inf 21.3%
associate-*r/23.9%
neg-mul-123.9%
distribute-rgt-neg-in23.9%
neg-mul-123.9%
metadata-eval23.9%
times-frac23.9%
*-lft-identity23.9%
neg-mul-123.9%
Simplified23.9%
expm1-log1p-u18.8%
expm1-udef34.4%
add-sqr-sqrt16.2%
sqrt-unprod29.8%
frac-times25.0%
sqr-neg25.0%
frac-times29.8%
sqrt-unprod18.2%
add-sqr-sqrt34.7%
associate-*r/34.8%
Applied egg-rr34.8%
expm1-def17.4%
expm1-log1p21.8%
*-commutative21.8%
associate-/l*29.6%
Simplified29.6%
if -9.99999999999999958e-269 < x Initial program 90.1%
*-commutative90.1%
associate-*r/88.4%
sqr-neg88.4%
associate-*l*88.4%
associate-*l*88.4%
sqr-neg88.4%
associate-*l*88.4%
distribute-lft-in88.4%
fma-def88.4%
*-rgt-identity88.4%
Simplified88.4%
Taylor expanded in z around 0 52.6%
unpow252.6%
*-commutative52.6%
times-frac56.7%
mul-1-neg56.7%
*-commutative56.7%
associate-*r/56.6%
distribute-lft-neg-in56.6%
distribute-rgt-out66.8%
Simplified66.8%
Taylor expanded in z around inf 28.0%
associate-*r/34.4%
neg-mul-134.4%
distribute-rgt-neg-in34.4%
neg-mul-134.4%
metadata-eval34.4%
times-frac34.4%
*-lft-identity34.4%
neg-mul-134.4%
Simplified34.4%
expm1-log1p-u28.4%
expm1-udef39.9%
add-sqr-sqrt30.4%
sqrt-unprod46.2%
frac-times44.6%
sqr-neg44.6%
frac-times46.2%
sqrt-unprod31.4%
add-sqr-sqrt43.2%
associate-*r/43.2%
Applied egg-rr43.2%
expm1-def25.3%
expm1-log1p30.8%
*-commutative30.8%
associate-/l*32.6%
Simplified32.6%
associate-/r/38.5%
Applied egg-rr38.5%
Final simplification34.7%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z) :precision binary64 (if (<= x -2.5e-270) (/ x (/ z y)) (/ y (/ z x))))
assert(x < y);
double code(double x, double y, double z) {
double tmp;
if (x <= -2.5e-270) {
tmp = x / (z / y);
} else {
tmp = y / (z / x);
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (x <= (-2.5d-270)) then
tmp = x / (z / y)
else
tmp = y / (z / x)
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z) {
double tmp;
if (x <= -2.5e-270) {
tmp = x / (z / y);
} else {
tmp = y / (z / x);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z): tmp = 0 if x <= -2.5e-270: tmp = x / (z / y) else: tmp = y / (z / x) return tmp
x, y = sort([x, y]) function code(x, y, z) tmp = 0.0 if (x <= -2.5e-270) tmp = Float64(x / Float64(z / y)); else tmp = Float64(y / Float64(z / x)); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z)
tmp = 0.0;
if (x <= -2.5e-270)
tmp = x / (z / y);
else
tmp = y / (z / x);
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_] := If[LessEqual[x, -2.5e-270], N[(x / N[(z / y), $MachinePrecision]), $MachinePrecision], N[(y / N[(z / x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.5 \cdot 10^{-270}:\\
\;\;\;\;\frac{x}{\frac{z}{y}}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{\frac{z}{x}}\\
\end{array}
\end{array}
if x < -2.4999999999999999e-270Initial program 82.3%
*-commutative82.3%
associate-*r/82.9%
sqr-neg82.9%
associate-*l*82.9%
associate-*l*82.9%
sqr-neg82.9%
associate-*l*82.9%
distribute-lft-in82.9%
fma-def82.9%
*-rgt-identity82.9%
Simplified82.9%
Taylor expanded in z around 0 46.6%
unpow246.6%
*-commutative46.6%
times-frac54.8%
mul-1-neg54.8%
*-commutative54.8%
associate-*r/58.0%
distribute-lft-neg-in58.0%
distribute-rgt-out68.2%
Simplified68.2%
Taylor expanded in z around inf 21.3%
associate-*r/23.9%
neg-mul-123.9%
distribute-rgt-neg-in23.9%
neg-mul-123.9%
metadata-eval23.9%
times-frac23.9%
*-lft-identity23.9%
neg-mul-123.9%
Simplified23.9%
expm1-log1p-u18.8%
expm1-udef34.4%
add-sqr-sqrt16.2%
sqrt-unprod29.8%
frac-times25.0%
sqr-neg25.0%
frac-times29.8%
sqrt-unprod18.2%
add-sqr-sqrt34.7%
associate-*r/34.8%
Applied egg-rr34.8%
expm1-def17.4%
expm1-log1p21.8%
*-commutative21.8%
associate-/l*29.6%
Simplified29.6%
if -2.4999999999999999e-270 < x Initial program 90.1%
*-commutative90.1%
associate-*r/88.4%
sqr-neg88.4%
associate-*l*88.4%
associate-*l*88.4%
sqr-neg88.4%
associate-*l*88.4%
distribute-lft-in88.4%
fma-def88.4%
*-rgt-identity88.4%
Simplified88.4%
Taylor expanded in z around 0 52.6%
unpow252.6%
*-commutative52.6%
times-frac56.7%
mul-1-neg56.7%
*-commutative56.7%
associate-*r/56.6%
distribute-lft-neg-in56.6%
distribute-rgt-out66.8%
Simplified66.8%
Taylor expanded in z around inf 28.0%
associate-*r/34.4%
neg-mul-134.4%
distribute-rgt-neg-in34.4%
neg-mul-134.4%
metadata-eval34.4%
times-frac34.4%
*-lft-identity34.4%
neg-mul-134.4%
Simplified34.4%
expm1-log1p-u28.4%
expm1-udef39.9%
add-sqr-sqrt30.4%
sqrt-unprod46.2%
frac-times44.6%
sqr-neg44.6%
frac-times46.2%
sqrt-unprod31.4%
add-sqr-sqrt43.2%
associate-*r/43.2%
Applied egg-rr43.2%
expm1-def25.3%
expm1-log1p30.8%
associate-/l*39.1%
Simplified39.1%
Final simplification35.0%
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 86.7%
*-commutative86.7%
associate-*r/86.1%
sqr-neg86.1%
associate-*l*86.0%
associate-*l*86.1%
sqr-neg86.1%
associate-*l*86.0%
distribute-lft-in86.0%
fma-def86.1%
*-rgt-identity86.1%
Simplified86.1%
Taylor expanded in z around 0 77.4%
unpow277.4%
Simplified77.4%
Final simplification77.4%
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) * 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 y
\end{array}
Initial program 86.7%
*-commutative86.7%
associate-*r/86.1%
sqr-neg86.1%
associate-*l*86.0%
associate-*l*86.1%
sqr-neg86.1%
associate-*l*86.0%
distribute-lft-in86.0%
fma-def86.1%
*-rgt-identity86.1%
Simplified86.1%
Taylor expanded in z around 0 50.0%
unpow250.0%
*-commutative50.0%
times-frac55.9%
mul-1-neg55.9%
*-commutative55.9%
associate-*r/57.2%
distribute-lft-neg-in57.2%
distribute-rgt-out67.4%
Simplified67.4%
Taylor expanded in z around inf 25.2%
associate-*r/29.9%
neg-mul-129.9%
distribute-rgt-neg-in29.9%
neg-mul-129.9%
metadata-eval29.9%
times-frac29.9%
*-lft-identity29.9%
neg-mul-129.9%
Simplified29.9%
expm1-log1p-u24.3%
expm1-udef37.6%
add-sqr-sqrt24.4%
sqrt-unprod39.2%
frac-times36.2%
sqr-neg36.2%
frac-times39.2%
sqrt-unprod25.8%
add-sqr-sqrt39.6%
associate-*r/39.6%
Applied egg-rr39.6%
expm1-def21.9%
expm1-log1p27.0%
*-commutative27.0%
associate-/l*31.4%
Simplified31.4%
associate-/r/32.8%
Applied egg-rr32.8%
Final simplification32.8%
(FPCore (x y z) :precision binary64 (if (< z 249.6182814532307) (/ (* y (/ x z)) (+ z (* z z))) (/ (* (/ (/ y z) (+ 1.0 z)) x) z)))
double code(double x, double y, double z) {
double tmp;
if (z < 249.6182814532307) {
tmp = (y * (x / z)) / (z + (z * z));
} else {
tmp = (((y / z) / (1.0 + z)) * x) / z;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (z < 249.6182814532307d0) then
tmp = (y * (x / z)) / (z + (z * z))
else
tmp = (((y / z) / (1.0d0 + z)) * x) / z
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z < 249.6182814532307) {
tmp = (y * (x / z)) / (z + (z * z));
} else {
tmp = (((y / z) / (1.0 + z)) * x) / z;
}
return tmp;
}
def code(x, y, z): tmp = 0 if z < 249.6182814532307: tmp = (y * (x / z)) / (z + (z * z)) else: tmp = (((y / z) / (1.0 + z)) * x) / z return tmp
function code(x, y, z) tmp = 0.0 if (z < 249.6182814532307) tmp = Float64(Float64(y * Float64(x / z)) / Float64(z + Float64(z * z))); else tmp = Float64(Float64(Float64(Float64(y / z) / Float64(1.0 + z)) * x) / z); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z < 249.6182814532307) tmp = (y * (x / z)) / (z + (z * z)); else tmp = (((y / z) / (1.0 + z)) * x) / z; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Less[z, 249.6182814532307], N[(N[(y * N[(x / z), $MachinePrecision]), $MachinePrecision] / N[(z + N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(y / z), $MachinePrecision] / N[(1.0 + z), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision] / z), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z < 249.6182814532307:\\
\;\;\;\;\frac{y \cdot \frac{x}{z}}{z + z \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\frac{y}{z}}{1 + z} \cdot x}{z}\\
\end{array}
\end{array}
herbie shell --seed 2023274
(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))))