
(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 18 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z) :precision binary64 (/ (* x y) (* (* z z) (+ z 1.0))))
double code(double x, double y, double z) {
return (x * y) / ((z * z) * (z + 1.0));
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = (x * y) / ((z * z) * (z + 1.0d0))
end function
public static double code(double x, double y, double z) {
return (x * y) / ((z * z) * (z + 1.0));
}
def code(x, y, z): return (x * y) / ((z * z) * (z + 1.0))
function code(x, y, z) return Float64(Float64(x * y) / Float64(Float64(z * z) * Float64(z + 1.0))) end
function tmp = code(x, y, z) tmp = (x * y) / ((z * z) * (z + 1.0)); end
code[x_, y_, z_] := N[(N[(x * y), $MachinePrecision] / N[(N[(z * z), $MachinePrecision] * N[(z + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x \cdot y}{\left(z \cdot z\right) \cdot \left(z + 1\right)}
\end{array}
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z) :precision binary64 (/ (* (/ y (+ z 1.0)) (/ x z)) z))
assert(x < y);
double code(double x, double y, double z) {
return ((y / (z + 1.0)) * (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 / (z + 1.0d0)) * (x / z)) / z
end function
assert x < y;
public static double code(double x, double y, double z) {
return ((y / (z + 1.0)) * (x / z)) / z;
}
[x, y] = sort([x, y]) def code(x, y, z): return ((y / (z + 1.0)) * (x / z)) / z
x, y = sort([x, y]) function code(x, y, z) return Float64(Float64(Float64(y / Float64(z + 1.0)) * Float64(x / z)) / z) end
x, y = num2cell(sort([x, y])){:}
function tmp = code(x, y, z)
tmp = ((y / (z + 1.0)) * (x / z)) / z;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_] := N[(N[(N[(y / N[(z + 1.0), $MachinePrecision]), $MachinePrecision] * N[(x / z), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\frac{\frac{y}{z + 1} \cdot \frac{x}{z}}{z}
\end{array}
Initial program 84.3%
associate-*l*84.3%
times-frac94.2%
distribute-lft-in94.2%
fma-def94.2%
*-rgt-identity94.2%
Simplified94.2%
*-commutative94.2%
associate-*l/95.7%
fma-udef95.7%
distribute-lft1-in95.7%
frac-times92.2%
associate-*r/97.6%
Applied egg-rr97.6%
Final simplification97.6%
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 -400000000000.0)
(/ (/ (* x (/ y z)) z) z)
(if (<= t_0 2e-51)
(/ (* y (/ x z)) z)
(* (/ y (+ z 1.0)) (/ x (* z z)))))))assert(x < y);
double code(double x, double y, double z) {
double t_0 = (z + 1.0) * (z * z);
double tmp;
if (t_0 <= -400000000000.0) {
tmp = ((x * (y / z)) / z) / z;
} else if (t_0 <= 2e-51) {
tmp = (y * (x / z)) / z;
} else {
tmp = (y / (z + 1.0)) * (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) :: t_0
real(8) :: tmp
t_0 = (z + 1.0d0) * (z * z)
if (t_0 <= (-400000000000.0d0)) then
tmp = ((x * (y / z)) / z) / z
else if (t_0 <= 2d-51) then
tmp = (y * (x / z)) / z
else
tmp = (y / (z + 1.0d0)) * (x / (z * z))
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 <= -400000000000.0) {
tmp = ((x * (y / z)) / z) / z;
} else if (t_0 <= 2e-51) {
tmp = (y * (x / z)) / z;
} else {
tmp = (y / (z + 1.0)) * (x / (z * z));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z): t_0 = (z + 1.0) * (z * z) tmp = 0 if t_0 <= -400000000000.0: tmp = ((x * (y / z)) / z) / z elif t_0 <= 2e-51: tmp = (y * (x / z)) / z else: tmp = (y / (z + 1.0)) * (x / (z * z)) 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 <= -400000000000.0) tmp = Float64(Float64(Float64(x * Float64(y / z)) / z) / z); elseif (t_0 <= 2e-51) tmp = Float64(Float64(y * Float64(x / z)) / z); else tmp = Float64(Float64(y / Float64(z + 1.0)) * Float64(x / Float64(z * z))); 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 <= -400000000000.0)
tmp = ((x * (y / z)) / z) / z;
elseif (t_0 <= 2e-51)
tmp = (y * (x / z)) / z;
else
tmp = (y / (z + 1.0)) * (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_] := Block[{t$95$0 = N[(N[(z + 1.0), $MachinePrecision] * N[(z * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -400000000000.0], N[(N[(N[(x * N[(y / z), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[t$95$0, 2e-51], N[(N[(y * N[(x / z), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], N[(N[(y / N[(z + 1.0), $MachinePrecision]), $MachinePrecision] * N[(x / N[(z * z), $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 -400000000000:\\
\;\;\;\;\frac{\frac{x \cdot \frac{y}{z}}{z}}{z}\\
\mathbf{elif}\;t_0 \leq 2 \cdot 10^{-51}:\\
\;\;\;\;\frac{y \cdot \frac{x}{z}}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{z + 1} \cdot \frac{x}{z \cdot z}\\
\end{array}
\end{array}
if (*.f64 (*.f64 z z) (+.f64 z 1)) < -4e11Initial program 82.1%
associate-*l*82.1%
times-frac93.1%
distribute-lft-in93.1%
fma-def93.1%
*-rgt-identity93.1%
Simplified93.1%
associate-*r/93.1%
fma-udef93.1%
*-rgt-identity93.1%
distribute-lft-in93.1%
frac-times94.8%
associate-/r*90.9%
associate-*l/91.9%
associate-/r*95.9%
associate-*r/90.2%
*-commutative90.2%
Applied egg-rr90.2%
Taylor expanded in z around inf 87.5%
associate-*l/93.3%
*-commutative93.3%
Simplified93.3%
if -4e11 < (*.f64 (*.f64 z z) (+.f64 z 1)) < 2e-51Initial program 84.5%
times-frac82.0%
Simplified82.0%
Taylor expanded in z around 0 82.0%
*-commutative82.0%
associate-/r*88.2%
associate-*r/97.4%
Applied egg-rr97.4%
if 2e-51 < (*.f64 (*.f64 z z) (+.f64 z 1)) Initial program 86.2%
times-frac93.7%
Simplified93.7%
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 (* (+ z 1.0) (* z z))))
(if (<= t_0 -400000000000.0)
(/ (/ (* x (/ y z)) z) z)
(if (<= t_0 5e-197)
(/ (* y (/ x z)) z)
(/ (* (/ y (+ z 1.0)) x) (* z z))))))assert(x < y);
double code(double x, double y, double z) {
double t_0 = (z + 1.0) * (z * z);
double tmp;
if (t_0 <= -400000000000.0) {
tmp = ((x * (y / z)) / z) / z;
} else if (t_0 <= 5e-197) {
tmp = (y * (x / z)) / z;
} else {
tmp = ((y / (z + 1.0)) * 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) :: t_0
real(8) :: tmp
t_0 = (z + 1.0d0) * (z * z)
if (t_0 <= (-400000000000.0d0)) then
tmp = ((x * (y / z)) / z) / z
else if (t_0 <= 5d-197) then
tmp = (y * (x / z)) / z
else
tmp = ((y / (z + 1.0d0)) * x) / (z * z)
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 <= -400000000000.0) {
tmp = ((x * (y / z)) / z) / z;
} else if (t_0 <= 5e-197) {
tmp = (y * (x / z)) / z;
} else {
tmp = ((y / (z + 1.0)) * x) / (z * z);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z): t_0 = (z + 1.0) * (z * z) tmp = 0 if t_0 <= -400000000000.0: tmp = ((x * (y / z)) / z) / z elif t_0 <= 5e-197: tmp = (y * (x / z)) / z else: tmp = ((y / (z + 1.0)) * x) / (z * z) 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 <= -400000000000.0) tmp = Float64(Float64(Float64(x * Float64(y / z)) / z) / z); elseif (t_0 <= 5e-197) tmp = Float64(Float64(y * Float64(x / z)) / z); else tmp = Float64(Float64(Float64(y / Float64(z + 1.0)) * x) / Float64(z * z)); 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 <= -400000000000.0)
tmp = ((x * (y / z)) / z) / z;
elseif (t_0 <= 5e-197)
tmp = (y * (x / z)) / z;
else
tmp = ((y / (z + 1.0)) * 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_] := Block[{t$95$0 = N[(N[(z + 1.0), $MachinePrecision] * N[(z * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -400000000000.0], N[(N[(N[(x * N[(y / z), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[t$95$0, 5e-197], N[(N[(y * N[(x / z), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], N[(N[(N[(y / N[(z + 1.0), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision] / N[(z * z), $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 -400000000000:\\
\;\;\;\;\frac{\frac{x \cdot \frac{y}{z}}{z}}{z}\\
\mathbf{elif}\;t_0 \leq 5 \cdot 10^{-197}:\\
\;\;\;\;\frac{y \cdot \frac{x}{z}}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{y}{z + 1} \cdot x}{z \cdot z}\\
\end{array}
\end{array}
if (*.f64 (*.f64 z z) (+.f64 z 1)) < -4e11Initial program 82.1%
associate-*l*82.1%
times-frac93.1%
distribute-lft-in93.1%
fma-def93.1%
*-rgt-identity93.1%
Simplified93.1%
associate-*r/93.1%
fma-udef93.1%
*-rgt-identity93.1%
distribute-lft-in93.1%
frac-times94.8%
associate-/r*90.9%
associate-*l/91.9%
associate-/r*95.9%
associate-*r/90.2%
*-commutative90.2%
Applied egg-rr90.2%
Taylor expanded in z around inf 87.5%
associate-*l/93.3%
*-commutative93.3%
Simplified93.3%
if -4e11 < (*.f64 (*.f64 z z) (+.f64 z 1)) < 5.0000000000000002e-197Initial program 77.6%
times-frac77.0%
Simplified77.0%
Taylor expanded in z around 0 77.0%
*-commutative77.0%
associate-/r*86.1%
associate-*r/97.5%
Applied egg-rr97.5%
if 5.0000000000000002e-197 < (*.f64 (*.f64 z z) (+.f64 z 1)) Initial program 91.0%
associate-*l*91.1%
times-frac93.2%
distribute-lft-in93.2%
fma-def93.2%
*-rgt-identity93.2%
Simplified93.2%
*-commutative93.2%
associate-*l/96.1%
fma-udef96.1%
distribute-lft1-in96.0%
frac-times95.1%
associate-/r*93.3%
associate-*r/96.8%
Applied egg-rr96.8%
Final simplification96.1%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z) :precision binary64 (if (or (<= z -1.0) (not (<= z 1.0))) (* (/ x z) (/ y (* z z))) (/ (* y (/ x z)) z)))
assert(x < y);
double code(double x, double y, double z) {
double tmp;
if ((z <= -1.0) || !(z <= 1.0)) {
tmp = (x / z) * (y / (z * z));
} else {
tmp = (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 ((z <= (-1.0d0)) .or. (.not. (z <= 1.0d0))) then
tmp = (x / z) * (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 ((z <= -1.0) || !(z <= 1.0)) {
tmp = (x / z) * (y / (z * z));
} else {
tmp = (y * (x / z)) / z;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z): tmp = 0 if (z <= -1.0) or not (z <= 1.0): tmp = (x / z) * (y / (z * z)) else: tmp = (y * (x / z)) / z return tmp
x, y = sort([x, y]) function code(x, y, z) tmp = 0.0 if ((z <= -1.0) || !(z <= 1.0)) tmp = Float64(Float64(x / z) * Float64(y / Float64(z * z))); else tmp = Float64(Float64(y * 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 ((z <= -1.0) || ~((z <= 1.0)))
tmp = (x / z) * (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[Or[LessEqual[z, -1.0], N[Not[LessEqual[z, 1.0]], $MachinePrecision]], N[(N[(x / z), $MachinePrecision] * N[(y / N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y * N[(x / z), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1 \lor \neg \left(z \leq 1\right):\\
\;\;\;\;\frac{x}{z} \cdot \frac{y}{z \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{y \cdot \frac{x}{z}}{z}\\
\end{array}
\end{array}
if z < -1 or 1 < z Initial program 83.1%
associate-*l*83.1%
times-frac92.9%
distribute-lft-in92.9%
fma-def92.9%
*-rgt-identity92.9%
Simplified92.9%
Taylor expanded in z around inf 90.6%
unpow290.6%
Simplified90.6%
if -1 < z < 1Initial program 85.4%
times-frac83.1%
Simplified83.1%
Taylor expanded in z around 0 80.9%
*-commutative80.9%
associate-/r*86.7%
associate-*r/95.4%
Applied egg-rr95.4%
Final simplification93.0%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z) :precision binary64 (if (or (<= z -1.0) (not (<= z 1.0))) (* (/ x z) (/ (/ y z) z)) (/ (* y (/ x z)) z)))
assert(x < y);
double code(double x, double y, double z) {
double tmp;
if ((z <= -1.0) || !(z <= 1.0)) {
tmp = (x / z) * ((y / z) / z);
} else {
tmp = (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 ((z <= (-1.0d0)) .or. (.not. (z <= 1.0d0))) then
tmp = (x / z) * ((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 ((z <= -1.0) || !(z <= 1.0)) {
tmp = (x / z) * ((y / z) / z);
} else {
tmp = (y * (x / z)) / z;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z): tmp = 0 if (z <= -1.0) or not (z <= 1.0): tmp = (x / z) * ((y / z) / z) else: tmp = (y * (x / z)) / z return tmp
x, y = sort([x, y]) function code(x, y, z) tmp = 0.0 if ((z <= -1.0) || !(z <= 1.0)) tmp = Float64(Float64(x / z) * Float64(Float64(y / z) / z)); else tmp = Float64(Float64(y * 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 ((z <= -1.0) || ~((z <= 1.0)))
tmp = (x / z) * ((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[Or[LessEqual[z, -1.0], N[Not[LessEqual[z, 1.0]], $MachinePrecision]], N[(N[(x / z), $MachinePrecision] * N[(N[(y / z), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], N[(N[(y * N[(x / z), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1 \lor \neg \left(z \leq 1\right):\\
\;\;\;\;\frac{x}{z} \cdot \frac{\frac{y}{z}}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{y \cdot \frac{x}{z}}{z}\\
\end{array}
\end{array}
if z < -1 or 1 < z Initial program 83.1%
associate-*l*83.1%
times-frac92.9%
distribute-lft-in92.9%
fma-def92.9%
*-rgt-identity92.9%
Simplified92.9%
Taylor expanded in z around inf 90.6%
unpow290.6%
associate-/r*93.6%
Simplified93.6%
if -1 < z < 1Initial program 85.4%
times-frac83.1%
Simplified83.1%
Taylor expanded in z around 0 80.9%
*-commutative80.9%
associate-/r*86.7%
associate-*r/95.4%
Applied egg-rr95.4%
Final simplification94.5%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z) :precision binary64 (if (or (<= z -1.0) (not (<= z 1.0))) (/ (/ (* x (/ y z)) z) z) (/ (* y (/ x z)) z)))
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 = (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 ((z <= (-1.0d0)) .or. (.not. (z <= 1.0d0))) then
tmp = ((x * (y / z)) / 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 ((z <= -1.0) || !(z <= 1.0)) {
tmp = ((x * (y / z)) / z) / z;
} else {
tmp = (y * (x / z)) / z;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z): tmp = 0 if (z <= -1.0) or not (z <= 1.0): tmp = ((x * (y / z)) / z) / z else: tmp = (y * (x / z)) / z return tmp
x, y = sort([x, y]) function code(x, y, z) tmp = 0.0 if ((z <= -1.0) || !(z <= 1.0)) tmp = Float64(Float64(Float64(x * Float64(y / z)) / z) / z); else tmp = Float64(Float64(y * 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 ((z <= -1.0) || ~((z <= 1.0)))
tmp = ((x * (y / z)) / 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[Or[LessEqual[z, -1.0], N[Not[LessEqual[z, 1.0]], $MachinePrecision]], N[(N[(N[(x * N[(y / z), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision] / z), $MachinePrecision], N[(N[(y * N[(x / z), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1 \lor \neg \left(z \leq 1\right):\\
\;\;\;\;\frac{\frac{x \cdot \frac{y}{z}}{z}}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{y \cdot \frac{x}{z}}{z}\\
\end{array}
\end{array}
if z < -1 or 1 < z Initial program 83.1%
associate-*l*83.1%
times-frac92.9%
distribute-lft-in92.9%
fma-def92.9%
*-rgt-identity92.9%
Simplified92.9%
associate-*r/93.9%
fma-udef93.9%
*-rgt-identity93.9%
distribute-lft-in93.9%
frac-times95.4%
associate-/r*91.8%
associate-*l/93.2%
associate-/r*96.9%
associate-*r/89.9%
*-commutative89.9%
Applied egg-rr89.9%
Taylor expanded in z around inf 87.7%
associate-*l/94.6%
*-commutative94.6%
Simplified94.6%
if -1 < z < 1Initial program 85.4%
times-frac83.1%
Simplified83.1%
Taylor expanded in z around 0 80.9%
*-commutative80.9%
associate-/r*86.7%
associate-*r/95.4%
Applied egg-rr95.4%
Final simplification95.0%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* y (/ x z))))
(if (<= z -1.0)
(* (/ x z) (/ (/ y z) z))
(if (<= z 1.0) (/ t_0 z) (/ t_0 (* z z))))))assert(x < y);
double code(double x, double y, double z) {
double t_0 = y * (x / z);
double tmp;
if (z <= -1.0) {
tmp = (x / z) * ((y / z) / z);
} else if (z <= 1.0) {
tmp = t_0 / z;
} else {
tmp = t_0 / (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) :: t_0
real(8) :: tmp
t_0 = y * (x / z)
if (z <= (-1.0d0)) then
tmp = (x / z) * ((y / z) / z)
else if (z <= 1.0d0) then
tmp = t_0 / z
else
tmp = t_0 / (z * z)
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z) {
double t_0 = y * (x / z);
double tmp;
if (z <= -1.0) {
tmp = (x / z) * ((y / z) / z);
} else if (z <= 1.0) {
tmp = t_0 / z;
} else {
tmp = t_0 / (z * z);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z): t_0 = y * (x / z) tmp = 0 if z <= -1.0: tmp = (x / z) * ((y / z) / z) elif z <= 1.0: tmp = t_0 / z else: tmp = t_0 / (z * z) return tmp
x, y = sort([x, y]) function code(x, y, z) t_0 = Float64(y * Float64(x / z)) tmp = 0.0 if (z <= -1.0) tmp = Float64(Float64(x / z) * Float64(Float64(y / z) / z)); elseif (z <= 1.0) tmp = Float64(t_0 / z); else tmp = Float64(t_0 / Float64(z * z)); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z)
t_0 = y * (x / z);
tmp = 0.0;
if (z <= -1.0)
tmp = (x / z) * ((y / z) / z);
elseif (z <= 1.0)
tmp = t_0 / z;
else
tmp = t_0 / (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_] := Block[{t$95$0 = N[(y * N[(x / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.0], N[(N[(x / z), $MachinePrecision] * N[(N[(y / z), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.0], N[(t$95$0 / z), $MachinePrecision], N[(t$95$0 / N[(z * z), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_0 := y \cdot \frac{x}{z}\\
\mathbf{if}\;z \leq -1:\\
\;\;\;\;\frac{x}{z} \cdot \frac{\frac{y}{z}}{z}\\
\mathbf{elif}\;z \leq 1:\\
\;\;\;\;\frac{t_0}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{t_0}{z \cdot z}\\
\end{array}
\end{array}
if z < -1Initial program 82.1%
associate-*l*82.1%
times-frac93.1%
distribute-lft-in93.1%
fma-def93.1%
*-rgt-identity93.1%
Simplified93.1%
Taylor expanded in z around inf 90.4%
unpow290.4%
associate-/r*94.4%
Simplified94.4%
if -1 < z < 1Initial program 85.4%
times-frac83.1%
Simplified83.1%
Taylor expanded in z around 0 80.9%
*-commutative80.9%
associate-/r*86.7%
associate-*r/95.4%
Applied egg-rr95.4%
if 1 < z Initial program 84.3%
associate-*l*84.4%
times-frac92.7%
distribute-lft-in92.7%
fma-def92.7%
*-rgt-identity92.7%
Simplified92.7%
Taylor expanded in z around inf 90.9%
unpow290.9%
Simplified90.9%
associate-*r/93.0%
Applied egg-rr93.0%
Final simplification94.6%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z) :precision binary64 (if (<= z -1.0) (* (/ x z) (/ (/ y z) z)) (if (<= z 1.0) (/ (* y (/ x z)) z) (/ (* x (/ y z)) (* z z)))))
assert(x < y);
double code(double x, double y, double z) {
double tmp;
if (z <= -1.0) {
tmp = (x / z) * ((y / z) / z);
} else if (z <= 1.0) {
tmp = (y * (x / z)) / z;
} else {
tmp = (x * (y / z)) / (z * z);
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (z <= (-1.0d0)) then
tmp = (x / z) * ((y / z) / z)
else if (z <= 1.0d0) then
tmp = (y * (x / z)) / z
else
tmp = (x * (y / z)) / (z * z)
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z) {
double tmp;
if (z <= -1.0) {
tmp = (x / z) * ((y / z) / z);
} else if (z <= 1.0) {
tmp = (y * (x / z)) / z;
} else {
tmp = (x * (y / z)) / (z * z);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z): tmp = 0 if z <= -1.0: tmp = (x / z) * ((y / z) / z) elif z <= 1.0: tmp = (y * (x / z)) / z else: tmp = (x * (y / z)) / (z * z) return tmp
x, y = sort([x, y]) function code(x, y, z) tmp = 0.0 if (z <= -1.0) tmp = Float64(Float64(x / z) * Float64(Float64(y / z) / z)); elseif (z <= 1.0) tmp = Float64(Float64(y * Float64(x / z)) / z); else tmp = Float64(Float64(x * Float64(y / z)) / Float64(z * z)); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z)
tmp = 0.0;
if (z <= -1.0)
tmp = (x / z) * ((y / z) / z);
elseif (z <= 1.0)
tmp = (y * (x / z)) / z;
else
tmp = (x * (y / z)) / (z * z);
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_] := If[LessEqual[z, -1.0], N[(N[(x / z), $MachinePrecision] * N[(N[(y / z), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.0], N[(N[(y * N[(x / z), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], N[(N[(x * N[(y / z), $MachinePrecision]), $MachinePrecision] / N[(z * z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1:\\
\;\;\;\;\frac{x}{z} \cdot \frac{\frac{y}{z}}{z}\\
\mathbf{elif}\;z \leq 1:\\
\;\;\;\;\frac{y \cdot \frac{x}{z}}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot \frac{y}{z}}{z \cdot z}\\
\end{array}
\end{array}
if z < -1Initial program 82.1%
associate-*l*82.1%
times-frac93.1%
distribute-lft-in93.1%
fma-def93.1%
*-rgt-identity93.1%
Simplified93.1%
Taylor expanded in z around inf 90.4%
unpow290.4%
associate-/r*94.4%
Simplified94.4%
if -1 < z < 1Initial program 85.4%
times-frac83.1%
Simplified83.1%
Taylor expanded in z around 0 80.9%
*-commutative80.9%
associate-/r*86.7%
associate-*r/95.4%
Applied egg-rr95.4%
if 1 < z Initial program 84.3%
associate-*l*84.4%
times-frac92.7%
distribute-lft-in92.7%
fma-def92.7%
*-rgt-identity92.7%
Simplified92.7%
Taylor expanded in z around inf 90.9%
unpow290.9%
Simplified90.9%
associate-/r*92.7%
*-commutative92.7%
frac-times93.0%
Applied egg-rr93.0%
Final simplification94.6%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z) :precision binary64 (if (<= z -1.0) (* (/ x z) (/ (/ y z) z)) (if (<= z 1.0) (/ (* y (/ x z)) z) (/ (/ y z) (* z (/ z x))))))
assert(x < y);
double code(double x, double y, double z) {
double tmp;
if (z <= -1.0) {
tmp = (x / z) * ((y / z) / z);
} else if (z <= 1.0) {
tmp = (y * (x / z)) / z;
} else {
tmp = (y / z) / (z * (z / x));
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (z <= (-1.0d0)) then
tmp = (x / z) * ((y / z) / z)
else if (z <= 1.0d0) then
tmp = (y * (x / z)) / z
else
tmp = (y / z) / (z * (z / x))
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z) {
double tmp;
if (z <= -1.0) {
tmp = (x / z) * ((y / z) / z);
} else if (z <= 1.0) {
tmp = (y * (x / z)) / z;
} else {
tmp = (y / z) / (z * (z / x));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z): tmp = 0 if z <= -1.0: tmp = (x / z) * ((y / z) / z) elif z <= 1.0: tmp = (y * (x / z)) / z else: tmp = (y / z) / (z * (z / x)) return tmp
x, y = sort([x, y]) function code(x, y, z) tmp = 0.0 if (z <= -1.0) tmp = Float64(Float64(x / z) * Float64(Float64(y / z) / z)); elseif (z <= 1.0) tmp = Float64(Float64(y * Float64(x / z)) / z); else tmp = Float64(Float64(y / z) / Float64(z * Float64(z / x))); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z)
tmp = 0.0;
if (z <= -1.0)
tmp = (x / z) * ((y / z) / z);
elseif (z <= 1.0)
tmp = (y * (x / z)) / z;
else
tmp = (y / z) / (z * (z / x));
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_] := If[LessEqual[z, -1.0], N[(N[(x / z), $MachinePrecision] * N[(N[(y / z), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.0], N[(N[(y * N[(x / z), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], N[(N[(y / z), $MachinePrecision] / N[(z * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1:\\
\;\;\;\;\frac{x}{z} \cdot \frac{\frac{y}{z}}{z}\\
\mathbf{elif}\;z \leq 1:\\
\;\;\;\;\frac{y \cdot \frac{x}{z}}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{y}{z}}{z \cdot \frac{z}{x}}\\
\end{array}
\end{array}
if z < -1Initial program 82.1%
associate-*l*82.1%
times-frac93.1%
distribute-lft-in93.1%
fma-def93.1%
*-rgt-identity93.1%
Simplified93.1%
Taylor expanded in z around inf 90.4%
unpow290.4%
associate-/r*94.4%
Simplified94.4%
if -1 < z < 1Initial program 85.4%
times-frac83.1%
Simplified83.1%
Taylor expanded in z around 0 80.9%
*-commutative80.9%
associate-/r*86.7%
associate-*r/95.4%
Applied egg-rr95.4%
if 1 < z Initial program 84.3%
associate-*l*84.4%
times-frac92.7%
distribute-lft-in92.7%
fma-def92.7%
*-rgt-identity92.7%
Simplified92.7%
Taylor expanded in z around inf 90.9%
unpow290.9%
Simplified90.9%
clear-num90.9%
associate-/r*92.6%
frac-times93.0%
*-un-lft-identity93.0%
associate-/r/93.0%
div-inv93.0%
clear-num93.0%
Applied egg-rr93.0%
Final simplification94.6%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z) :precision binary64 (if (<= y 8.6e+24) (* x (/ (/ y z) z)) (* y (/ x (* z z)))))
assert(x < y);
double code(double x, double y, double z) {
double tmp;
if (y <= 8.6e+24) {
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 (y <= 8.6d+24) 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 (y <= 8.6e+24) {
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 y <= 8.6e+24: 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 (y <= 8.6e+24) tmp = Float64(x * Float64(Float64(y / z) / z)); else tmp = Float64(y * Float64(x / Float64(z * z))); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z)
tmp = 0.0;
if (y <= 8.6e+24)
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[y, 8.6e+24], N[(x * N[(N[(y / z), $MachinePrecision] / 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 8.6 \cdot 10^{+24}:\\
\;\;\;\;x \cdot \frac{\frac{y}{z}}{z}\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{x}{z \cdot z}\\
\end{array}
\end{array}
if y < 8.59999999999999975e24Initial program 84.7%
associate-*l*84.7%
times-frac94.2%
distribute-lft-in94.2%
fma-def94.2%
*-rgt-identity94.2%
Simplified94.2%
*-commutative94.2%
associate-*l/96.8%
fma-udef96.8%
distribute-lft1-in96.8%
frac-times90.4%
associate-*r/97.8%
Applied egg-rr97.8%
Taylor expanded in z around 0 53.8%
unpow253.8%
times-frac60.5%
associate-*r/61.9%
associate-*l/58.5%
associate-*r/58.5%
neg-mul-158.5%
distribute-lft-neg-in58.5%
associate-*l/60.4%
distribute-rgt-out62.0%
distribute-frac-neg62.0%
sub-neg62.0%
div-sub65.7%
Simplified65.7%
Taylor expanded in z around 0 76.9%
if 8.59999999999999975e24 < y Initial program 83.1%
times-frac91.5%
Simplified91.5%
Taylor expanded in z around 0 73.0%
Final simplification75.9%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z) :precision binary64 (if (<= y 5.2e-39) (* x (/ (/ y z) z)) (* y (/ (/ x z) z))))
assert(x < y);
double code(double x, double y, double z) {
double tmp;
if (y <= 5.2e-39) {
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 (y <= 5.2d-39) 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 (y <= 5.2e-39) {
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 y <= 5.2e-39: 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 (y <= 5.2e-39) tmp = Float64(x * Float64(Float64(y / 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 (y <= 5.2e-39)
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[y, 5.2e-39], N[(x * N[(N[(y / z), $MachinePrecision] / z), $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}\;y \leq 5.2 \cdot 10^{-39}:\\
\;\;\;\;x \cdot \frac{\frac{y}{z}}{z}\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{\frac{x}{z}}{z}\\
\end{array}
\end{array}
if y < 5.2e-39Initial program 84.8%
associate-*l*84.8%
times-frac93.9%
distribute-lft-in93.9%
fma-def93.9%
*-rgt-identity93.9%
Simplified93.9%
*-commutative93.9%
associate-*l/96.6%
fma-udef96.6%
distribute-lft1-in96.6%
frac-times89.9%
associate-*r/97.7%
Applied egg-rr97.7%
Taylor expanded in z around 0 53.1%
unpow253.1%
times-frac60.3%
associate-*r/61.8%
associate-*l/58.2%
associate-*r/58.2%
neg-mul-158.2%
distribute-lft-neg-in58.2%
associate-*l/60.2%
distribute-rgt-out61.9%
distribute-frac-neg61.9%
sub-neg61.9%
div-sub65.7%
Simplified65.7%
Taylor expanded in z around 0 77.1%
if 5.2e-39 < y Initial program 83.1%
times-frac92.7%
Simplified92.7%
Taylor expanded in z around 0 73.1%
Taylor expanded in x around 0 73.1%
unpow273.1%
associate-/l/71.7%
Simplified71.7%
Final simplification75.5%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z) :precision binary64 (if (<= y 1.6e-38) (/ x (* z (/ z y))) (* y (/ (/ x z) z))))
assert(x < y);
double code(double x, double y, double z) {
double tmp;
if (y <= 1.6e-38) {
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 (y <= 1.6d-38) 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 (y <= 1.6e-38) {
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 y <= 1.6e-38: 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 (y <= 1.6e-38) 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 (y <= 1.6e-38)
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[y, 1.6e-38], 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}\;y \leq 1.6 \cdot 10^{-38}:\\
\;\;\;\;\frac{x}{z \cdot \frac{z}{y}}\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{\frac{x}{z}}{z}\\
\end{array}
\end{array}
if y < 1.59999999999999989e-38Initial program 84.8%
/-rgt-identity84.8%
associate-/l*84.7%
associate-/l/81.3%
associate-*l*83.5%
associate-*r/83.4%
*-rgt-identity83.4%
associate-*l*89.8%
associate-*r/89.9%
distribute-lft-in89.9%
fma-def89.9%
*-rgt-identity89.9%
Simplified89.9%
Taylor expanded in z around 0 77.1%
if 1.59999999999999989e-38 < y Initial program 83.1%
times-frac92.7%
Simplified92.7%
Taylor expanded in z around 0 73.1%
Taylor expanded in x around 0 73.1%
unpow273.1%
associate-/l/71.7%
Simplified71.7%
Final simplification75.5%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z) :precision binary64 (if (<= y 4.9e-31) (/ x (* z (/ z y))) (/ y (* z (/ z x)))))
assert(x < y);
double code(double x, double y, double z) {
double tmp;
if (y <= 4.9e-31) {
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 (y <= 4.9d-31) 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 (y <= 4.9e-31) {
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 y <= 4.9e-31: 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 (y <= 4.9e-31) 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 (y <= 4.9e-31)
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[y, 4.9e-31], 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}\;y \leq 4.9 \cdot 10^{-31}:\\
\;\;\;\;\frac{x}{z \cdot \frac{z}{y}}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{z \cdot \frac{z}{x}}\\
\end{array}
\end{array}
if y < 4.90000000000000023e-31Initial program 85.0%
/-rgt-identity85.0%
associate-/l*85.0%
associate-/l/81.6%
associate-*l*83.7%
associate-*r/83.7%
*-rgt-identity83.7%
associate-*l*90.0%
associate-*r/90.0%
distribute-lft-in90.0%
fma-def90.0%
*-rgt-identity90.0%
Simplified90.0%
Taylor expanded in z around 0 77.5%
if 4.90000000000000023e-31 < y Initial program 82.4%
associate-*l*82.4%
times-frac94.6%
distribute-lft-in94.6%
fma-def94.6%
*-rgt-identity94.6%
Simplified94.6%
Taylor expanded in z around 0 67.1%
unpow267.1%
associate-/l*72.0%
associate-/l*71.8%
Simplified71.8%
associate-/r/71.8%
Applied egg-rr71.8%
Final simplification75.9%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z) :precision binary64 (if (<= z -1e-310) (* x (/ (- y) z)) (* x (/ y z))))
assert(x < y);
double code(double x, double y, double z) {
double tmp;
if (z <= -1e-310) {
tmp = x * (-y / z);
} else {
tmp = x * (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 <= (-1d-310)) then
tmp = x * (-y / z)
else
tmp = x * (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 <= -1e-310) {
tmp = x * (-y / z);
} else {
tmp = x * (y / z);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z): tmp = 0 if z <= -1e-310: tmp = x * (-y / z) else: tmp = x * (y / z) return tmp
x, y = sort([x, y]) function code(x, y, z) tmp = 0.0 if (z <= -1e-310) tmp = Float64(x * Float64(Float64(-y) / z)); else tmp = Float64(x * 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 <= -1e-310)
tmp = x * (-y / z);
else
tmp = x * (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, -1e-310], N[(x * N[((-y) / z), $MachinePrecision]), $MachinePrecision], N[(x * N[(y / z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1 \cdot 10^{-310}:\\
\;\;\;\;x \cdot \frac{-y}{z}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{y}{z}\\
\end{array}
\end{array}
if z < -9.999999999999969e-311Initial program 84.6%
associate-*r/82.5%
associate-*l*82.5%
distribute-lft-in82.6%
fma-def82.5%
*-rgt-identity82.5%
Simplified82.5%
Taylor expanded in z around 0 53.7%
+-commutative53.7%
mul-1-neg53.7%
unsub-neg53.7%
unpow253.7%
associate-/r*56.8%
Simplified56.8%
Taylor expanded in z around inf 27.8%
associate-*r/27.8%
neg-mul-127.8%
distribute-lft-neg-in27.8%
associate-*l/32.2%
*-commutative32.2%
Simplified32.2%
if -9.999999999999969e-311 < z Initial program 83.9%
associate-*r/83.3%
associate-*l*83.3%
distribute-lft-in83.3%
fma-def83.3%
*-rgt-identity83.3%
Simplified83.3%
Taylor expanded in z around 0 45.3%
+-commutative45.3%
mul-1-neg45.3%
unsub-neg45.3%
unpow245.3%
associate-/r*51.3%
Simplified51.3%
Taylor expanded in z around inf 16.8%
associate-*r/16.8%
neg-mul-116.8%
distribute-lft-neg-in16.8%
associate-*l/19.0%
*-commutative19.0%
Simplified19.0%
clear-num19.8%
un-div-inv19.8%
add-sqr-sqrt8.2%
sqrt-unprod34.2%
sqr-neg34.2%
sqrt-unprod25.4%
add-sqr-sqrt41.8%
Applied egg-rr41.8%
clear-num42.2%
associate-/r/42.6%
clear-num41.9%
Applied egg-rr41.9%
Final simplification37.0%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z) :precision binary64 (if (<= z -1e-310) (/ x (/ (- z) y)) (* x (/ y z))))
assert(x < y);
double code(double x, double y, double z) {
double tmp;
if (z <= -1e-310) {
tmp = x / (-z / y);
} else {
tmp = x * (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 <= (-1d-310)) then
tmp = x / (-z / y)
else
tmp = x * (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 <= -1e-310) {
tmp = x / (-z / y);
} else {
tmp = x * (y / z);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z): tmp = 0 if z <= -1e-310: tmp = x / (-z / y) else: tmp = x * (y / z) return tmp
x, y = sort([x, y]) function code(x, y, z) tmp = 0.0 if (z <= -1e-310) tmp = Float64(x / Float64(Float64(-z) / y)); else tmp = Float64(x * 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 <= -1e-310)
tmp = x / (-z / y);
else
tmp = x * (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, -1e-310], N[(x / N[((-z) / y), $MachinePrecision]), $MachinePrecision], N[(x * N[(y / z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1 \cdot 10^{-310}:\\
\;\;\;\;\frac{x}{\frac{-z}{y}}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{y}{z}\\
\end{array}
\end{array}
if z < -9.999999999999969e-311Initial program 84.6%
associate-*r/82.5%
associate-*l*82.5%
distribute-lft-in82.6%
fma-def82.5%
*-rgt-identity82.5%
Simplified82.5%
Taylor expanded in z around 0 53.7%
+-commutative53.7%
mul-1-neg53.7%
unsub-neg53.7%
unpow253.7%
associate-/r*56.8%
Simplified56.8%
Taylor expanded in z around inf 27.8%
associate-*r/27.8%
neg-mul-127.8%
distribute-lft-neg-in27.8%
associate-*l/32.2%
*-commutative32.2%
Simplified32.2%
associate-*r/27.8%
frac-2neg27.8%
add-sqr-sqrt13.5%
sqrt-unprod22.6%
sqr-neg22.6%
sqrt-unprod8.1%
add-sqr-sqrt17.3%
*-commutative17.3%
distribute-lft-neg-in17.3%
add-sqr-sqrt9.2%
sqrt-unprod27.4%
sqr-neg27.4%
sqrt-unprod14.2%
add-sqr-sqrt27.8%
Applied egg-rr27.8%
*-commutative27.8%
associate-/l*33.7%
Simplified33.7%
if -9.999999999999969e-311 < z Initial program 83.9%
associate-*r/83.3%
associate-*l*83.3%
distribute-lft-in83.3%
fma-def83.3%
*-rgt-identity83.3%
Simplified83.3%
Taylor expanded in z around 0 45.3%
+-commutative45.3%
mul-1-neg45.3%
unsub-neg45.3%
unpow245.3%
associate-/r*51.3%
Simplified51.3%
Taylor expanded in z around inf 16.8%
associate-*r/16.8%
neg-mul-116.8%
distribute-lft-neg-in16.8%
associate-*l/19.0%
*-commutative19.0%
Simplified19.0%
clear-num19.8%
un-div-inv19.8%
add-sqr-sqrt8.2%
sqrt-unprod34.2%
sqr-neg34.2%
sqrt-unprod25.4%
add-sqr-sqrt41.8%
Applied egg-rr41.8%
clear-num42.2%
associate-/r/42.6%
clear-num41.9%
Applied egg-rr41.9%
Final simplification37.7%
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(Float64(y / 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[(N[(y / z), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
x \cdot \frac{\frac{y}{z}}{z}
\end{array}
Initial program 84.3%
associate-*l*84.3%
times-frac94.2%
distribute-lft-in94.2%
fma-def94.2%
*-rgt-identity94.2%
Simplified94.2%
*-commutative94.2%
associate-*l/95.7%
fma-udef95.7%
distribute-lft1-in95.7%
frac-times92.2%
associate-*r/97.6%
Applied egg-rr97.6%
Taylor expanded in z around 0 49.8%
unpow249.8%
times-frac54.9%
associate-*r/56.0%
associate-*l/52.7%
associate-*r/52.7%
neg-mul-152.7%
distribute-lft-neg-in52.7%
associate-*l/51.7%
distribute-rgt-out54.1%
distribute-frac-neg54.1%
sub-neg54.1%
div-sub61.9%
Simplified61.9%
Taylor expanded in z around 0 74.7%
Final simplification74.7%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z) :precision binary64 (* y (/ x z)))
assert(x < y);
double code(double x, double y, double z) {
return y * (x / z);
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = y * (x / z)
end function
assert x < y;
public static double code(double x, double y, double z) {
return y * (x / z);
}
[x, y] = sort([x, y]) def code(x, y, z): return y * (x / z)
x, y = sort([x, y]) function code(x, y, z) return Float64(y * Float64(x / z)) end
x, y = num2cell(sort([x, y])){:}
function tmp = code(x, y, z)
tmp = y * (x / z);
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_] := N[(y * N[(x / z), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
y \cdot \frac{x}{z}
\end{array}
Initial program 84.3%
associate-*r/82.9%
associate-*l*82.9%
distribute-lft-in82.9%
fma-def82.9%
*-rgt-identity82.9%
Simplified82.9%
Taylor expanded in z around 0 49.5%
+-commutative49.5%
mul-1-neg49.5%
unsub-neg49.5%
unpow249.5%
associate-/r*54.1%
Simplified54.1%
Taylor expanded in z around inf 22.3%
associate-*r/22.3%
neg-mul-122.3%
distribute-lft-neg-in22.3%
associate-*l/25.7%
*-commutative25.7%
Simplified25.7%
clear-num26.8%
un-div-inv26.8%
add-sqr-sqrt12.0%
sqrt-unprod29.1%
sqr-neg29.1%
sqrt-unprod17.5%
add-sqr-sqrt31.3%
Applied egg-rr31.3%
associate-/r/32.3%
Applied egg-rr32.3%
Final simplification32.3%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z) :precision binary64 (* x (/ y z)))
assert(x < y);
double code(double x, double y, double z) {
return x * (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 = x * (y / z)
end function
assert x < y;
public static double code(double x, double y, double z) {
return x * (y / z);
}
[x, y] = sort([x, y]) def code(x, y, z): return x * (y / z)
x, y = sort([x, y]) function code(x, y, z) return Float64(x * Float64(y / z)) end
x, y = num2cell(sort([x, y])){:}
function tmp = code(x, y, z)
tmp = x * (y / z);
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_] := N[(x * N[(y / z), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
x \cdot \frac{y}{z}
\end{array}
Initial program 84.3%
associate-*r/82.9%
associate-*l*82.9%
distribute-lft-in82.9%
fma-def82.9%
*-rgt-identity82.9%
Simplified82.9%
Taylor expanded in z around 0 49.5%
+-commutative49.5%
mul-1-neg49.5%
unsub-neg49.5%
unpow249.5%
associate-/r*54.1%
Simplified54.1%
Taylor expanded in z around inf 22.3%
associate-*r/22.3%
neg-mul-122.3%
distribute-lft-neg-in22.3%
associate-*l/25.7%
*-commutative25.7%
Simplified25.7%
clear-num26.8%
un-div-inv26.8%
add-sqr-sqrt12.0%
sqrt-unprod29.1%
sqr-neg29.1%
sqrt-unprod17.5%
add-sqr-sqrt31.3%
Applied egg-rr31.3%
clear-num31.5%
associate-/r/31.7%
clear-num30.6%
Applied egg-rr30.6%
Final simplification30.6%
(FPCore (x y z) :precision binary64 (if (< z 249.6182814532307) (/ (* y (/ x z)) (+ z (* z z))) (/ (* (/ (/ y z) (+ 1.0 z)) x) z)))
double code(double x, double y, double z) {
double tmp;
if (z < 249.6182814532307) {
tmp = (y * (x / z)) / (z + (z * z));
} else {
tmp = (((y / z) / (1.0 + z)) * x) / z;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (z < 249.6182814532307d0) then
tmp = (y * (x / z)) / (z + (z * z))
else
tmp = (((y / z) / (1.0d0 + z)) * x) / z
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z < 249.6182814532307) {
tmp = (y * (x / z)) / (z + (z * z));
} else {
tmp = (((y / z) / (1.0 + z)) * x) / z;
}
return tmp;
}
def code(x, y, z): tmp = 0 if z < 249.6182814532307: tmp = (y * (x / z)) / (z + (z * z)) else: tmp = (((y / z) / (1.0 + z)) * x) / z return tmp
function code(x, y, z) tmp = 0.0 if (z < 249.6182814532307) tmp = Float64(Float64(y * Float64(x / z)) / Float64(z + Float64(z * z))); else tmp = Float64(Float64(Float64(Float64(y / z) / Float64(1.0 + z)) * x) / z); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z < 249.6182814532307) tmp = (y * (x / z)) / (z + (z * z)); else tmp = (((y / z) / (1.0 + z)) * x) / z; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Less[z, 249.6182814532307], N[(N[(y * N[(x / z), $MachinePrecision]), $MachinePrecision] / N[(z + N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(y / z), $MachinePrecision] / N[(1.0 + z), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision] / z), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z < 249.6182814532307:\\
\;\;\;\;\frac{y \cdot \frac{x}{z}}{z + z \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\frac{y}{z}}{1 + z} \cdot x}{z}\\
\end{array}
\end{array}
herbie shell --seed 2023192
(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))))