
(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
(let* ((t_0 (* (+ z 1.0) (* z z))))
(if (<= t_0 -20000000.0)
(/ (/ y z) (/ z (/ x z)))
(if (<= t_0 5e-287)
(/ (/ x z) (/ z y))
(* (/ y (* z z)) (/ x (+ z 1.0)))))))assert(x < y);
double code(double x, double y, double z) {
double t_0 = (z + 1.0) * (z * z);
double tmp;
if (t_0 <= -20000000.0) {
tmp = (y / z) / (z / (x / z));
} else if (t_0 <= 5e-287) {
tmp = (x / z) / (z / y);
} 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) :: t_0
real(8) :: tmp
t_0 = (z + 1.0d0) * (z * z)
if (t_0 <= (-20000000.0d0)) then
tmp = (y / z) / (z / (x / z))
else if (t_0 <= 5d-287) then
tmp = (x / z) / (z / y)
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 t_0 = (z + 1.0) * (z * z);
double tmp;
if (t_0 <= -20000000.0) {
tmp = (y / z) / (z / (x / z));
} else if (t_0 <= 5e-287) {
tmp = (x / z) / (z / y);
} else {
tmp = (y / (z * z)) * (x / (z + 1.0));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z): t_0 = (z + 1.0) * (z * z) tmp = 0 if t_0 <= -20000000.0: tmp = (y / z) / (z / (x / z)) elif t_0 <= 5e-287: tmp = (x / z) / (z / y) else: tmp = (y / (z * z)) * (x / (z + 1.0)) return tmp
x, y = sort([x, y]) function code(x, y, z) t_0 = Float64(Float64(z + 1.0) * Float64(z * z)) tmp = 0.0 if (t_0 <= -20000000.0) tmp = Float64(Float64(y / z) / Float64(z / Float64(x / z))); elseif (t_0 <= 5e-287) tmp = Float64(Float64(x / z) / Float64(z / y)); 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)
t_0 = (z + 1.0) * (z * z);
tmp = 0.0;
if (t_0 <= -20000000.0)
tmp = (y / z) / (z / (x / z));
elseif (t_0 <= 5e-287)
tmp = (x / z) / (z / y);
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_] := Block[{t$95$0 = N[(N[(z + 1.0), $MachinePrecision] * N[(z * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -20000000.0], N[(N[(y / z), $MachinePrecision] / N[(z / N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 5e-287], N[(N[(x / z), $MachinePrecision] / N[(z / y), $MachinePrecision]), $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}
t_0 := \left(z + 1\right) \cdot \left(z \cdot z\right)\\
\mathbf{if}\;t_0 \leq -20000000:\\
\;\;\;\;\frac{\frac{y}{z}}{\frac{z}{\frac{x}{z}}}\\
\mathbf{elif}\;t_0 \leq 5 \cdot 10^{-287}:\\
\;\;\;\;\frac{\frac{x}{z}}{\frac{z}{y}}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{z \cdot z} \cdot \frac{x}{z + 1}\\
\end{array}
\end{array}
if (*.f64 (*.f64 z z) (+.f64 z 1)) < -2e7Initial program 84.0%
*-commutative84.0%
sqr-neg84.0%
times-frac94.3%
sqr-neg94.3%
Simplified94.3%
*-commutative94.3%
clear-num94.3%
associate-/r*96.5%
frac-times97.3%
*-un-lft-identity97.3%
Applied egg-rr97.3%
Taylor expanded in z around inf 93.6%
unpow293.6%
associate-*r/95.9%
Simplified95.9%
clear-num95.9%
un-div-inv96.0%
Applied egg-rr96.0%
if -2e7 < (*.f64 (*.f64 z z) (+.f64 z 1)) < 5.00000000000000025e-287Initial program 78.4%
*-commutative78.4%
sqr-neg78.4%
times-frac78.7%
sqr-neg78.7%
Simplified78.7%
frac-times78.4%
*-commutative78.4%
associate-/r*78.4%
frac-times99.9%
associate-/l*99.8%
div-inv99.8%
clear-num99.8%
Applied egg-rr99.8%
Taylor expanded in z around 0 99.8%
if 5.00000000000000025e-287 < (*.f64 (*.f64 z z) (+.f64 z 1)) Initial program 91.8%
*-commutative91.8%
sqr-neg91.8%
times-frac95.7%
sqr-neg95.7%
Simplified95.7%
Final simplification97.1%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z) :precision binary64 (if (or (<= z -1.0) (not (<= z 1.0))) (* x (/ (/ y (* z z)) z)) (/ (/ x z) (/ z y))))
assert(x < y);
double code(double x, double y, double z) {
double tmp;
if ((z <= -1.0) || !(z <= 1.0)) {
tmp = x * ((y / (z * z)) / 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 <= (-1.0d0)) .or. (.not. (z <= 1.0d0))) then
tmp = x * ((y / (z * z)) / 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 <= -1.0) || !(z <= 1.0)) {
tmp = x * ((y / (z * z)) / z);
} else {
tmp = (x / z) / (z / y);
}
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 * ((y / (z * z)) / z) else: tmp = (x / z) / (z / y) return tmp
x, y = sort([x, y]) function code(x, y, z) tmp = 0.0 if ((z <= -1.0) || !(z <= 1.0)) tmp = Float64(x * Float64(Float64(y / Float64(z * z)) / z)); else tmp = Float64(Float64(x / 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 <= -1.0) || ~((z <= 1.0)))
tmp = x * ((y / (z * z)) / 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[Or[LessEqual[z, -1.0], N[Not[LessEqual[z, 1.0]], $MachinePrecision]], N[(x * N[(N[(y / N[(z * z), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], N[(N[(x / z), $MachinePrecision] / N[(z / 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 1\right):\\
\;\;\;\;x \cdot \frac{\frac{y}{z \cdot z}}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{z}}{\frac{z}{y}}\\
\end{array}
\end{array}
if z < -1 or 1 < z Initial program 88.4%
*-commutative88.4%
sqr-neg88.4%
times-frac94.5%
sqr-neg94.5%
Simplified94.5%
*-commutative94.5%
clear-num94.3%
associate-/r*95.4%
frac-times96.8%
*-un-lft-identity96.8%
Applied egg-rr96.8%
Taylor expanded in z around inf 92.3%
unpow292.3%
associate-*r/94.0%
Simplified94.0%
associate-/r*92.7%
associate-/r/90.7%
associate-/l/90.7%
Applied egg-rr90.7%
if -1 < z < 1Initial program 82.9%
*-commutative82.9%
sqr-neg82.9%
times-frac85.6%
sqr-neg85.6%
Simplified85.6%
frac-times82.9%
*-commutative82.9%
associate-/r*82.9%
frac-times98.3%
associate-/l*98.2%
div-inv98.2%
clear-num98.3%
Applied egg-rr98.3%
Taylor expanded in z around 0 97.7%
Final simplification94.1%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z) :precision binary64 (if (or (<= z -1.0) (not (<= z 1.0))) (/ (/ x z) (* z (/ z y))) (/ (/ x z) (/ z y))))
assert(x < y);
double code(double x, double y, double z) {
double tmp;
if ((z <= -1.0) || !(z <= 1.0)) {
tmp = (x / z) / (z * (z / y));
} 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 <= (-1.0d0)) .or. (.not. (z <= 1.0d0))) then
tmp = (x / z) / (z * (z / y))
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 <= -1.0) || !(z <= 1.0)) {
tmp = (x / z) / (z * (z / y));
} else {
tmp = (x / z) / (z / y);
}
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) / (z * (z / y)) else: tmp = (x / z) / (z / y) 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(z * Float64(z / y))); else tmp = Float64(Float64(x / 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 <= -1.0) || ~((z <= 1.0)))
tmp = (x / z) / (z * (z / y));
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[Or[LessEqual[z, -1.0], N[Not[LessEqual[z, 1.0]], $MachinePrecision]], N[(N[(x / z), $MachinePrecision] / N[(z * N[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / z), $MachinePrecision] / N[(z / 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 1\right):\\
\;\;\;\;\frac{\frac{x}{z}}{z \cdot \frac{z}{y}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{z}}{\frac{z}{y}}\\
\end{array}
\end{array}
if z < -1 or 1 < z Initial program 88.4%
*-commutative88.4%
sqr-neg88.4%
times-frac94.5%
sqr-neg94.5%
Simplified94.5%
frac-times88.4%
*-commutative88.4%
associate-/r*90.5%
frac-times96.9%
associate-/l*95.4%
div-inv95.3%
clear-num95.4%
Applied egg-rr95.4%
Taylor expanded in z around inf 91.5%
unpow291.5%
associate-/l*92.7%
Simplified92.7%
associate-/r/92.7%
Applied egg-rr92.7%
if -1 < z < 1Initial program 82.9%
*-commutative82.9%
sqr-neg82.9%
times-frac85.6%
sqr-neg85.6%
Simplified85.6%
frac-times82.9%
*-commutative82.9%
associate-/r*82.9%
frac-times98.3%
associate-/l*98.2%
div-inv98.2%
clear-num98.3%
Applied egg-rr98.3%
Taylor expanded in z around 0 97.7%
Final simplification95.1%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z) :precision binary64 (if (<= z -1.0) (/ (/ x z) (/ z (/ y z))) (if (<= z 1.0) (/ (/ x z) (/ z y)) (/ (/ x z) (* z (/ z y))))))
assert(x < y);
double code(double x, double y, double z) {
double tmp;
if (z <= -1.0) {
tmp = (x / z) / (z / (y / z));
} else if (z <= 1.0) {
tmp = (x / z) / (z / y);
} 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 <= (-1.0d0)) then
tmp = (x / z) / (z / (y / z))
else if (z <= 1.0d0) then
tmp = (x / z) / (z / y)
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 <= -1.0) {
tmp = (x / z) / (z / (y / z));
} else if (z <= 1.0) {
tmp = (x / z) / (z / y);
} else {
tmp = (x / z) / (z * (z / y));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z): tmp = 0 if z <= -1.0: tmp = (x / z) / (z / (y / z)) elif z <= 1.0: tmp = (x / z) / (z / y) else: tmp = (x / z) / (z * (z / y)) return tmp
x, y = sort([x, y]) function code(x, y, z) tmp = 0.0 if (z <= -1.0) tmp = Float64(Float64(x / z) / Float64(z / Float64(y / z))); elseif (z <= 1.0) tmp = Float64(Float64(x / z) / Float64(z / y)); 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 <= -1.0)
tmp = (x / z) / (z / (y / z));
elseif (z <= 1.0)
tmp = (x / z) / (z / y);
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, -1.0], N[(N[(x / z), $MachinePrecision] / N[(z / N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.0], N[(N[(x / z), $MachinePrecision] / N[(z / y), $MachinePrecision]), $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:\\
\;\;\;\;\frac{\frac{x}{z}}{\frac{z}{\frac{y}{z}}}\\
\mathbf{elif}\;z \leq 1:\\
\;\;\;\;\frac{\frac{x}{z}}{\frac{z}{y}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{z}}{z \cdot \frac{z}{y}}\\
\end{array}
\end{array}
if z < -1Initial program 84.0%
*-commutative84.0%
sqr-neg84.0%
times-frac94.3%
sqr-neg94.3%
Simplified94.3%
frac-times84.0%
*-commutative84.0%
associate-/r*85.9%
frac-times95.9%
associate-/l*96.6%
div-inv96.5%
clear-num96.6%
Applied egg-rr96.6%
Taylor expanded in z around inf 92.9%
unpow292.9%
associate-/l*95.2%
Simplified95.2%
if -1 < z < 1Initial program 82.9%
*-commutative82.9%
sqr-neg82.9%
times-frac85.6%
sqr-neg85.6%
Simplified85.6%
frac-times82.9%
*-commutative82.9%
associate-/r*82.9%
frac-times98.3%
associate-/l*98.2%
div-inv98.2%
clear-num98.3%
Applied egg-rr98.3%
Taylor expanded in z around 0 97.7%
if 1 < z Initial program 92.4%
*-commutative92.4%
sqr-neg92.4%
times-frac94.6%
sqr-neg94.6%
Simplified94.6%
frac-times92.4%
*-commutative92.4%
associate-/r*94.5%
frac-times97.8%
associate-/l*94.3%
div-inv94.3%
clear-num94.3%
Applied egg-rr94.3%
Taylor expanded in z around inf 90.4%
unpow290.4%
associate-/l*90.4%
Simplified90.4%
associate-/r/90.4%
Applied egg-rr90.4%
Final simplification95.1%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z) :precision binary64 (if (<= z -1.0) (/ (/ y z) (* z (/ z x))) (if (<= z 1.0) (/ (/ x z) (/ z y)) (/ (/ x z) (* z (/ z y))))))
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 <= 1.0) {
tmp = (x / z) / (z / y);
} 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 <= (-1.0d0)) then
tmp = (y / z) / (z * (z / x))
else if (z <= 1.0d0) then
tmp = (x / z) / (z / y)
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 <= -1.0) {
tmp = (y / z) / (z * (z / x));
} else if (z <= 1.0) {
tmp = (x / z) / (z / y);
} else {
tmp = (x / z) / (z * (z / y));
}
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 <= 1.0: tmp = (x / z) / (z / y) else: tmp = (x / z) / (z * (z / y)) 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 <= 1.0) tmp = Float64(Float64(x / z) / Float64(z / y)); 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 <= -1.0)
tmp = (y / z) / (z * (z / x));
elseif (z <= 1.0)
tmp = (x / z) / (z / y);
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, -1.0], N[(N[(y / z), $MachinePrecision] / N[(z * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.0], N[(N[(x / z), $MachinePrecision] / N[(z / y), $MachinePrecision]), $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:\\
\;\;\;\;\frac{\frac{y}{z}}{z \cdot \frac{z}{x}}\\
\mathbf{elif}\;z \leq 1:\\
\;\;\;\;\frac{\frac{x}{z}}{\frac{z}{y}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{z}}{z \cdot \frac{z}{y}}\\
\end{array}
\end{array}
if z < -1Initial program 84.0%
*-commutative84.0%
sqr-neg84.0%
times-frac94.3%
sqr-neg94.3%
Simplified94.3%
*-commutative94.3%
clear-num94.3%
associate-/r*96.5%
frac-times97.3%
*-un-lft-identity97.3%
Applied egg-rr97.3%
Taylor expanded in z around inf 93.6%
unpow293.6%
associate-*r/95.9%
Simplified95.9%
if -1 < z < 1Initial program 82.9%
*-commutative82.9%
sqr-neg82.9%
times-frac85.6%
sqr-neg85.6%
Simplified85.6%
frac-times82.9%
*-commutative82.9%
associate-/r*82.9%
frac-times98.3%
associate-/l*98.2%
div-inv98.2%
clear-num98.3%
Applied egg-rr98.3%
Taylor expanded in z around 0 97.7%
if 1 < z Initial program 92.4%
*-commutative92.4%
sqr-neg92.4%
times-frac94.6%
sqr-neg94.6%
Simplified94.6%
frac-times92.4%
*-commutative92.4%
associate-/r*94.5%
frac-times97.8%
associate-/l*94.3%
div-inv94.3%
clear-num94.3%
Applied egg-rr94.3%
Taylor expanded in z around inf 90.4%
unpow290.4%
associate-/l*90.4%
Simplified90.4%
associate-/r/90.4%
Applied egg-rr90.4%
Final simplification95.3%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z) :precision binary64 (if (<= z -1.0) (/ (/ y z) (/ z (/ x z))) (if (<= z 1.0) (/ (/ x z) (/ z y)) (/ (/ x z) (* z (/ z y))))))
assert(x < y);
double code(double x, double y, double z) {
double tmp;
if (z <= -1.0) {
tmp = (y / z) / (z / (x / z));
} else if (z <= 1.0) {
tmp = (x / z) / (z / y);
} 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 <= (-1.0d0)) then
tmp = (y / z) / (z / (x / z))
else if (z <= 1.0d0) then
tmp = (x / z) / (z / y)
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 <= -1.0) {
tmp = (y / z) / (z / (x / z));
} else if (z <= 1.0) {
tmp = (x / z) / (z / y);
} else {
tmp = (x / z) / (z * (z / y));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z): tmp = 0 if z <= -1.0: tmp = (y / z) / (z / (x / z)) elif z <= 1.0: tmp = (x / z) / (z / y) else: tmp = (x / z) / (z * (z / y)) 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(x / z))); elseif (z <= 1.0) tmp = Float64(Float64(x / z) / Float64(z / y)); 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 <= -1.0)
tmp = (y / z) / (z / (x / z));
elseif (z <= 1.0)
tmp = (x / z) / (z / y);
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, -1.0], N[(N[(y / z), $MachinePrecision] / N[(z / N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.0], N[(N[(x / z), $MachinePrecision] / N[(z / y), $MachinePrecision]), $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:\\
\;\;\;\;\frac{\frac{y}{z}}{\frac{z}{\frac{x}{z}}}\\
\mathbf{elif}\;z \leq 1:\\
\;\;\;\;\frac{\frac{x}{z}}{\frac{z}{y}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{z}}{z \cdot \frac{z}{y}}\\
\end{array}
\end{array}
if z < -1Initial program 84.0%
*-commutative84.0%
sqr-neg84.0%
times-frac94.3%
sqr-neg94.3%
Simplified94.3%
*-commutative94.3%
clear-num94.3%
associate-/r*96.5%
frac-times97.3%
*-un-lft-identity97.3%
Applied egg-rr97.3%
Taylor expanded in z around inf 93.6%
unpow293.6%
associate-*r/95.9%
Simplified95.9%
clear-num95.9%
un-div-inv96.0%
Applied egg-rr96.0%
if -1 < z < 1Initial program 82.9%
*-commutative82.9%
sqr-neg82.9%
times-frac85.6%
sqr-neg85.6%
Simplified85.6%
frac-times82.9%
*-commutative82.9%
associate-/r*82.9%
frac-times98.3%
associate-/l*98.2%
div-inv98.2%
clear-num98.3%
Applied egg-rr98.3%
Taylor expanded in z around 0 97.7%
if 1 < z Initial program 92.4%
*-commutative92.4%
sqr-neg92.4%
times-frac94.6%
sqr-neg94.6%
Simplified94.6%
frac-times92.4%
*-commutative92.4%
associate-/r*94.5%
frac-times97.8%
associate-/l*94.3%
div-inv94.3%
clear-num94.3%
Applied egg-rr94.3%
Taylor expanded in z around inf 90.4%
unpow290.4%
associate-/l*90.4%
Simplified90.4%
associate-/r/90.4%
Applied egg-rr90.4%
Final simplification95.3%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z) :precision binary64 (if (<= z -1.0) (/ (/ y z) (/ z (/ x z))) (if (<= z 0.75) (* (/ x z) (- (/ y z) y)) (/ (/ x z) (* z (/ z y))))))
assert(x < y);
double code(double x, double y, double z) {
double tmp;
if (z <= -1.0) {
tmp = (y / z) / (z / (x / z));
} else if (z <= 0.75) {
tmp = (x / z) * ((y / z) - y);
} 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 <= (-1.0d0)) then
tmp = (y / z) / (z / (x / z))
else if (z <= 0.75d0) then
tmp = (x / z) * ((y / z) - y)
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 <= -1.0) {
tmp = (y / z) / (z / (x / z));
} else if (z <= 0.75) {
tmp = (x / z) * ((y / z) - y);
} else {
tmp = (x / z) / (z * (z / y));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z): tmp = 0 if z <= -1.0: tmp = (y / z) / (z / (x / z)) elif z <= 0.75: tmp = (x / z) * ((y / z) - y) else: tmp = (x / z) / (z * (z / y)) 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(x / z))); elseif (z <= 0.75) tmp = Float64(Float64(x / z) * Float64(Float64(y / z) - y)); 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 <= -1.0)
tmp = (y / z) / (z / (x / z));
elseif (z <= 0.75)
tmp = (x / z) * ((y / z) - y);
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, -1.0], N[(N[(y / z), $MachinePrecision] / N[(z / N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 0.75], N[(N[(x / z), $MachinePrecision] * N[(N[(y / z), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision], N[(N[(x / z), $MachinePrecision] / N[(z * N[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1:\\
\;\;\;\;\frac{\frac{y}{z}}{\frac{z}{\frac{x}{z}}}\\
\mathbf{elif}\;z \leq 0.75:\\
\;\;\;\;\frac{x}{z} \cdot \left(\frac{y}{z} - y\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{z}}{z \cdot \frac{z}{y}}\\
\end{array}
\end{array}
if z < -1Initial program 84.0%
*-commutative84.0%
sqr-neg84.0%
times-frac94.3%
sqr-neg94.3%
Simplified94.3%
*-commutative94.3%
clear-num94.3%
associate-/r*96.5%
frac-times97.3%
*-un-lft-identity97.3%
Applied egg-rr97.3%
Taylor expanded in z around inf 93.6%
unpow293.6%
associate-*r/95.9%
Simplified95.9%
clear-num95.9%
un-div-inv96.0%
Applied egg-rr96.0%
if -1 < z < 0.75Initial program 82.9%
associate-*l*82.9%
times-frac98.3%
associate-/r*98.3%
associate-*r/98.3%
Simplified98.3%
Taylor expanded in z around 0 61.3%
+-commutative61.3%
unpow261.3%
times-frac76.6%
mul-1-neg76.6%
associate-*l/68.4%
distribute-rgt-neg-in68.4%
distribute-lft-out97.8%
Simplified97.8%
if 0.75 < z Initial program 92.4%
*-commutative92.4%
sqr-neg92.4%
times-frac94.6%
sqr-neg94.6%
Simplified94.6%
frac-times92.4%
*-commutative92.4%
associate-/r*94.5%
frac-times97.8%
associate-/l*94.3%
div-inv94.3%
clear-num94.3%
Applied egg-rr94.3%
Taylor expanded in z around inf 90.4%
unpow290.4%
associate-/l*90.4%
Simplified90.4%
associate-/r/90.4%
Applied egg-rr90.4%
Final simplification95.3%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y z)
:precision binary64
(let* ((t_0 (/ y (* z z))))
(if (<= z -1.0)
(* t_0 (- x))
(if (<= z 6.4e-144) (/ (/ x z) (/ z y)) (* x t_0)))))assert(x < y);
double code(double x, double y, double z) {
double t_0 = y / (z * z);
double tmp;
if (z <= -1.0) {
tmp = t_0 * -x;
} else if (z <= 6.4e-144) {
tmp = (x / z) / (z / y);
} else {
tmp = x * t_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) :: t_0
real(8) :: tmp
t_0 = y / (z * z)
if (z <= (-1.0d0)) then
tmp = t_0 * -x
else if (z <= 6.4d-144) then
tmp = (x / z) / (z / y)
else
tmp = x * t_0
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z) {
double t_0 = y / (z * z);
double tmp;
if (z <= -1.0) {
tmp = t_0 * -x;
} else if (z <= 6.4e-144) {
tmp = (x / z) / (z / y);
} else {
tmp = x * t_0;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z): t_0 = y / (z * z) tmp = 0 if z <= -1.0: tmp = t_0 * -x elif z <= 6.4e-144: tmp = (x / z) / (z / y) else: tmp = x * t_0 return tmp
x, y = sort([x, y]) function code(x, y, z) t_0 = Float64(y / Float64(z * z)) tmp = 0.0 if (z <= -1.0) tmp = Float64(t_0 * Float64(-x)); elseif (z <= 6.4e-144) tmp = Float64(Float64(x / z) / Float64(z / y)); else tmp = Float64(x * t_0); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z)
t_0 = y / (z * z);
tmp = 0.0;
if (z <= -1.0)
tmp = t_0 * -x;
elseif (z <= 6.4e-144)
tmp = (x / z) / (z / y);
else
tmp = x * t_0;
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[(y / N[(z * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.0], N[(t$95$0 * (-x)), $MachinePrecision], If[LessEqual[z, 6.4e-144], N[(N[(x / z), $MachinePrecision] / N[(z / y), $MachinePrecision]), $MachinePrecision], N[(x * t$95$0), $MachinePrecision]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_0 := \frac{y}{z \cdot z}\\
\mathbf{if}\;z \leq -1:\\
\;\;\;\;t_0 \cdot \left(-x\right)\\
\mathbf{elif}\;z \leq 6.4 \cdot 10^{-144}:\\
\;\;\;\;\frac{\frac{x}{z}}{\frac{z}{y}}\\
\mathbf{else}:\\
\;\;\;\;x \cdot t_0\\
\end{array}
\end{array}
if z < -1Initial program 84.0%
*-commutative84.0%
sqr-neg84.0%
times-frac94.3%
sqr-neg94.3%
Simplified94.3%
frac-times84.0%
*-commutative84.0%
associate-/r*85.9%
frac-times95.9%
associate-/l*96.6%
div-inv96.5%
clear-num96.6%
Applied egg-rr96.6%
Taylor expanded in z around 0 48.2%
associate-/r*59.7%
frac-2neg59.7%
div-inv59.7%
associate-*r/63.4%
distribute-neg-frac63.4%
add-sqr-sqrt34.1%
sqrt-unprod51.1%
sqr-neg51.1%
sqrt-unprod30.1%
add-sqr-sqrt68.1%
frac-2neg68.1%
associate-*r/64.3%
associate-/l/64.3%
clear-num64.3%
associate-/l/68.1%
Applied egg-rr68.1%
*-commutative68.1%
Simplified68.1%
if -1 < z < 6.39999999999999946e-144Initial program 81.8%
*-commutative81.8%
sqr-neg81.8%
times-frac82.0%
sqr-neg82.0%
Simplified82.0%
frac-times81.8%
*-commutative81.8%
associate-/r*81.8%
frac-times99.8%
associate-/l*99.8%
div-inv99.8%
clear-num99.8%
Applied egg-rr99.8%
Taylor expanded in z around 0 99.1%
if 6.39999999999999946e-144 < z Initial program 91.1%
*-commutative91.1%
sqr-neg91.1%
times-frac95.9%
sqr-neg95.9%
Simplified95.9%
frac-times91.1%
*-commutative91.1%
associate-/r*92.7%
frac-times96.3%
associate-/l*93.8%
div-inv93.8%
clear-num93.8%
Applied egg-rr93.8%
Taylor expanded in z around 0 70.6%
unpow270.6%
associate-*r/74.5%
Simplified74.5%
Final simplification82.3%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z) :precision binary64 (if (<= (* x y) -1e-9) (* x (/ y (* z z))) (/ (* x (/ y z)) z)))
assert(x < y);
double code(double x, double y, double z) {
double tmp;
if ((x * y) <= -1e-9) {
tmp = x * (y / (z * z));
} else {
tmp = (x * (y / z)) / z;
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if ((x * y) <= (-1d-9)) then
tmp = x * (y / (z * z))
else
tmp = (x * (y / z)) / z
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z) {
double tmp;
if ((x * y) <= -1e-9) {
tmp = x * (y / (z * z));
} else {
tmp = (x * (y / z)) / z;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z): tmp = 0 if (x * y) <= -1e-9: tmp = x * (y / (z * z)) else: tmp = (x * (y / z)) / z return tmp
x, y = sort([x, y]) function code(x, y, z) tmp = 0.0 if (Float64(x * y) <= -1e-9) tmp = Float64(x * Float64(y / Float64(z * z))); else tmp = Float64(Float64(x * Float64(y / z)) / z); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z)
tmp = 0.0;
if ((x * y) <= -1e-9)
tmp = x * (y / (z * z));
else
tmp = (x * (y / z)) / z;
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_] := If[LessEqual[N[(x * y), $MachinePrecision], -1e-9], N[(x * N[(y / N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * N[(y / z), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -1 \cdot 10^{-9}:\\
\;\;\;\;x \cdot \frac{y}{z \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot \frac{y}{z}}{z}\\
\end{array}
\end{array}
if (*.f64 x y) < -1.00000000000000006e-9Initial program 87.1%
*-commutative87.1%
sqr-neg87.1%
times-frac94.7%
sqr-neg94.7%
Simplified94.7%
frac-times87.1%
*-commutative87.1%
associate-/r*88.9%
frac-times94.2%
associate-/l*91.9%
div-inv91.8%
clear-num91.8%
Applied egg-rr91.8%
Taylor expanded in z around 0 61.8%
unpow261.8%
associate-*r/68.5%
Simplified68.5%
if -1.00000000000000006e-9 < (*.f64 x y) Initial program 85.3%
*-commutative85.3%
associate-*r/85.5%
sqr-neg85.5%
associate-*l*85.5%
associate-*l*85.5%
sqr-neg85.5%
associate-*l*85.5%
distribute-lft-in85.5%
fma-def85.5%
*-rgt-identity85.5%
Simplified85.5%
Taylor expanded in z around 0 74.8%
unpow274.8%
Simplified74.8%
associate-*r/73.7%
*-commutative73.7%
associate-/r*78.6%
associate-*r/83.7%
Applied egg-rr83.7%
Final simplification79.5%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z) :precision binary64 (if (<= (* x y) -1e-9) (* x (/ y (* z z))) (/ (/ x z) (/ z y))))
assert(x < y);
double code(double x, double y, double z) {
double tmp;
if ((x * y) <= -1e-9) {
tmp = x * (y / (z * 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 ((x * y) <= (-1d-9)) then
tmp = x * (y / (z * 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 ((x * y) <= -1e-9) {
tmp = x * (y / (z * z));
} else {
tmp = (x / z) / (z / y);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z): tmp = 0 if (x * y) <= -1e-9: tmp = x * (y / (z * z)) else: tmp = (x / z) / (z / y) return tmp
x, y = sort([x, y]) function code(x, y, z) tmp = 0.0 if (Float64(x * y) <= -1e-9) tmp = Float64(x * Float64(y / Float64(z * z))); else tmp = Float64(Float64(x / 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 ((x * y) <= -1e-9)
tmp = x * (y / (z * 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[N[(x * y), $MachinePrecision], -1e-9], N[(x * N[(y / N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / z), $MachinePrecision] / N[(z / y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -1 \cdot 10^{-9}:\\
\;\;\;\;x \cdot \frac{y}{z \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{z}}{\frac{z}{y}}\\
\end{array}
\end{array}
if (*.f64 x y) < -1.00000000000000006e-9Initial program 87.1%
*-commutative87.1%
sqr-neg87.1%
times-frac94.7%
sqr-neg94.7%
Simplified94.7%
frac-times87.1%
*-commutative87.1%
associate-/r*88.9%
frac-times94.2%
associate-/l*91.9%
div-inv91.8%
clear-num91.8%
Applied egg-rr91.8%
Taylor expanded in z around 0 61.8%
unpow261.8%
associate-*r/68.5%
Simplified68.5%
if -1.00000000000000006e-9 < (*.f64 x y) Initial program 85.3%
*-commutative85.3%
sqr-neg85.3%
times-frac88.5%
sqr-neg88.5%
Simplified88.5%
frac-times85.3%
*-commutative85.3%
associate-/r*86.1%
frac-times98.8%
associate-/l*98.6%
div-inv98.6%
clear-num98.6%
Applied egg-rr98.6%
Taylor expanded in z around 0 85.3%
Final simplification80.7%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z) :precision binary64 (/ (/ x z) (* (+ z 1.0) (/ z y))))
assert(x < y);
double code(double x, double y, double z) {
return (x / z) / ((z + 1.0) * (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) / ((z + 1.0d0) * (z / y))
end function
assert x < y;
public static double code(double x, double y, double z) {
return (x / z) / ((z + 1.0) * (z / y));
}
[x, y] = sort([x, y]) def code(x, y, z): return (x / z) / ((z + 1.0) * (z / y))
x, y = sort([x, y]) function code(x, y, z) return Float64(Float64(x / z) / Float64(Float64(z + 1.0) * Float64(z / y))) end
x, y = num2cell(sort([x, y])){:}
function tmp = code(x, y, z)
tmp = (x / z) / ((z + 1.0) * (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] / N[(N[(z + 1.0), $MachinePrecision] * N[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\frac{\frac{x}{z}}{\left(z + 1\right) \cdot \frac{z}{y}}
\end{array}
Initial program 85.8%
*-commutative85.8%
sqr-neg85.8%
times-frac90.2%
sqr-neg90.2%
Simplified90.2%
frac-times85.8%
*-commutative85.8%
associate-/r*86.9%
frac-times97.6%
associate-/l*96.8%
div-inv96.7%
clear-num96.8%
Applied egg-rr96.8%
Final simplification96.8%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z) :precision binary64 (/ (* (/ x z) (/ y z)) (+ z 1.0)))
assert(x < y);
double code(double x, double y, double z) {
return ((x / z) * (y / z)) / (z + 1.0);
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = ((x / z) * (y / z)) / (z + 1.0d0)
end function
assert x < y;
public static double code(double x, double y, double z) {
return ((x / z) * (y / z)) / (z + 1.0);
}
[x, y] = sort([x, y]) def code(x, y, z): return ((x / z) * (y / z)) / (z + 1.0)
x, y = sort([x, y]) function code(x, y, z) return Float64(Float64(Float64(x / z) * Float64(y / z)) / Float64(z + 1.0)) end
x, y = num2cell(sort([x, y])){:}
function tmp = code(x, y, z)
tmp = ((x / z) * (y / z)) / (z + 1.0);
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_] := N[(N[(N[(x / z), $MachinePrecision] * N[(y / z), $MachinePrecision]), $MachinePrecision] / N[(z + 1.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\frac{\frac{x}{z} \cdot \frac{y}{z}}{z + 1}
\end{array}
Initial program 85.8%
associate-*l*85.8%
times-frac96.3%
associate-/r*96.8%
associate-*r/97.6%
Simplified97.6%
Final simplification97.6%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z) :precision binary64 (if (<= x -20000000000.0) (* x (/ y (* z z))) (* y (/ (/ x z) z))))
assert(x < y);
double code(double x, double y, double z) {
double tmp;
if (x <= -20000000000.0) {
tmp = x * (y / (z * z));
} else {
tmp = y * ((x / z) / z);
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (x <= (-20000000000.0d0)) then
tmp = x * (y / (z * z))
else
tmp = y * ((x / z) / z)
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z) {
double tmp;
if (x <= -20000000000.0) {
tmp = x * (y / (z * z));
} else {
tmp = y * ((x / z) / z);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z): tmp = 0 if x <= -20000000000.0: tmp = x * (y / (z * z)) else: tmp = y * ((x / z) / z) return tmp
x, y = sort([x, y]) function code(x, y, z) tmp = 0.0 if (x <= -20000000000.0) tmp = Float64(x * Float64(y / Float64(z * z))); else tmp = Float64(y * Float64(Float64(x / z) / z)); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z)
tmp = 0.0;
if (x <= -20000000000.0)
tmp = x * (y / (z * z));
else
tmp = y * ((x / z) / z);
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_] := If[LessEqual[x, -20000000000.0], N[(x * N[(y / N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * N[(N[(x / z), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -20000000000:\\
\;\;\;\;x \cdot \frac{y}{z \cdot z}\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{\frac{x}{z}}{z}\\
\end{array}
\end{array}
if x < -2e10Initial program 93.2%
*-commutative93.2%
sqr-neg93.2%
times-frac95.5%
sqr-neg95.5%
Simplified95.5%
frac-times93.2%
*-commutative93.2%
associate-/r*95.5%
frac-times95.6%
associate-/l*94.9%
div-inv94.8%
clear-num94.9%
Applied egg-rr94.9%
Taylor expanded in z around 0 77.6%
unpow277.6%
associate-*r/84.4%
Simplified84.4%
if -2e10 < x Initial program 83.2%
*-commutative83.2%
associate-*r/84.7%
sqr-neg84.7%
associate-*l*84.7%
associate-*l*84.7%
sqr-neg84.7%
associate-*l*84.7%
distribute-lft-in84.7%
fma-def84.7%
*-rgt-identity84.7%
Simplified84.7%
Taylor expanded in z around 0 70.3%
unpow270.3%
associate-/r*73.0%
Simplified73.0%
Final simplification76.0%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z) :precision binary64 (if (<= x -1000000000000.0) (* x (/ y (* z z))) (/ y (* z (/ z x)))))
assert(x < y);
double code(double x, double y, double z) {
double tmp;
if (x <= -1000000000000.0) {
tmp = x * (y / (z * z));
} 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 <= (-1000000000000.0d0)) then
tmp = x * (y / (z * z))
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 <= -1000000000000.0) {
tmp = x * (y / (z * z));
} else {
tmp = y / (z * (z / x));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z): tmp = 0 if x <= -1000000000000.0: tmp = x * (y / (z * z)) else: tmp = y / (z * (z / x)) return tmp
x, y = sort([x, y]) function code(x, y, z) tmp = 0.0 if (x <= -1000000000000.0) tmp = Float64(x * Float64(y / Float64(z * z))); 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 <= -1000000000000.0)
tmp = x * (y / (z * z));
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, -1000000000000.0], N[(x * N[(y / N[(z * z), $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 -1000000000000:\\
\;\;\;\;x \cdot \frac{y}{z \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{z \cdot \frac{z}{x}}\\
\end{array}
\end{array}
if x < -1e12Initial program 93.2%
*-commutative93.2%
sqr-neg93.2%
times-frac95.5%
sqr-neg95.5%
Simplified95.5%
frac-times93.2%
*-commutative93.2%
associate-/r*95.5%
frac-times95.6%
associate-/l*94.9%
div-inv94.8%
clear-num94.9%
Applied egg-rr94.9%
Taylor expanded in z around 0 77.6%
unpow277.6%
associate-*r/84.4%
Simplified84.4%
if -1e12 < x Initial program 83.2%
*-commutative83.2%
associate-*r/84.7%
sqr-neg84.7%
associate-*l*84.7%
associate-*l*84.7%
sqr-neg84.7%
associate-*l*84.7%
distribute-lft-in84.7%
fma-def84.7%
*-rgt-identity84.7%
Simplified84.7%
Taylor expanded in z around 0 70.3%
unpow270.3%
Simplified70.3%
associate-*r/67.9%
*-commutative67.9%
times-frac76.9%
clear-num76.9%
frac-times73.6%
*-un-lft-identity73.6%
Applied egg-rr73.6%
Final simplification76.5%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z) :precision binary64 (* x (/ y (* z z))))
assert(x < y);
double code(double x, double y, double z) {
return x * (y / (z * z));
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = x * (y / (z * z))
end function
assert x < y;
public static double code(double x, double y, double z) {
return x * (y / (z * z));
}
[x, y] = sort([x, y]) def code(x, y, z): return x * (y / (z * z))
x, y = sort([x, y]) function code(x, y, z) return Float64(x * Float64(y / Float64(z * z))) end
x, y = num2cell(sort([x, y])){:}
function tmp = code(x, y, z)
tmp = x * (y / (z * z));
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_] := N[(x * N[(y / N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
x \cdot \frac{y}{z \cdot z}
\end{array}
Initial program 85.8%
*-commutative85.8%
sqr-neg85.8%
times-frac90.2%
sqr-neg90.2%
Simplified90.2%
frac-times85.8%
*-commutative85.8%
associate-/r*86.9%
frac-times97.6%
associate-/l*96.8%
div-inv96.7%
clear-num96.8%
Applied egg-rr96.8%
Taylor expanded in z around 0 70.5%
unpow270.5%
associate-*r/74.3%
Simplified74.3%
Final simplification74.3%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z) :precision binary64 (* (/ x z) (- y)))
assert(x < y);
double code(double x, double y, double z) {
return (x / z) * -y;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = (x / z) * -y
end function
assert x < y;
public static double code(double x, double y, double z) {
return (x / z) * -y;
}
[x, y] = sort([x, y]) def code(x, y, z): return (x / z) * -y
x, y = sort([x, y]) function code(x, y, z) return Float64(Float64(x / z) * Float64(-y)) end
x, y = num2cell(sort([x, y])){:}
function tmp = code(x, y, z)
tmp = (x / z) * -y;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_] := N[(N[(x / z), $MachinePrecision] * (-y)), $MachinePrecision]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\frac{x}{z} \cdot \left(-y\right)
\end{array}
Initial program 85.8%
associate-*l*85.8%
times-frac96.3%
associate-/r*96.8%
associate-*r/97.6%
Simplified97.6%
Taylor expanded in z around 0 47.7%
+-commutative47.7%
unpow247.7%
times-frac55.1%
mul-1-neg55.1%
associate-*l/52.7%
distribute-rgt-neg-in52.7%
distribute-lft-out66.8%
Simplified66.8%
Taylor expanded in z around inf 27.5%
associate-*l/30.0%
associate-*r*30.0%
neg-mul-130.0%
distribute-frac-neg30.0%
*-commutative30.0%
Simplified30.0%
Final simplification30.0%
(FPCore (x y z) :precision binary64 (if (< z 249.6182814532307) (/ (* y (/ x z)) (+ z (* z z))) (/ (* (/ (/ y z) (+ 1.0 z)) x) z)))
double code(double x, double y, double z) {
double tmp;
if (z < 249.6182814532307) {
tmp = (y * (x / z)) / (z + (z * z));
} else {
tmp = (((y / z) / (1.0 + z)) * x) / z;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (z < 249.6182814532307d0) then
tmp = (y * (x / z)) / (z + (z * z))
else
tmp = (((y / z) / (1.0d0 + z)) * x) / z
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z < 249.6182814532307) {
tmp = (y * (x / z)) / (z + (z * z));
} else {
tmp = (((y / z) / (1.0 + z)) * x) / z;
}
return tmp;
}
def code(x, y, z): tmp = 0 if z < 249.6182814532307: tmp = (y * (x / z)) / (z + (z * z)) else: tmp = (((y / z) / (1.0 + z)) * x) / z return tmp
function code(x, y, z) tmp = 0.0 if (z < 249.6182814532307) tmp = Float64(Float64(y * Float64(x / z)) / Float64(z + Float64(z * z))); else tmp = Float64(Float64(Float64(Float64(y / z) / Float64(1.0 + z)) * x) / z); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z < 249.6182814532307) tmp = (y * (x / z)) / (z + (z * z)); else tmp = (((y / z) / (1.0 + z)) * x) / z; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Less[z, 249.6182814532307], N[(N[(y * N[(x / z), $MachinePrecision]), $MachinePrecision] / N[(z + N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(y / z), $MachinePrecision] / N[(1.0 + z), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision] / z), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z < 249.6182814532307:\\
\;\;\;\;\frac{y \cdot \frac{x}{z}}{z + z \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\frac{y}{z}}{1 + z} \cdot x}{z}\\
\end{array}
\end{array}
herbie shell --seed 2023297
(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))))