
(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 (if (<= (/ (* x y) (* (* z z) (+ z 1.0))) 2e+265) (/ (/ (* x (/ y z)) z) (+ z 1.0)) (/ (/ (/ y z) (/ z x)) (+ z 1.0))))
assert(x < y);
double code(double x, double y, double z) {
double tmp;
if (((x * y) / ((z * z) * (z + 1.0))) <= 2e+265) {
tmp = ((x * (y / z)) / z) / (z + 1.0);
} else {
tmp = ((y / z) / (z / x)) / (z + 1.0);
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (((x * y) / ((z * z) * (z + 1.0d0))) <= 2d+265) then
tmp = ((x * (y / z)) / z) / (z + 1.0d0)
else
tmp = ((y / z) / (z / x)) / (z + 1.0d0)
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z) {
double tmp;
if (((x * y) / ((z * z) * (z + 1.0))) <= 2e+265) {
tmp = ((x * (y / z)) / z) / (z + 1.0);
} else {
tmp = ((y / z) / (z / x)) / (z + 1.0);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z): tmp = 0 if ((x * y) / ((z * z) * (z + 1.0))) <= 2e+265: tmp = ((x * (y / z)) / z) / (z + 1.0) else: tmp = ((y / z) / (z / x)) / (z + 1.0) return tmp
x, y = sort([x, y]) function code(x, y, z) tmp = 0.0 if (Float64(Float64(x * y) / Float64(Float64(z * z) * Float64(z + 1.0))) <= 2e+265) tmp = Float64(Float64(Float64(x * Float64(y / z)) / z) / Float64(z + 1.0)); else tmp = Float64(Float64(Float64(y / z) / Float64(z / x)) / Float64(z + 1.0)); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z)
tmp = 0.0;
if (((x * y) / ((z * z) * (z + 1.0))) <= 2e+265)
tmp = ((x * (y / z)) / z) / (z + 1.0);
else
tmp = ((y / z) / (z / x)) / (z + 1.0);
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_] := If[LessEqual[N[(N[(x * y), $MachinePrecision] / N[(N[(z * z), $MachinePrecision] * N[(z + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2e+265], N[(N[(N[(x * N[(y / z), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision] / N[(z + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(N[(y / z), $MachinePrecision] / N[(z / x), $MachinePrecision]), $MachinePrecision] / N[(z + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;\frac{x \cdot y}{\left(z \cdot z\right) \cdot \left(z + 1\right)} \leq 2 \cdot 10^{+265}:\\
\;\;\;\;\frac{\frac{x \cdot \frac{y}{z}}{z}}{z + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\frac{y}{z}}{\frac{z}{x}}}{z + 1}\\
\end{array}
\end{array}
if (/.f64 (*.f64 x y) (*.f64 (*.f64 z z) (+.f64 z 1))) < 2.00000000000000013e265Initial program 89.3%
associate-*l*89.3%
times-frac90.5%
associate-/r*91.7%
associate-*r/94.2%
Simplified94.2%
associate-*l/96.6%
Applied egg-rr96.6%
if 2.00000000000000013e265 < (/.f64 (*.f64 x y) (*.f64 (*.f64 z z) (+.f64 z 1))) Initial program 53.7%
associate-*l*53.7%
times-frac85.3%
associate-/r*98.3%
associate-*r/99.8%
Simplified99.8%
Taylor expanded in x around 0 53.8%
unpow253.8%
associate-/r*59.2%
associate-*r/92.4%
*-commutative92.4%
associate-*l/85.1%
associate-/r/99.9%
Simplified99.9%
Final simplification97.4%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* (* z z) (+ z 1.0))))
(if (or (<= t_0 -2e+31) (not (<= t_0 0.001)))
(/ (/ y z) (* z (/ z x)))
(/ (* x (- (/ y z) y)) z))))assert(x < y);
double code(double x, double y, double z) {
double t_0 = (z * z) * (z + 1.0);
double tmp;
if ((t_0 <= -2e+31) || !(t_0 <= 0.001)) {
tmp = (y / z) / (z * (z / x));
} else {
tmp = (x * ((y / z) - y)) / z;
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = (z * z) * (z + 1.0d0)
if ((t_0 <= (-2d+31)) .or. (.not. (t_0 <= 0.001d0))) then
tmp = (y / z) / (z * (z / x))
else
tmp = (x * ((y / z) - y)) / z
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z) {
double t_0 = (z * z) * (z + 1.0);
double tmp;
if ((t_0 <= -2e+31) || !(t_0 <= 0.001)) {
tmp = (y / z) / (z * (z / x));
} else {
tmp = (x * ((y / z) - y)) / z;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z): t_0 = (z * z) * (z + 1.0) tmp = 0 if (t_0 <= -2e+31) or not (t_0 <= 0.001): tmp = (y / z) / (z * (z / x)) else: tmp = (x * ((y / z) - y)) / z return tmp
x, y = sort([x, y]) function code(x, y, z) t_0 = Float64(Float64(z * z) * Float64(z + 1.0)) tmp = 0.0 if ((t_0 <= -2e+31) || !(t_0 <= 0.001)) tmp = Float64(Float64(y / z) / Float64(z * Float64(z / x))); else tmp = Float64(Float64(x * Float64(Float64(y / z) - y)) / z); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z)
t_0 = (z * z) * (z + 1.0);
tmp = 0.0;
if ((t_0 <= -2e+31) || ~((t_0 <= 0.001)))
tmp = (y / z) / (z * (z / x));
else
tmp = (x * ((y / z) - y)) / z;
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(z * z), $MachinePrecision] * N[(z + 1.0), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$0, -2e+31], N[Not[LessEqual[t$95$0, 0.001]], $MachinePrecision]], N[(N[(y / z), $MachinePrecision] / N[(z * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * N[(N[(y / z), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_0 := \left(z \cdot z\right) \cdot \left(z + 1\right)\\
\mathbf{if}\;t_0 \leq -2 \cdot 10^{+31} \lor \neg \left(t_0 \leq 0.001\right):\\
\;\;\;\;\frac{\frac{y}{z}}{z \cdot \frac{z}{x}}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot \left(\frac{y}{z} - y\right)}{z}\\
\end{array}
\end{array}
if (*.f64 (*.f64 z z) (+.f64 z 1)) < -1.9999999999999999e31 or 1e-3 < (*.f64 (*.f64 z z) (+.f64 z 1)) Initial program 77.7%
*-commutative77.7%
sqr-neg77.7%
times-frac86.1%
sqr-neg86.1%
Simplified86.1%
*-commutative86.1%
clear-num86.1%
associate-/r*94.4%
frac-times98.1%
*-un-lft-identity98.1%
Applied egg-rr98.1%
Taylor expanded in z around inf 88.8%
unpow288.8%
associate-*r/97.4%
Simplified97.4%
if -1.9999999999999999e31 < (*.f64 (*.f64 z z) (+.f64 z 1)) < 1e-3Initial program 83.2%
associate-*l*83.1%
times-frac92.4%
associate-/r*92.4%
associate-*r/92.4%
Simplified92.4%
Taylor expanded in z around 0 71.7%
+-commutative71.7%
unpow271.7%
times-frac80.9%
mul-1-neg80.9%
associate-*l/76.0%
distribute-rgt-neg-in76.0%
distribute-lft-out91.2%
Simplified91.2%
Taylor expanded in x around 0 94.1%
Final simplification95.8%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z) :precision binary64 (if (<= (/ (* x y) (* (* z z) (+ z 1.0))) 2e+265) (/ (/ (* x (/ y z)) z) (+ z 1.0)) (/ (* (/ y z) (/ x z)) (+ z 1.0))))
assert(x < y);
double code(double x, double y, double z) {
double tmp;
if (((x * y) / ((z * z) * (z + 1.0))) <= 2e+265) {
tmp = ((x * (y / z)) / z) / (z + 1.0);
} else {
tmp = ((y / z) * (x / z)) / (z + 1.0);
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (((x * y) / ((z * z) * (z + 1.0d0))) <= 2d+265) then
tmp = ((x * (y / z)) / z) / (z + 1.0d0)
else
tmp = ((y / z) * (x / z)) / (z + 1.0d0)
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z) {
double tmp;
if (((x * y) / ((z * z) * (z + 1.0))) <= 2e+265) {
tmp = ((x * (y / z)) / z) / (z + 1.0);
} else {
tmp = ((y / z) * (x / z)) / (z + 1.0);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z): tmp = 0 if ((x * y) / ((z * z) * (z + 1.0))) <= 2e+265: tmp = ((x * (y / z)) / z) / (z + 1.0) else: tmp = ((y / z) * (x / z)) / (z + 1.0) return tmp
x, y = sort([x, y]) function code(x, y, z) tmp = 0.0 if (Float64(Float64(x * y) / Float64(Float64(z * z) * Float64(z + 1.0))) <= 2e+265) tmp = Float64(Float64(Float64(x * Float64(y / z)) / z) / Float64(z + 1.0)); else tmp = Float64(Float64(Float64(y / z) * Float64(x / z)) / Float64(z + 1.0)); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z)
tmp = 0.0;
if (((x * y) / ((z * z) * (z + 1.0))) <= 2e+265)
tmp = ((x * (y / z)) / z) / (z + 1.0);
else
tmp = ((y / z) * (x / z)) / (z + 1.0);
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_] := If[LessEqual[N[(N[(x * y), $MachinePrecision] / N[(N[(z * z), $MachinePrecision] * N[(z + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2e+265], N[(N[(N[(x * N[(y / z), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision] / N[(z + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(N[(y / z), $MachinePrecision] * N[(x / z), $MachinePrecision]), $MachinePrecision] / N[(z + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;\frac{x \cdot y}{\left(z \cdot z\right) \cdot \left(z + 1\right)} \leq 2 \cdot 10^{+265}:\\
\;\;\;\;\frac{\frac{x \cdot \frac{y}{z}}{z}}{z + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{y}{z} \cdot \frac{x}{z}}{z + 1}\\
\end{array}
\end{array}
if (/.f64 (*.f64 x y) (*.f64 (*.f64 z z) (+.f64 z 1))) < 2.00000000000000013e265Initial program 89.3%
associate-*l*89.3%
times-frac90.5%
associate-/r*91.7%
associate-*r/94.2%
Simplified94.2%
associate-*l/96.6%
Applied egg-rr96.6%
if 2.00000000000000013e265 < (/.f64 (*.f64 x y) (*.f64 (*.f64 z z) (+.f64 z 1))) Initial program 53.7%
associate-*l*53.7%
times-frac85.3%
associate-/r*98.3%
associate-*r/99.8%
Simplified99.8%
Final simplification97.4%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z) :precision binary64 (if (<= (* x y) -4e-30) (* y (/ x (* z z))) (if (<= (* x y) 1e-24) (* (/ y z) (/ x z)) (* x (/ y (* z z))))))
assert(x < y);
double code(double x, double y, double z) {
double tmp;
if ((x * y) <= -4e-30) {
tmp = y * (x / (z * z));
} else if ((x * y) <= 1e-24) {
tmp = (y / z) * (x / z);
} else {
tmp = x * (y / (z * z));
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if ((x * y) <= (-4d-30)) then
tmp = y * (x / (z * z))
else if ((x * y) <= 1d-24) then
tmp = (y / z) * (x / z)
else
tmp = x * (y / (z * z))
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z) {
double tmp;
if ((x * y) <= -4e-30) {
tmp = y * (x / (z * z));
} else if ((x * y) <= 1e-24) {
tmp = (y / z) * (x / z);
} else {
tmp = x * (y / (z * z));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z): tmp = 0 if (x * y) <= -4e-30: tmp = y * (x / (z * z)) elif (x * y) <= 1e-24: tmp = (y / z) * (x / z) else: tmp = x * (y / (z * z)) return tmp
x, y = sort([x, y]) function code(x, y, z) tmp = 0.0 if (Float64(x * y) <= -4e-30) tmp = Float64(y * Float64(x / Float64(z * z))); elseif (Float64(x * y) <= 1e-24) tmp = Float64(Float64(y / z) * Float64(x / z)); else tmp = Float64(x * Float64(y / Float64(z * z))); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z)
tmp = 0.0;
if ((x * y) <= -4e-30)
tmp = y * (x / (z * z));
elseif ((x * y) <= 1e-24)
tmp = (y / z) * (x / z);
else
tmp = x * (y / (z * z));
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_] := If[LessEqual[N[(x * y), $MachinePrecision], -4e-30], N[(y * N[(x / N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 1e-24], N[(N[(y / z), $MachinePrecision] * N[(x / z), $MachinePrecision]), $MachinePrecision], N[(x * N[(y / N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -4 \cdot 10^{-30}:\\
\;\;\;\;y \cdot \frac{x}{z \cdot z}\\
\mathbf{elif}\;x \cdot y \leq 10^{-24}:\\
\;\;\;\;\frac{y}{z} \cdot \frac{x}{z}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{y}{z \cdot z}\\
\end{array}
\end{array}
if (*.f64 x y) < -4e-30Initial program 78.3%
*-commutative78.3%
associate-*r/78.9%
sqr-neg78.9%
associate-*l*79.0%
associate-*l*78.9%
sqr-neg78.9%
associate-*l*79.0%
distribute-lft-in78.9%
fma-def79.0%
*-rgt-identity79.0%
Simplified79.0%
Taylor expanded in z around 0 61.8%
unpow261.8%
Simplified61.8%
if -4e-30 < (*.f64 x y) < 9.99999999999999924e-25Initial program 81.7%
associate-*l*81.7%
times-frac96.6%
associate-/r*96.6%
associate-*r/97.8%
Simplified97.8%
Taylor expanded in z around 0 63.9%
+-commutative63.9%
unpow263.9%
times-frac80.3%
mul-1-neg80.3%
associate-*l/81.1%
distribute-rgt-neg-in81.1%
distribute-lft-out83.8%
Simplified83.8%
Taylor expanded in z around 0 89.2%
if 9.99999999999999924e-25 < (*.f64 x y) Initial program 80.2%
*-commutative80.2%
sqr-neg80.2%
times-frac86.8%
sqr-neg86.8%
Simplified86.8%
Taylor expanded in z around 0 70.1%
Final simplification76.6%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z) :precision binary64 (if (or (<= z -1.0) (not (<= z 1.0))) (* (/ x z) (/ y (* z z))) (/ (* x (/ y 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 = (x * (y / z)) / z;
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if ((z <= (-1.0d0)) .or. (.not. (z <= 1.0d0))) then
tmp = (x / z) * (y / (z * z))
else
tmp = (x * (y / z)) / z
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -1.0) || !(z <= 1.0)) {
tmp = (x / z) * (y / (z * z));
} else {
tmp = (x * (y / 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 = (x * (y / 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(x * Float64(y / z)) / z); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z)
tmp = 0.0;
if ((z <= -1.0) || ~((z <= 1.0)))
tmp = (x / z) * (y / (z * z));
else
tmp = (x * (y / z)) / z;
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_] := If[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[(x * N[(y / 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{x \cdot \frac{y}{z}}{z}\\
\end{array}
\end{array}
if z < -1 or 1 < z Initial program 77.7%
*-commutative77.7%
sqr-neg77.7%
times-frac86.1%
sqr-neg86.1%
Simplified86.1%
Taylor expanded in z around inf 85.5%
if -1 < z < 1Initial program 83.2%
associate-*l*83.1%
times-frac92.4%
associate-/r*92.4%
associate-*r/92.4%
Simplified92.4%
Taylor expanded in z around 0 71.7%
+-commutative71.7%
unpow271.7%
times-frac80.9%
mul-1-neg80.9%
associate-*l/76.0%
distribute-rgt-neg-in76.0%
distribute-lft-out91.2%
Simplified91.2%
Taylor expanded in x around 0 94.1%
Taylor expanded in z around 0 93.0%
Final simplification89.2%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z) :precision binary64 (if (or (<= z -1.0) (not (<= z 0.72))) (* (/ x z) (/ y (* z z))) (/ (* x (- (/ y z) y)) z)))
assert(x < y);
double code(double x, double y, double z) {
double tmp;
if ((z <= -1.0) || !(z <= 0.72)) {
tmp = (x / z) * (y / (z * z));
} else {
tmp = (x * ((y / z) - y)) / z;
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if ((z <= (-1.0d0)) .or. (.not. (z <= 0.72d0))) then
tmp = (x / z) * (y / (z * z))
else
tmp = (x * ((y / z) - y)) / z
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -1.0) || !(z <= 0.72)) {
tmp = (x / z) * (y / (z * z));
} else {
tmp = (x * ((y / z) - y)) / z;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z): tmp = 0 if (z <= -1.0) or not (z <= 0.72): tmp = (x / z) * (y / (z * z)) else: tmp = (x * ((y / z) - y)) / z return tmp
x, y = sort([x, y]) function code(x, y, z) tmp = 0.0 if ((z <= -1.0) || !(z <= 0.72)) tmp = Float64(Float64(x / z) * Float64(y / Float64(z * z))); else tmp = Float64(Float64(x * Float64(Float64(y / z) - y)) / z); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z)
tmp = 0.0;
if ((z <= -1.0) || ~((z <= 0.72)))
tmp = (x / z) * (y / (z * z));
else
tmp = (x * ((y / z) - y)) / z;
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_] := If[Or[LessEqual[z, -1.0], N[Not[LessEqual[z, 0.72]], $MachinePrecision]], N[(N[(x / z), $MachinePrecision] * N[(y / N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * N[(N[(y / z), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1 \lor \neg \left(z \leq 0.72\right):\\
\;\;\;\;\frac{x}{z} \cdot \frac{y}{z \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot \left(\frac{y}{z} - y\right)}{z}\\
\end{array}
\end{array}
if z < -1 or 0.71999999999999997 < z Initial program 77.7%
*-commutative77.7%
sqr-neg77.7%
times-frac86.1%
sqr-neg86.1%
Simplified86.1%
Taylor expanded in z around inf 85.5%
if -1 < z < 0.71999999999999997Initial program 83.2%
associate-*l*83.1%
times-frac92.4%
associate-/r*92.4%
associate-*r/92.4%
Simplified92.4%
Taylor expanded in z around 0 71.7%
+-commutative71.7%
unpow271.7%
times-frac80.9%
mul-1-neg80.9%
associate-*l/76.0%
distribute-rgt-neg-in76.0%
distribute-lft-out91.2%
Simplified91.2%
Taylor expanded in x around 0 94.1%
Final simplification89.7%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z) :precision binary64 (/ (* (/ y z) (/ x z)) (+ z 1.0)))
assert(x < y);
double code(double x, double y, double z) {
return ((y / z) * (x / z)) / (z + 1.0);
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = ((y / z) * (x / z)) / (z + 1.0d0)
end function
assert x < y;
public static double code(double x, double y, double z) {
return ((y / z) * (x / z)) / (z + 1.0);
}
[x, y] = sort([x, y]) def code(x, y, z): return ((y / z) * (x / z)) / (z + 1.0)
x, y = sort([x, y]) function code(x, y, z) return Float64(Float64(Float64(y / z) * Float64(x / z)) / Float64(z + 1.0)) end
x, y = num2cell(sort([x, y])){:}
function tmp = code(x, y, z)
tmp = ((y / z) * (x / z)) / (z + 1.0);
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_] := N[(N[(N[(y / z), $MachinePrecision] * N[(x / z), $MachinePrecision]), $MachinePrecision] / N[(z + 1.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\frac{\frac{y}{z} \cdot \frac{x}{z}}{z + 1}
\end{array}
Initial program 80.4%
associate-*l*80.4%
times-frac89.2%
associate-/r*93.4%
associate-*r/95.6%
Simplified95.6%
Final simplification95.6%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z) :precision binary64 (if (<= x -5e-37) (* y (/ x (* z z))) (* y (/ (/ x z) z))))
assert(x < y);
double code(double x, double y, double z) {
double tmp;
if (x <= -5e-37) {
tmp = y * (x / (z * z));
} else {
tmp = y * ((x / z) / z);
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (x <= (-5d-37)) then
tmp = y * (x / (z * z))
else
tmp = y * ((x / z) / z)
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z) {
double tmp;
if (x <= -5e-37) {
tmp = y * (x / (z * z));
} else {
tmp = y * ((x / z) / z);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z): tmp = 0 if x <= -5e-37: tmp = y * (x / (z * z)) else: tmp = y * ((x / z) / z) return tmp
x, y = sort([x, y]) function code(x, y, z) tmp = 0.0 if (x <= -5e-37) tmp = Float64(y * Float64(x / Float64(z * z))); else tmp = Float64(y * Float64(Float64(x / z) / z)); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z)
tmp = 0.0;
if (x <= -5e-37)
tmp = y * (x / (z * z));
else
tmp = y * ((x / z) / z);
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_] := If[LessEqual[x, -5e-37], N[(y * N[(x / N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * N[(N[(x / z), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -5 \cdot 10^{-37}:\\
\;\;\;\;y \cdot \frac{x}{z \cdot z}\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{\frac{x}{z}}{z}\\
\end{array}
\end{array}
if x < -4.9999999999999997e-37Initial program 74.7%
*-commutative74.7%
associate-*r/72.4%
sqr-neg72.4%
associate-*l*72.4%
associate-*l*72.4%
sqr-neg72.4%
associate-*l*72.4%
distribute-lft-in72.4%
fma-def72.4%
*-rgt-identity72.4%
Simplified72.4%
Taylor expanded in z around 0 59.7%
unpow259.7%
Simplified59.7%
if -4.9999999999999997e-37 < x Initial program 82.5%
*-commutative82.5%
associate-*r/83.5%
sqr-neg83.5%
associate-*l*83.5%
associate-*l*83.5%
sqr-neg83.5%
associate-*l*83.5%
distribute-lft-in83.5%
fma-def83.5%
*-rgt-identity83.5%
Simplified83.5%
Taylor expanded in z around 0 73.4%
unpow273.4%
Simplified73.4%
Taylor expanded in x around 0 73.4%
unpow273.4%
associate-/r*76.6%
Simplified76.6%
Final simplification72.1%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z) :precision binary64 (if (<= y 1.65e-71) (* (/ y z) (/ x z)) (* y (/ x (* z z)))))
assert(x < y);
double code(double x, double y, double z) {
double tmp;
if (y <= 1.65e-71) {
tmp = (y / z) * (x / 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 <= 1.65d-71) then
tmp = (y / z) * (x / 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 <= 1.65e-71) {
tmp = (y / z) * (x / z);
} else {
tmp = y * (x / (z * z));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z): tmp = 0 if y <= 1.65e-71: tmp = (y / z) * (x / z) else: tmp = y * (x / (z * z)) return tmp
x, y = sort([x, y]) function code(x, y, z) tmp = 0.0 if (y <= 1.65e-71) tmp = Float64(Float64(y / z) * Float64(x / 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 <= 1.65e-71)
tmp = (y / z) * (x / 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, 1.65e-71], N[(N[(y / z), $MachinePrecision] * N[(x / 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 1.65 \cdot 10^{-71}:\\
\;\;\;\;\frac{y}{z} \cdot \frac{x}{z}\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{x}{z \cdot z}\\
\end{array}
\end{array}
if y < 1.6500000000000001e-71Initial program 77.5%
associate-*l*77.5%
times-frac87.4%
associate-/r*91.1%
associate-*r/94.0%
Simplified94.0%
Taylor expanded in z around 0 50.8%
+-commutative50.8%
unpow250.8%
times-frac57.0%
mul-1-neg57.0%
associate-*l/56.3%
distribute-rgt-neg-in56.3%
distribute-lft-out63.8%
Simplified63.8%
Taylor expanded in z around 0 73.8%
if 1.6500000000000001e-71 < y Initial program 88.3%
*-commutative88.3%
associate-*r/91.5%
sqr-neg91.5%
associate-*l*91.5%
associate-*l*91.5%
sqr-neg91.5%
associate-*l*91.5%
distribute-lft-in91.5%
fma-def91.5%
*-rgt-identity91.5%
Simplified91.5%
Taylor expanded in z around 0 77.1%
unpow277.1%
Simplified77.1%
Final simplification74.7%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z) :precision binary64 (if (<= x -1.9e-37) (/ x (* z (/ z y))) (* y (/ (/ x z) z))))
assert(x < y);
double code(double x, double y, double z) {
double tmp;
if (x <= -1.9e-37) {
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.9d-37)) 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.9e-37) {
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.9e-37: 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.9e-37) 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.9e-37)
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.9e-37], 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.9 \cdot 10^{-37}:\\
\;\;\;\;\frac{x}{z \cdot \frac{z}{y}}\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{\frac{x}{z}}{z}\\
\end{array}
\end{array}
if x < -1.9000000000000002e-37Initial program 74.7%
*-commutative74.7%
associate-*r/72.4%
sqr-neg72.4%
associate-*l*72.4%
associate-*l*72.4%
sqr-neg72.4%
associate-*l*72.4%
distribute-lft-in72.4%
fma-def72.4%
*-rgt-identity72.4%
Simplified72.4%
Taylor expanded in z around 0 59.7%
unpow259.7%
Simplified59.7%
associate-*r/64.7%
frac-times64.9%
clear-num64.9%
frac-times70.5%
*-un-lft-identity70.5%
Applied egg-rr70.5%
if -1.9000000000000002e-37 < x Initial program 82.5%
*-commutative82.5%
associate-*r/83.5%
sqr-neg83.5%
associate-*l*83.5%
associate-*l*83.5%
sqr-neg83.5%
associate-*l*83.5%
distribute-lft-in83.5%
fma-def83.5%
*-rgt-identity83.5%
Simplified83.5%
Taylor expanded in z around 0 73.4%
unpow273.4%
Simplified73.4%
Taylor expanded in x around 0 73.4%
unpow273.4%
associate-/r*76.6%
Simplified76.6%
Final simplification75.0%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z) :precision binary64 (if (<= x -1.9e-37) (/ x (* z (/ z y))) (/ y (* z (/ z x)))))
assert(x < y);
double code(double x, double y, double z) {
double tmp;
if (x <= -1.9e-37) {
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 <= (-1.9d-37)) 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 <= -1.9e-37) {
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 <= -1.9e-37: 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 <= -1.9e-37) 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 <= -1.9e-37)
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, -1.9e-37], 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 -1.9 \cdot 10^{-37}:\\
\;\;\;\;\frac{x}{z \cdot \frac{z}{y}}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{z \cdot \frac{z}{x}}\\
\end{array}
\end{array}
if x < -1.9000000000000002e-37Initial program 74.7%
*-commutative74.7%
associate-*r/72.4%
sqr-neg72.4%
associate-*l*72.4%
associate-*l*72.4%
sqr-neg72.4%
associate-*l*72.4%
distribute-lft-in72.4%
fma-def72.4%
*-rgt-identity72.4%
Simplified72.4%
Taylor expanded in z around 0 59.7%
unpow259.7%
Simplified59.7%
associate-*r/64.7%
frac-times64.9%
clear-num64.9%
frac-times70.5%
*-un-lft-identity70.5%
Applied egg-rr70.5%
if -1.9000000000000002e-37 < x Initial program 82.5%
*-commutative82.5%
associate-*r/83.5%
sqr-neg83.5%
associate-*l*83.5%
associate-*l*83.5%
sqr-neg83.5%
associate-*l*83.5%
distribute-lft-in83.5%
fma-def83.5%
*-rgt-identity83.5%
Simplified83.5%
Taylor expanded in z around 0 73.4%
unpow273.4%
Simplified73.4%
clear-num73.4%
associate-*l/76.6%
div-inv77.3%
*-commutative77.3%
Applied egg-rr77.3%
Final simplification75.5%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z) :precision binary64 (if (<= z -4e-311) (* x (/ (- y) z)) (/ x (/ z y))))
assert(x < y);
double code(double x, double y, double z) {
double tmp;
if (z <= -4e-311) {
tmp = x * (-y / z);
} else {
tmp = x / (z / y);
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (z <= (-4d-311)) then
tmp = x * (-y / z)
else
tmp = x / (z / y)
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z) {
double tmp;
if (z <= -4e-311) {
tmp = x * (-y / z);
} else {
tmp = x / (z / y);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z): tmp = 0 if z <= -4e-311: tmp = x * (-y / z) else: tmp = x / (z / y) return tmp
x, y = sort([x, y]) function code(x, y, z) tmp = 0.0 if (z <= -4e-311) tmp = Float64(x * Float64(Float64(-y) / z)); else tmp = Float64(x / Float64(z / y)); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z)
tmp = 0.0;
if (z <= -4e-311)
tmp = x * (-y / z);
else
tmp = x / (z / y);
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_] := If[LessEqual[z, -4e-311], N[(x * N[((-y) / z), $MachinePrecision]), $MachinePrecision], N[(x / N[(z / y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4 \cdot 10^{-311}:\\
\;\;\;\;x \cdot \frac{-y}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\frac{z}{y}}\\
\end{array}
\end{array}
if z < -3.99999999999979e-311Initial program 82.6%
associate-*l*82.6%
times-frac90.7%
associate-/r*93.2%
associate-*r/95.6%
Simplified95.6%
Taylor expanded in z around 0 55.9%
+-commutative55.9%
unpow255.9%
times-frac59.6%
mul-1-neg59.6%
associate-*l/62.0%
distribute-rgt-neg-in62.0%
distribute-lft-out62.0%
Simplified62.0%
Taylor expanded in z around inf 29.7%
mul-1-neg29.7%
associate-*r/38.3%
distribute-rgt-neg-in38.3%
Simplified38.3%
if -3.99999999999979e-311 < z Initial program 78.0%
associate-*l*78.0%
times-frac87.6%
associate-/r*93.6%
associate-*r/95.6%
Simplified95.6%
Taylor expanded in z around 0 41.5%
+-commutative41.5%
unpow241.5%
times-frac47.1%
mul-1-neg47.1%
associate-*l/45.7%
distribute-rgt-neg-in45.7%
distribute-lft-out61.3%
Simplified61.3%
Taylor expanded in z around inf 17.5%
mul-1-neg17.5%
associate-*r/20.5%
distribute-rgt-neg-in20.5%
Simplified20.5%
add-sqr-sqrt18.6%
sqrt-unprod33.4%
sqr-neg33.4%
sqrt-unprod20.8%
add-sqr-sqrt35.6%
clear-num36.3%
div-inv36.4%
Applied egg-rr36.4%
Final simplification37.4%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z) :precision binary64 (if (<= x -1.05e-159) (* x (/ y z)) (* y (/ x z))))
assert(x < y);
double code(double x, double y, double z) {
double tmp;
if (x <= -1.05e-159) {
tmp = x * (y / z);
} else {
tmp = y * (x / z);
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (x <= (-1.05d-159)) then
tmp = x * (y / z)
else
tmp = y * (x / z)
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z) {
double tmp;
if (x <= -1.05e-159) {
tmp = x * (y / z);
} else {
tmp = y * (x / z);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z): tmp = 0 if x <= -1.05e-159: tmp = x * (y / z) else: tmp = y * (x / z) return tmp
x, y = sort([x, y]) function code(x, y, z) tmp = 0.0 if (x <= -1.05e-159) tmp = Float64(x * Float64(y / z)); else tmp = Float64(y * Float64(x / z)); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z)
tmp = 0.0;
if (x <= -1.05e-159)
tmp = x * (y / z);
else
tmp = y * (x / z);
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_] := If[LessEqual[x, -1.05e-159], N[(x * N[(y / z), $MachinePrecision]), $MachinePrecision], N[(y * N[(x / z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.05 \cdot 10^{-159}:\\
\;\;\;\;x \cdot \frac{y}{z}\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{x}{z}\\
\end{array}
\end{array}
if x < -1.05e-159Initial program 80.0%
associate-*l*80.0%
times-frac88.5%
associate-/r*93.2%
associate-*r/97.5%
Simplified97.5%
Taylor expanded in z around 0 39.9%
+-commutative39.9%
unpow239.9%
times-frac40.8%
mul-1-neg40.8%
associate-*l/39.0%
distribute-rgt-neg-in39.0%
distribute-lft-out46.8%
Simplified46.8%
Taylor expanded in z around inf 21.2%
mul-1-neg21.2%
associate-*r/29.5%
distribute-rgt-neg-in29.5%
Simplified29.5%
add-sqr-sqrt19.4%
sqrt-unprod38.3%
sqr-neg38.3%
sqrt-unprod19.1%
add-sqr-sqrt24.6%
clear-num25.6%
div-inv25.6%
Applied egg-rr25.6%
clear-num26.2%
associate-/r/25.6%
clear-num24.6%
Applied egg-rr24.6%
if -1.05e-159 < x Initial program 80.6%
associate-*l*80.6%
times-frac89.5%
associate-/r*93.5%
associate-*r/94.5%
Simplified94.5%
Taylor expanded in z around 0 53.9%
+-commutative53.9%
unpow253.9%
times-frac60.5%
mul-1-neg60.5%
associate-*l/62.4%
distribute-rgt-neg-in62.4%
distribute-lft-out69.7%
Simplified69.7%
Taylor expanded in z around inf 25.2%
mul-1-neg25.2%
associate-*r/29.9%
distribute-rgt-neg-in29.9%
Simplified29.9%
add-sqr-sqrt24.4%
sqrt-unprod35.3%
sqr-neg35.3%
sqrt-unprod19.2%
add-sqr-sqrt29.5%
clear-num29.5%
div-inv29.5%
Applied egg-rr29.5%
associate-/r/32.2%
Applied egg-rr32.2%
Final simplification29.5%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z) :precision binary64 (if (<= x -5e-160) (/ x (/ z y)) (* y (/ x z))))
assert(x < y);
double code(double x, double y, double z) {
double tmp;
if (x <= -5e-160) {
tmp = x / (z / y);
} else {
tmp = y * (x / z);
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (x <= (-5d-160)) then
tmp = x / (z / y)
else
tmp = y * (x / z)
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z) {
double tmp;
if (x <= -5e-160) {
tmp = x / (z / y);
} else {
tmp = y * (x / z);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z): tmp = 0 if x <= -5e-160: tmp = x / (z / y) else: tmp = y * (x / z) return tmp
x, y = sort([x, y]) function code(x, y, z) tmp = 0.0 if (x <= -5e-160) tmp = Float64(x / Float64(z / y)); else tmp = Float64(y * Float64(x / z)); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z)
tmp = 0.0;
if (x <= -5e-160)
tmp = x / (z / y);
else
tmp = y * (x / z);
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_] := If[LessEqual[x, -5e-160], N[(x / N[(z / y), $MachinePrecision]), $MachinePrecision], N[(y * N[(x / z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -5 \cdot 10^{-160}:\\
\;\;\;\;\frac{x}{\frac{z}{y}}\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{x}{z}\\
\end{array}
\end{array}
if x < -4.99999999999999994e-160Initial program 80.0%
associate-*l*80.0%
times-frac88.5%
associate-/r*93.2%
associate-*r/97.5%
Simplified97.5%
Taylor expanded in z around 0 39.9%
+-commutative39.9%
unpow239.9%
times-frac40.8%
mul-1-neg40.8%
associate-*l/39.0%
distribute-rgt-neg-in39.0%
distribute-lft-out46.8%
Simplified46.8%
Taylor expanded in z around inf 21.2%
mul-1-neg21.2%
associate-*r/29.5%
distribute-rgt-neg-in29.5%
Simplified29.5%
add-sqr-sqrt19.4%
sqrt-unprod38.3%
sqr-neg38.3%
sqrt-unprod19.1%
add-sqr-sqrt24.6%
clear-num25.6%
div-inv25.6%
Applied egg-rr25.6%
if -4.99999999999999994e-160 < x Initial program 80.6%
associate-*l*80.6%
times-frac89.5%
associate-/r*93.5%
associate-*r/94.5%
Simplified94.5%
Taylor expanded in z around 0 53.9%
+-commutative53.9%
unpow253.9%
times-frac60.5%
mul-1-neg60.5%
associate-*l/62.4%
distribute-rgt-neg-in62.4%
distribute-lft-out69.7%
Simplified69.7%
Taylor expanded in z around inf 25.2%
mul-1-neg25.2%
associate-*r/29.9%
distribute-rgt-neg-in29.9%
Simplified29.9%
add-sqr-sqrt24.4%
sqrt-unprod35.3%
sqr-neg35.3%
sqrt-unprod19.2%
add-sqr-sqrt29.5%
clear-num29.5%
div-inv29.5%
Applied egg-rr29.5%
associate-/r/32.2%
Applied egg-rr32.2%
Final simplification29.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 80.4%
*-commutative80.4%
associate-*r/80.6%
sqr-neg80.6%
associate-*l*80.6%
associate-*l*80.6%
sqr-neg80.6%
associate-*l*80.6%
distribute-lft-in80.6%
fma-def80.6%
*-rgt-identity80.6%
Simplified80.6%
Taylor expanded in z around 0 69.8%
unpow269.8%
Simplified69.8%
Final simplification69.8%
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 80.4%
associate-*l*80.4%
times-frac89.2%
associate-/r*93.4%
associate-*r/95.6%
Simplified95.6%
Taylor expanded in z around 0 49.0%
+-commutative49.0%
unpow249.0%
times-frac53.6%
mul-1-neg53.6%
associate-*l/54.2%
distribute-rgt-neg-in54.2%
distribute-lft-out61.6%
Simplified61.6%
Taylor expanded in z around inf 23.8%
mul-1-neg23.8%
associate-*r/29.8%
distribute-rgt-neg-in29.8%
Simplified29.8%
add-sqr-sqrt22.7%
sqrt-unprod36.4%
sqr-neg36.4%
sqrt-unprod19.2%
add-sqr-sqrt27.7%
clear-num28.1%
div-inv28.1%
Applied egg-rr28.1%
associate-/r/27.4%
Applied egg-rr27.4%
Final simplification27.4%
(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 2023272
(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))))