
(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 (* (+ 1.0 z) (* z z))))
(if (<= t_0 -2e+23)
(/ (/ x z) (* z (/ z y)))
(if (<= t_0 5e-193)
(/ (/ x z) (/ z y))
(* (/ (/ x z) z) (/ y (+ 1.0 z)))))))assert(x < y);
double code(double x, double y, double z) {
double t_0 = (1.0 + z) * (z * z);
double tmp;
if (t_0 <= -2e+23) {
tmp = (x / z) / (z * (z / y));
} else if (t_0 <= 5e-193) {
tmp = (x / z) / (z / y);
} else {
tmp = ((x / z) / z) * (y / (1.0 + 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) :: t_0
real(8) :: tmp
t_0 = (1.0d0 + z) * (z * z)
if (t_0 <= (-2d+23)) then
tmp = (x / z) / (z * (z / y))
else if (t_0 <= 5d-193) then
tmp = (x / z) / (z / y)
else
tmp = ((x / z) / z) * (y / (1.0d0 + z))
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z) {
double t_0 = (1.0 + z) * (z * z);
double tmp;
if (t_0 <= -2e+23) {
tmp = (x / z) / (z * (z / y));
} else if (t_0 <= 5e-193) {
tmp = (x / z) / (z / y);
} else {
tmp = ((x / z) / z) * (y / (1.0 + z));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z): t_0 = (1.0 + z) * (z * z) tmp = 0 if t_0 <= -2e+23: tmp = (x / z) / (z * (z / y)) elif t_0 <= 5e-193: tmp = (x / z) / (z / y) else: tmp = ((x / z) / z) * (y / (1.0 + z)) return tmp
x, y = sort([x, y]) function code(x, y, z) t_0 = Float64(Float64(1.0 + z) * Float64(z * z)) tmp = 0.0 if (t_0 <= -2e+23) tmp = Float64(Float64(x / z) / Float64(z * Float64(z / y))); elseif (t_0 <= 5e-193) tmp = Float64(Float64(x / z) / Float64(z / y)); else tmp = Float64(Float64(Float64(x / z) / z) * Float64(y / Float64(1.0 + z))); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z)
t_0 = (1.0 + z) * (z * z);
tmp = 0.0;
if (t_0 <= -2e+23)
tmp = (x / z) / (z * (z / y));
elseif (t_0 <= 5e-193)
tmp = (x / z) / (z / y);
else
tmp = ((x / z) / z) * (y / (1.0 + z));
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[(1.0 + z), $MachinePrecision] * N[(z * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -2e+23], N[(N[(x / z), $MachinePrecision] / N[(z * N[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 5e-193], N[(N[(x / z), $MachinePrecision] / N[(z / y), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x / z), $MachinePrecision] / z), $MachinePrecision] * N[(y / N[(1.0 + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_0 := \left(1 + z\right) \cdot \left(z \cdot z\right)\\
\mathbf{if}\;t_0 \leq -2 \cdot 10^{+23}:\\
\;\;\;\;\frac{\frac{x}{z}}{z \cdot \frac{z}{y}}\\
\mathbf{elif}\;t_0 \leq 5 \cdot 10^{-193}:\\
\;\;\;\;\frac{\frac{x}{z}}{\frac{z}{y}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{z}}{z} \cdot \frac{y}{1 + z}\\
\end{array}
\end{array}
if (*.f64 (*.f64 z z) (+.f64 z 1)) < -1.9999999999999998e23Initial program 87.8%
associate-*l*87.8%
times-frac96.3%
distribute-lft-in96.3%
fma-def96.3%
*-rgt-identity96.3%
Simplified96.3%
Taylor expanded in z around inf 95.0%
unpow295.0%
Simplified95.0%
clear-num94.1%
un-div-inv94.1%
associate-/l*95.6%
Applied egg-rr95.6%
associate-/r/95.6%
Applied egg-rr95.6%
if -1.9999999999999998e23 < (*.f64 (*.f64 z z) (+.f64 z 1)) < 5.0000000000000005e-193Initial program 78.5%
associate-*l*78.5%
times-frac97.6%
distribute-lft-in97.6%
fma-def97.6%
*-rgt-identity97.6%
Simplified97.6%
Taylor expanded in z around 0 78.5%
unpow278.5%
associate-/l/90.2%
associate-*r/97.5%
associate-*l/97.6%
Simplified97.6%
*-commutative97.6%
clear-num97.6%
un-div-inv98.7%
Applied egg-rr98.7%
if 5.0000000000000005e-193 < (*.f64 (*.f64 z z) (+.f64 z 1)) Initial program 87.6%
times-frac95.6%
Simplified95.6%
Taylor expanded in x around 0 95.6%
unpow295.6%
associate-/l/97.2%
Simplified97.2%
Final simplification97.3%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z) :precision binary64 (if (or (<= z -1.0) (not (<= z 6.5e-12))) (* (/ x z) (/ y (* z z))) (/ (/ y (/ z x)) z)))
assert(x < y);
double code(double x, double y, double z) {
double tmp;
if ((z <= -1.0) || !(z <= 6.5e-12)) {
tmp = (x / z) * (y / (z * z));
} else {
tmp = (y / (z / x)) / z;
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if ((z <= (-1.0d0)) .or. (.not. (z <= 6.5d-12))) then
tmp = (x / z) * (y / (z * z))
else
tmp = (y / (z / x)) / z
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -1.0) || !(z <= 6.5e-12)) {
tmp = (x / z) * (y / (z * z));
} else {
tmp = (y / (z / x)) / z;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z): tmp = 0 if (z <= -1.0) or not (z <= 6.5e-12): tmp = (x / z) * (y / (z * z)) else: tmp = (y / (z / x)) / z return tmp
x, y = sort([x, y]) function code(x, y, z) tmp = 0.0 if ((z <= -1.0) || !(z <= 6.5e-12)) tmp = Float64(Float64(x / z) * Float64(y / Float64(z * z))); else tmp = Float64(Float64(y / Float64(z / x)) / z); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z)
tmp = 0.0;
if ((z <= -1.0) || ~((z <= 6.5e-12)))
tmp = (x / z) * (y / (z * z));
else
tmp = (y / (z / x)) / z;
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_] := If[Or[LessEqual[z, -1.0], N[Not[LessEqual[z, 6.5e-12]], $MachinePrecision]], N[(N[(x / z), $MachinePrecision] * N[(y / N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y / N[(z / 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 6.5 \cdot 10^{-12}\right):\\
\;\;\;\;\frac{x}{z} \cdot \frac{y}{z \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{y}{\frac{z}{x}}}{z}\\
\end{array}
\end{array}
if z < -1 or 6.5000000000000002e-12 < z Initial program 87.0%
associate-*l*87.0%
times-frac95.6%
distribute-lft-in95.7%
fma-def95.6%
*-rgt-identity95.6%
Simplified95.6%
Taylor expanded in z around inf 94.5%
unpow294.5%
Simplified94.5%
if -1 < z < 6.5000000000000002e-12Initial program 82.0%
associate-*l*82.0%
times-frac97.3%
distribute-lft-in97.3%
fma-def97.3%
*-rgt-identity97.3%
Simplified97.3%
Taylor expanded in z around 0 80.7%
unpow280.7%
associate-/l*84.5%
associate-/l*91.1%
Simplified91.1%
associate-/r/91.1%
Applied egg-rr91.1%
associate-*l/84.5%
associate-/r/77.9%
Applied egg-rr77.9%
associate-/r*87.0%
associate-/r/96.1%
associate-/l/91.1%
associate-/r*96.5%
Applied egg-rr96.5%
Final simplification95.4%
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 6.5e-12))) (* (/ x z) (/ (/ y z) z)) (/ (/ y (/ z x)) z)))
assert(x < y);
double code(double x, double y, double z) {
double tmp;
if ((z <= -1.0) || !(z <= 6.5e-12)) {
tmp = (x / z) * ((y / z) / z);
} else {
tmp = (y / (z / x)) / z;
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if ((z <= (-1.0d0)) .or. (.not. (z <= 6.5d-12))) then
tmp = (x / z) * ((y / z) / z)
else
tmp = (y / (z / x)) / z
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -1.0) || !(z <= 6.5e-12)) {
tmp = (x / z) * ((y / z) / z);
} else {
tmp = (y / (z / x)) / z;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z): tmp = 0 if (z <= -1.0) or not (z <= 6.5e-12): tmp = (x / z) * ((y / z) / z) else: tmp = (y / (z / x)) / z return tmp
x, y = sort([x, y]) function code(x, y, z) tmp = 0.0 if ((z <= -1.0) || !(z <= 6.5e-12)) tmp = Float64(Float64(x / z) * Float64(Float64(y / z) / z)); else tmp = Float64(Float64(y / Float64(z / x)) / z); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z)
tmp = 0.0;
if ((z <= -1.0) || ~((z <= 6.5e-12)))
tmp = (x / z) * ((y / z) / z);
else
tmp = (y / (z / x)) / z;
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_] := If[Or[LessEqual[z, -1.0], N[Not[LessEqual[z, 6.5e-12]], $MachinePrecision]], N[(N[(x / z), $MachinePrecision] * N[(N[(y / z), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], N[(N[(y / N[(z / 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 6.5 \cdot 10^{-12}\right):\\
\;\;\;\;\frac{x}{z} \cdot \frac{\frac{y}{z}}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{y}{\frac{z}{x}}}{z}\\
\end{array}
\end{array}
if z < -1 or 6.5000000000000002e-12 < z Initial program 87.0%
associate-*l*87.0%
times-frac95.6%
distribute-lft-in95.7%
fma-def95.6%
*-rgt-identity95.6%
Simplified95.6%
Taylor expanded in z around inf 94.5%
unpow294.5%
associate-/r*97.1%
Simplified97.1%
if -1 < z < 6.5000000000000002e-12Initial program 82.0%
associate-*l*82.0%
times-frac97.3%
distribute-lft-in97.3%
fma-def97.3%
*-rgt-identity97.3%
Simplified97.3%
Taylor expanded in z around 0 80.7%
unpow280.7%
associate-/l*84.5%
associate-/l*91.1%
Simplified91.1%
associate-/r/91.1%
Applied egg-rr91.1%
associate-*l/84.5%
associate-/r/77.9%
Applied egg-rr77.9%
associate-/r*87.0%
associate-/r/96.1%
associate-/l/91.1%
associate-/r*96.5%
Applied egg-rr96.5%
Final simplification96.8%
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 (/ y (* z z))) z) (if (<= z 6.5e-12) (/ (/ y (/ z x)) z) (* (/ x z) (/ (/ y z) z)))))
assert(x < y);
double code(double x, double y, double z) {
double tmp;
if (z <= -1.0) {
tmp = (x * (y / (z * z))) / z;
} else if (z <= 6.5e-12) {
tmp = (y / (z / x)) / z;
} else {
tmp = (x / z) * ((y / z) / z);
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (z <= (-1.0d0)) then
tmp = (x * (y / (z * z))) / z
else if (z <= 6.5d-12) then
tmp = (y / (z / x)) / z
else
tmp = (x / z) * ((y / z) / z)
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z) {
double tmp;
if (z <= -1.0) {
tmp = (x * (y / (z * z))) / z;
} else if (z <= 6.5e-12) {
tmp = (y / (z / x)) / z;
} else {
tmp = (x / z) * ((y / z) / z);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z): tmp = 0 if z <= -1.0: tmp = (x * (y / (z * z))) / z elif z <= 6.5e-12: tmp = (y / (z / x)) / z else: tmp = (x / z) * ((y / z) / z) return tmp
x, y = sort([x, y]) function code(x, y, z) tmp = 0.0 if (z <= -1.0) tmp = Float64(Float64(x * Float64(y / Float64(z * z))) / z); elseif (z <= 6.5e-12) tmp = Float64(Float64(y / Float64(z / x)) / z); else tmp = Float64(Float64(x / z) * Float64(Float64(y / z) / z)); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z)
tmp = 0.0;
if (z <= -1.0)
tmp = (x * (y / (z * z))) / z;
elseif (z <= 6.5e-12)
tmp = (y / (z / x)) / z;
else
tmp = (x / z) * ((y / z) / z);
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_] := If[LessEqual[z, -1.0], N[(N[(x * N[(y / N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[z, 6.5e-12], N[(N[(y / N[(z / x), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], N[(N[(x / z), $MachinePrecision] * N[(N[(y / z), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1:\\
\;\;\;\;\frac{x \cdot \frac{y}{z \cdot z}}{z}\\
\mathbf{elif}\;z \leq 6.5 \cdot 10^{-12}:\\
\;\;\;\;\frac{\frac{y}{\frac{z}{x}}}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{z} \cdot \frac{\frac{y}{z}}{z}\\
\end{array}
\end{array}
if z < -1Initial program 87.8%
associate-*l*87.8%
times-frac96.3%
distribute-lft-in96.3%
fma-def96.3%
*-rgt-identity96.3%
Simplified96.3%
associate-*r/95.5%
fma-udef95.5%
*-rgt-identity95.5%
distribute-lft-in95.5%
frac-times96.8%
associate-/r*95.5%
associate-*l/94.0%
associate-/r*95.4%
associate-*r/90.8%
*-commutative90.8%
Applied egg-rr90.8%
Taylor expanded in z around inf 89.5%
unpow289.5%
associate-*l/95.0%
*-commutative95.0%
Simplified95.0%
if -1 < z < 6.5000000000000002e-12Initial program 82.0%
associate-*l*82.0%
times-frac97.3%
distribute-lft-in97.3%
fma-def97.3%
*-rgt-identity97.3%
Simplified97.3%
Taylor expanded in z around 0 80.7%
unpow280.7%
associate-/l*84.5%
associate-/l*91.1%
Simplified91.1%
associate-/r/91.1%
Applied egg-rr91.1%
associate-*l/84.5%
associate-/r/77.9%
Applied egg-rr77.9%
associate-/r*87.0%
associate-/r/96.1%
associate-/l/91.1%
associate-/r*96.5%
Applied egg-rr96.5%
if 6.5000000000000002e-12 < z Initial program 86.3%
associate-*l*86.3%
times-frac95.1%
distribute-lft-in95.1%
fma-def95.1%
*-rgt-identity95.1%
Simplified95.1%
Taylor expanded in z around inf 94.1%
unpow294.1%
associate-/r*97.7%
Simplified97.7%
Final simplification96.5%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z) :precision binary64 (if (<= z -1.0) (/ (/ x z) (* z (/ z y))) (if (<= z 6.5e-12) (/ (/ y (/ z x)) z) (* (/ x z) (/ (/ y z) z)))))
assert(x < y);
double code(double x, double y, double z) {
double tmp;
if (z <= -1.0) {
tmp = (x / z) / (z * (z / y));
} else if (z <= 6.5e-12) {
tmp = (y / (z / x)) / z;
} else {
tmp = (x / z) * ((y / z) / z);
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (z <= (-1.0d0)) then
tmp = (x / z) / (z * (z / y))
else if (z <= 6.5d-12) then
tmp = (y / (z / x)) / z
else
tmp = (x / z) * ((y / z) / z)
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z) {
double tmp;
if (z <= -1.0) {
tmp = (x / z) / (z * (z / y));
} else if (z <= 6.5e-12) {
tmp = (y / (z / x)) / z;
} else {
tmp = (x / z) * ((y / z) / z);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z): tmp = 0 if z <= -1.0: tmp = (x / z) / (z * (z / y)) elif z <= 6.5e-12: tmp = (y / (z / x)) / z else: tmp = (x / z) * ((y / z) / z) return tmp
x, y = sort([x, y]) function code(x, y, z) tmp = 0.0 if (z <= -1.0) tmp = Float64(Float64(x / z) / Float64(z * Float64(z / y))); elseif (z <= 6.5e-12) tmp = Float64(Float64(y / Float64(z / x)) / z); else tmp = Float64(Float64(x / z) * Float64(Float64(y / z) / z)); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z)
tmp = 0.0;
if (z <= -1.0)
tmp = (x / z) / (z * (z / y));
elseif (z <= 6.5e-12)
tmp = (y / (z / x)) / z;
else
tmp = (x / z) * ((y / z) / z);
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_] := If[LessEqual[z, -1.0], N[(N[(x / z), $MachinePrecision] / N[(z * N[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 6.5e-12], N[(N[(y / N[(z / x), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], N[(N[(x / z), $MachinePrecision] * N[(N[(y / z), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1:\\
\;\;\;\;\frac{\frac{x}{z}}{z \cdot \frac{z}{y}}\\
\mathbf{elif}\;z \leq 6.5 \cdot 10^{-12}:\\
\;\;\;\;\frac{\frac{y}{\frac{z}{x}}}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{z} \cdot \frac{\frac{y}{z}}{z}\\
\end{array}
\end{array}
if z < -1Initial program 87.8%
associate-*l*87.8%
times-frac96.3%
distribute-lft-in96.3%
fma-def96.3%
*-rgt-identity96.3%
Simplified96.3%
Taylor expanded in z around inf 95.0%
unpow295.0%
Simplified95.0%
clear-num94.1%
un-div-inv94.1%
associate-/l*95.6%
Applied egg-rr95.6%
associate-/r/95.6%
Applied egg-rr95.6%
if -1 < z < 6.5000000000000002e-12Initial program 82.0%
associate-*l*82.0%
times-frac97.3%
distribute-lft-in97.3%
fma-def97.3%
*-rgt-identity97.3%
Simplified97.3%
Taylor expanded in z around 0 80.7%
unpow280.7%
associate-/l*84.5%
associate-/l*91.1%
Simplified91.1%
associate-/r/91.1%
Applied egg-rr91.1%
associate-*l/84.5%
associate-/r/77.9%
Applied egg-rr77.9%
associate-/r*87.0%
associate-/r/96.1%
associate-/l/91.1%
associate-/r*96.5%
Applied egg-rr96.5%
if 6.5000000000000002e-12 < z Initial program 86.3%
associate-*l*86.3%
times-frac95.1%
distribute-lft-in95.1%
fma-def95.1%
*-rgt-identity95.1%
Simplified95.1%
Taylor expanded in z around inf 94.1%
unpow294.1%
associate-/r*97.7%
Simplified97.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 (<= z -1.0) (/ (/ x z) (* z (/ z y))) (if (<= z 6.5e-12) (/ (/ y (/ z x)) z) (/ (/ x z) (/ z (/ y z))))))
assert(x < y);
double code(double x, double y, double z) {
double tmp;
if (z <= -1.0) {
tmp = (x / z) / (z * (z / y));
} else if (z <= 6.5e-12) {
tmp = (y / (z / x)) / z;
} else {
tmp = (x / z) / (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)) then
tmp = (x / z) / (z * (z / y))
else if (z <= 6.5d-12) then
tmp = (y / (z / x)) / z
else
tmp = (x / z) / (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) {
tmp = (x / z) / (z * (z / y));
} else if (z <= 6.5e-12) {
tmp = (y / (z / x)) / z;
} else {
tmp = (x / z) / (z / (y / z));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z): tmp = 0 if z <= -1.0: tmp = (x / z) / (z * (z / y)) elif z <= 6.5e-12: tmp = (y / (z / x)) / z else: tmp = (x / z) / (z / (y / z)) return tmp
x, y = sort([x, y]) function code(x, y, z) tmp = 0.0 if (z <= -1.0) tmp = Float64(Float64(x / z) / Float64(z * Float64(z / y))); elseif (z <= 6.5e-12) tmp = Float64(Float64(y / Float64(z / x)) / z); else tmp = Float64(Float64(x / z) / Float64(z / Float64(y / z))); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z)
tmp = 0.0;
if (z <= -1.0)
tmp = (x / z) / (z * (z / y));
elseif (z <= 6.5e-12)
tmp = (y / (z / x)) / z;
else
tmp = (x / z) / (z / (y / z));
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_] := If[LessEqual[z, -1.0], N[(N[(x / z), $MachinePrecision] / N[(z * N[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 6.5e-12], N[(N[(y / N[(z / x), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], N[(N[(x / z), $MachinePrecision] / N[(z / N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1:\\
\;\;\;\;\frac{\frac{x}{z}}{z \cdot \frac{z}{y}}\\
\mathbf{elif}\;z \leq 6.5 \cdot 10^{-12}:\\
\;\;\;\;\frac{\frac{y}{\frac{z}{x}}}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{z}}{\frac{z}{\frac{y}{z}}}\\
\end{array}
\end{array}
if z < -1Initial program 87.8%
associate-*l*87.8%
times-frac96.3%
distribute-lft-in96.3%
fma-def96.3%
*-rgt-identity96.3%
Simplified96.3%
Taylor expanded in z around inf 95.0%
unpow295.0%
Simplified95.0%
clear-num94.1%
un-div-inv94.1%
associate-/l*95.6%
Applied egg-rr95.6%
associate-/r/95.6%
Applied egg-rr95.6%
if -1 < z < 6.5000000000000002e-12Initial program 82.0%
associate-*l*82.0%
times-frac97.3%
distribute-lft-in97.3%
fma-def97.3%
*-rgt-identity97.3%
Simplified97.3%
Taylor expanded in z around 0 80.7%
unpow280.7%
associate-/l*84.5%
associate-/l*91.1%
Simplified91.1%
associate-/r/91.1%
Applied egg-rr91.1%
associate-*l/84.5%
associate-/r/77.9%
Applied egg-rr77.9%
associate-/r*87.0%
associate-/r/96.1%
associate-/l/91.1%
associate-/r*96.5%
Applied egg-rr96.5%
if 6.5000000000000002e-12 < z Initial program 86.3%
associate-*l*86.3%
times-frac95.1%
distribute-lft-in95.1%
fma-def95.1%
*-rgt-identity95.1%
Simplified95.1%
Taylor expanded in z around inf 94.1%
unpow294.1%
Simplified94.1%
clear-num94.1%
un-div-inv94.1%
associate-/l*97.7%
Applied egg-rr97.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 (<= z -1.0) (/ (/ x z) (* z (/ z y))) (if (<= z 6.5e-12) (/ (/ y (/ 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) / (z * (z / y));
} else if (z <= 6.5e-12) {
tmp = (y / (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) / (z * (z / y))
else if (z <= 6.5d-12) then
tmp = (y / (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) / (z * (z / y));
} else if (z <= 6.5e-12) {
tmp = (y / (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) / (z * (z / y)) elif z <= 6.5e-12: tmp = (y / (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(z * Float64(z / y))); elseif (z <= 6.5e-12) tmp = Float64(Float64(y / Float64(z / x)) / z); else tmp = Float64(Float64(y / z) / Float64(z * Float64(z / x))); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z)
tmp = 0.0;
if (z <= -1.0)
tmp = (x / z) / (z * (z / y));
elseif (z <= 6.5e-12)
tmp = (y / (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[(z * N[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 6.5e-12], N[(N[(y / N[(z / x), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], N[(N[(y / z), $MachinePrecision] / N[(z * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1:\\
\;\;\;\;\frac{\frac{x}{z}}{z \cdot \frac{z}{y}}\\
\mathbf{elif}\;z \leq 6.5 \cdot 10^{-12}:\\
\;\;\;\;\frac{\frac{y}{\frac{z}{x}}}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{y}{z}}{z \cdot \frac{z}{x}}\\
\end{array}
\end{array}
if z < -1Initial program 87.8%
associate-*l*87.8%
times-frac96.3%
distribute-lft-in96.3%
fma-def96.3%
*-rgt-identity96.3%
Simplified96.3%
Taylor expanded in z around inf 95.0%
unpow295.0%
Simplified95.0%
clear-num94.1%
un-div-inv94.1%
associate-/l*95.6%
Applied egg-rr95.6%
associate-/r/95.6%
Applied egg-rr95.6%
if -1 < z < 6.5000000000000002e-12Initial program 82.0%
associate-*l*82.0%
times-frac97.3%
distribute-lft-in97.3%
fma-def97.3%
*-rgt-identity97.3%
Simplified97.3%
Taylor expanded in z around 0 80.7%
unpow280.7%
associate-/l*84.5%
associate-/l*91.1%
Simplified91.1%
associate-/r/91.1%
Applied egg-rr91.1%
associate-*l/84.5%
associate-/r/77.9%
Applied egg-rr77.9%
associate-/r*87.0%
associate-/r/96.1%
associate-/l/91.1%
associate-/r*96.5%
Applied egg-rr96.5%
if 6.5000000000000002e-12 < z Initial program 86.3%
associate-*l*86.3%
times-frac95.1%
distribute-lft-in95.1%
fma-def95.1%
*-rgt-identity95.1%
Simplified95.1%
Taylor expanded in z around inf 94.1%
unpow294.1%
Simplified94.1%
clear-num94.1%
associate-/r*97.7%
frac-times95.2%
*-un-lft-identity95.2%
*-commutative95.2%
Applied egg-rr95.2%
Final simplification95.9%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z) :precision binary64 (if (<= z -5.9e-61) (* (/ y (+ 1.0 z)) (/ x (* z z))) (if (<= z 6.5e-12) (/ (/ y (/ z x)) z) (/ (/ y z) (* z (/ z x))))))
assert(x < y);
double code(double x, double y, double z) {
double tmp;
if (z <= -5.9e-61) {
tmp = (y / (1.0 + z)) * (x / (z * z));
} else if (z <= 6.5e-12) {
tmp = (y / (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 <= (-5.9d-61)) then
tmp = (y / (1.0d0 + z)) * (x / (z * z))
else if (z <= 6.5d-12) then
tmp = (y / (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 <= -5.9e-61) {
tmp = (y / (1.0 + z)) * (x / (z * z));
} else if (z <= 6.5e-12) {
tmp = (y / (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 <= -5.9e-61: tmp = (y / (1.0 + z)) * (x / (z * z)) elif z <= 6.5e-12: tmp = (y / (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 <= -5.9e-61) tmp = Float64(Float64(y / Float64(1.0 + z)) * Float64(x / Float64(z * z))); elseif (z <= 6.5e-12) tmp = Float64(Float64(y / Float64(z / x)) / z); else tmp = Float64(Float64(y / z) / Float64(z * Float64(z / x))); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z)
tmp = 0.0;
if (z <= -5.9e-61)
tmp = (y / (1.0 + z)) * (x / (z * z));
elseif (z <= 6.5e-12)
tmp = (y / (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, -5.9e-61], N[(N[(y / N[(1.0 + z), $MachinePrecision]), $MachinePrecision] * N[(x / N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 6.5e-12], N[(N[(y / N[(z / x), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], N[(N[(y / z), $MachinePrecision] / N[(z * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.9 \cdot 10^{-61}:\\
\;\;\;\;\frac{y}{1 + z} \cdot \frac{x}{z \cdot z}\\
\mathbf{elif}\;z \leq 6.5 \cdot 10^{-12}:\\
\;\;\;\;\frac{\frac{y}{\frac{z}{x}}}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{y}{z}}{z \cdot \frac{z}{x}}\\
\end{array}
\end{array}
if z < -5.89999999999999972e-61Initial program 88.2%
times-frac96.0%
Simplified96.0%
if -5.89999999999999972e-61 < z < 6.5000000000000002e-12Initial program 81.2%
associate-*l*81.1%
times-frac97.1%
distribute-lft-in97.1%
fma-def97.1%
*-rgt-identity97.1%
Simplified97.1%
Taylor expanded in z around 0 81.1%
unpow281.1%
associate-/l*84.3%
associate-/l*91.6%
Simplified91.6%
associate-/r/91.7%
Applied egg-rr91.7%
associate-*l/84.3%
associate-/r/77.1%
Applied egg-rr77.1%
associate-/r*87.1%
associate-/r/97.1%
associate-/l/91.7%
associate-/r*97.9%
Applied egg-rr97.9%
if 6.5000000000000002e-12 < z Initial program 86.3%
associate-*l*86.3%
times-frac95.1%
distribute-lft-in95.1%
fma-def95.1%
*-rgt-identity95.1%
Simplified95.1%
Taylor expanded in z around inf 94.1%
unpow294.1%
Simplified94.1%
clear-num94.1%
associate-/r*97.7%
frac-times95.2%
*-un-lft-identity95.2%
*-commutative95.2%
Applied egg-rr95.2%
Final simplification96.6%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z) :precision binary64 (/ 1.0 (/ (+ 1.0 z) (* (/ x z) (/ y z)))))
assert(x < y);
double code(double x, double y, double z) {
return 1.0 / ((1.0 + z) / ((x / z) * (y / z)));
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = 1.0d0 / ((1.0d0 + z) / ((x / z) * (y / z)))
end function
assert x < y;
public static double code(double x, double y, double z) {
return 1.0 / ((1.0 + z) / ((x / z) * (y / z)));
}
[x, y] = sort([x, y]) def code(x, y, z): return 1.0 / ((1.0 + z) / ((x / z) * (y / z)))
x, y = sort([x, y]) function code(x, y, z) return Float64(1.0 / Float64(Float64(1.0 + z) / Float64(Float64(x / z) * Float64(y / z)))) end
x, y = num2cell(sort([x, y])){:}
function tmp = code(x, y, z)
tmp = 1.0 / ((1.0 + z) / ((x / z) * (y / z)));
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_] := N[(1.0 / N[(N[(1.0 + z), $MachinePrecision] / N[(N[(x / z), $MachinePrecision] * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\frac{1}{\frac{1 + z}{\frac{x}{z} \cdot \frac{y}{z}}}
\end{array}
Initial program 84.8%
associate-*l*84.8%
times-frac96.4%
distribute-lft-in96.4%
fma-def96.4%
*-rgt-identity96.4%
Simplified96.4%
fma-udef96.4%
*-rgt-identity96.4%
distribute-lft-in96.4%
times-frac84.8%
associate-*l*84.8%
associate-/r*86.3%
clear-num86.1%
associate-*l/90.9%
associate-*l/86.1%
times-frac98.1%
Applied egg-rr98.1%
Final simplification98.1%
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(z * Float64(Float64(1.0 + 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[(z * N[(N[(1.0 + z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\frac{\frac{x}{z}}{z \cdot \frac{1 + z}{y}}
\end{array}
Initial program 84.8%
associate-*l*84.8%
times-frac96.4%
distribute-lft-in96.4%
fma-def96.4%
*-rgt-identity96.4%
Simplified96.4%
*-commutative96.4%
associate-*l/95.6%
fma-udef95.7%
distribute-lft1-in95.6%
frac-times94.7%
clear-num94.6%
frac-times97.9%
*-un-lft-identity97.9%
Applied egg-rr97.9%
Final simplification97.9%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z) :precision binary64 (if (<= y 3.1e-6) (* (/ x z) (/ y z)) (* y (/ x (* z z)))))
assert(x < y);
double code(double x, double y, double z) {
double tmp;
if (y <= 3.1e-6) {
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 <= 3.1d-6) 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 <= 3.1e-6) {
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 <= 3.1e-6: 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 <= 3.1e-6) 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 <= 3.1e-6)
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, 3.1e-6], 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 3.1 \cdot 10^{-6}:\\
\;\;\;\;\frac{x}{z} \cdot \frac{y}{z}\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{x}{z \cdot z}\\
\end{array}
\end{array}
if y < 3.1e-6Initial program 83.6%
associate-*l*83.6%
times-frac96.9%
distribute-lft-in96.9%
fma-def96.9%
*-rgt-identity96.9%
Simplified96.9%
Taylor expanded in z around 0 66.2%
unpow266.2%
associate-/l/67.9%
associate-*r/72.7%
associate-*l/75.0%
Simplified75.0%
if 3.1e-6 < y Initial program 89.3%
times-frac93.0%
Simplified93.0%
Taylor expanded in z around 0 79.0%
Final simplification75.8%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z) :precision binary64 (if (<= x -2.5e+18) (* x (/ y (* z z))) (* (/ x z) (/ y z))))
assert(x < y);
double code(double x, double y, double z) {
double tmp;
if (x <= -2.5e+18) {
tmp = x * (y / (z * z));
} else {
tmp = (x / z) * (y / z);
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (x <= (-2.5d+18)) then
tmp = x * (y / (z * z))
else
tmp = (x / z) * (y / z)
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z) {
double tmp;
if (x <= -2.5e+18) {
tmp = x * (y / (z * z));
} else {
tmp = (x / z) * (y / z);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z): tmp = 0 if x <= -2.5e+18: tmp = x * (y / (z * z)) else: tmp = (x / z) * (y / z) return tmp
x, y = sort([x, y]) function code(x, y, z) tmp = 0.0 if (x <= -2.5e+18) tmp = Float64(x * Float64(y / Float64(z * z))); else tmp = Float64(Float64(x / z) * Float64(y / z)); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z)
tmp = 0.0;
if (x <= -2.5e+18)
tmp = x * (y / (z * z));
else
tmp = (x / z) * (y / z);
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_] := If[LessEqual[x, -2.5e+18], N[(x * N[(y / N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / z), $MachinePrecision] * N[(y / z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.5 \cdot 10^{+18}:\\
\;\;\;\;x \cdot \frac{y}{z \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{z} \cdot \frac{y}{z}\\
\end{array}
\end{array}
if x < -2.5e18Initial program 90.5%
associate-*l*90.5%
times-frac98.2%
distribute-lft-in98.2%
fma-def98.2%
*-rgt-identity98.2%
Simplified98.2%
Taylor expanded in z around 0 70.7%
unpow270.7%
associate-/l*72.7%
associate-/l*72.6%
Simplified72.6%
associate-/r/72.5%
Applied egg-rr72.5%
associate-*l/72.7%
associate-/r/76.4%
Applied egg-rr76.4%
if -2.5e18 < x Initial program 83.4%
associate-*l*83.4%
times-frac95.9%
distribute-lft-in96.0%
fma-def96.0%
*-rgt-identity96.0%
Simplified96.0%
Taylor expanded in z around 0 67.5%
unpow267.5%
associate-/l/69.0%
associate-*r/73.7%
associate-*l/74.1%
Simplified74.1%
Final simplification74.6%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z) :precision binary64 (if (<= x -1.4e-119) (/ x (* z (/ z y))) (* y (/ (/ x z) z))))
assert(x < y);
double code(double x, double y, double z) {
double tmp;
if (x <= -1.4e-119) {
tmp = x / (z * (z / y));
} else {
tmp = y * ((x / z) / z);
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (x <= (-1.4d-119)) then
tmp = x / (z * (z / y))
else
tmp = y * ((x / z) / z)
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z) {
double tmp;
if (x <= -1.4e-119) {
tmp = x / (z * (z / y));
} else {
tmp = y * ((x / z) / z);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z): tmp = 0 if x <= -1.4e-119: tmp = x / (z * (z / y)) else: tmp = y * ((x / z) / z) return tmp
x, y = sort([x, y]) function code(x, y, z) tmp = 0.0 if (x <= -1.4e-119) tmp = Float64(x / Float64(z * Float64(z / y))); else tmp = Float64(y * Float64(Float64(x / z) / z)); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z)
tmp = 0.0;
if (x <= -1.4e-119)
tmp = x / (z * (z / y));
else
tmp = y * ((x / z) / z);
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_] := If[LessEqual[x, -1.4e-119], N[(x / N[(z * N[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * N[(N[(x / z), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.4 \cdot 10^{-119}:\\
\;\;\;\;\frac{x}{z \cdot \frac{z}{y}}\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{\frac{x}{z}}{z}\\
\end{array}
\end{array}
if x < -1.4e-119Initial program 86.9%
/-rgt-identity86.9%
associate-/l*86.9%
associate-/l/89.3%
associate-*l*90.5%
associate-*r/90.6%
*-rgt-identity90.6%
associate-*l*96.4%
associate-*r/94.1%
distribute-lft-in94.2%
fma-def94.2%
*-rgt-identity94.2%
Simplified94.2%
Taylor expanded in z around 0 66.9%
if -1.4e-119 < x Initial program 83.8%
times-frac89.7%
Simplified89.7%
Taylor expanded in z around 0 76.1%
Taylor expanded in x around 0 76.1%
unpow289.7%
associate-/l/95.0%
Simplified78.6%
Final simplification74.9%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z) :precision binary64 (if (<= x -4.2e-120) (/ x (* z (/ z y))) (/ y (* z (/ z x)))))
assert(x < y);
double code(double x, double y, double z) {
double tmp;
if (x <= -4.2e-120) {
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 <= (-4.2d-120)) 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 <= -4.2e-120) {
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 <= -4.2e-120: 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 <= -4.2e-120) 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 <= -4.2e-120)
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, -4.2e-120], 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 -4.2 \cdot 10^{-120}:\\
\;\;\;\;\frac{x}{z \cdot \frac{z}{y}}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{z \cdot \frac{z}{x}}\\
\end{array}
\end{array}
if x < -4.2000000000000001e-120Initial program 86.9%
/-rgt-identity86.9%
associate-/l*86.9%
associate-/l/89.3%
associate-*l*90.5%
associate-*r/90.6%
*-rgt-identity90.6%
associate-*l*96.4%
associate-*r/94.1%
distribute-lft-in94.2%
fma-def94.2%
*-rgt-identity94.2%
Simplified94.2%
Taylor expanded in z around 0 66.9%
if -4.2000000000000001e-120 < x Initial program 83.8%
associate-*l*83.8%
times-frac96.4%
distribute-lft-in96.4%
fma-def96.4%
*-rgt-identity96.4%
Simplified96.4%
Taylor expanded in z around 0 69.9%
unpow269.9%
associate-/l*76.1%
associate-/l*79.7%
Simplified79.7%
associate-/r/79.8%
Applied egg-rr79.8%
Final simplification75.7%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z) :precision binary64 (if (<= x -6e+20) (* x (/ y (* z z))) (/ (/ y (/ z x)) z)))
assert(x < y);
double code(double x, double y, double z) {
double tmp;
if (x <= -6e+20) {
tmp = x * (y / (z * z));
} else {
tmp = (y / (z / x)) / z;
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (x <= (-6d+20)) then
tmp = x * (y / (z * z))
else
tmp = (y / (z / x)) / z
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z) {
double tmp;
if (x <= -6e+20) {
tmp = x * (y / (z * z));
} else {
tmp = (y / (z / x)) / z;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z): tmp = 0 if x <= -6e+20: tmp = x * (y / (z * z)) else: tmp = (y / (z / x)) / z return tmp
x, y = sort([x, y]) function code(x, y, z) tmp = 0.0 if (x <= -6e+20) tmp = Float64(x * Float64(y / Float64(z * z))); else tmp = Float64(Float64(y / Float64(z / x)) / z); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z)
tmp = 0.0;
if (x <= -6e+20)
tmp = x * (y / (z * z));
else
tmp = (y / (z / x)) / z;
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_] := If[LessEqual[x, -6e+20], N[(x * N[(y / N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y / N[(z / x), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -6 \cdot 10^{+20}:\\
\;\;\;\;x \cdot \frac{y}{z \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{y}{\frac{z}{x}}}{z}\\
\end{array}
\end{array}
if x < -6e20Initial program 90.5%
associate-*l*90.5%
times-frac98.2%
distribute-lft-in98.2%
fma-def98.2%
*-rgt-identity98.2%
Simplified98.2%
Taylor expanded in z around 0 70.7%
unpow270.7%
associate-/l*72.7%
associate-/l*72.6%
Simplified72.6%
associate-/r/72.5%
Applied egg-rr72.5%
associate-*l/72.7%
associate-/r/76.4%
Applied egg-rr76.4%
if -6e20 < x Initial program 83.4%
associate-*l*83.4%
times-frac95.9%
distribute-lft-in96.0%
fma-def96.0%
*-rgt-identity96.0%
Simplified96.0%
Taylor expanded in z around 0 67.5%
unpow267.5%
associate-/l*72.9%
associate-/l*76.0%
Simplified76.0%
associate-/r/76.0%
Applied egg-rr76.0%
associate-*l/72.9%
associate-/r/68.6%
Applied egg-rr68.6%
associate-/r*69.4%
associate-/r/75.1%
associate-/l/76.0%
associate-/r*74.6%
Applied egg-rr74.6%
Final simplification74.9%
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 84.8%
times-frac90.7%
Simplified90.7%
Taylor expanded in z around 0 72.9%
Final simplification72.9%
(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 2023196
(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))))