
(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 14 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 82.3%
associate-*l*82.3%
times-frac96.3%
distribute-lft-in96.3%
fma-def96.3%
*-rgt-identity96.3%
Simplified96.3%
*-commutative96.3%
associate-*l/96.1%
fma-udef96.1%
distribute-lft1-in96.1%
frac-times93.9%
associate-*r/98.6%
Applied egg-rr98.6%
Final simplification98.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 -0.5)
(/ (/ y z) (* z (/ z x)))
(if (<= t_0 1e-71)
(/ (* 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 <= -0.5) {
tmp = (y / z) / (z * (z / x));
} else if (t_0 <= 1e-71) {
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 <= (-0.5d0)) then
tmp = (y / z) / (z * (z / x))
else if (t_0 <= 1d-71) 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 <= -0.5) {
tmp = (y / z) / (z * (z / x));
} else if (t_0 <= 1e-71) {
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 <= -0.5: tmp = (y / z) / (z * (z / x)) elif t_0 <= 1e-71: 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 <= -0.5) tmp = Float64(Float64(y / z) / Float64(z * Float64(z / x))); elseif (t_0 <= 1e-71) 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 <= -0.5)
tmp = (y / z) / (z * (z / x));
elseif (t_0 <= 1e-71)
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, -0.5], N[(N[(y / z), $MachinePrecision] / N[(z * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 1e-71], 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 -0.5:\\
\;\;\;\;\frac{\frac{y}{z}}{z \cdot \frac{z}{x}}\\
\mathbf{elif}\;t_0 \leq 10^{-71}:\\
\;\;\;\;\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)) < -0.5Initial program 81.4%
/-rgt-identity81.4%
associate-/l*81.4%
associate-/l/86.0%
associate-*l*90.3%
associate-*r/90.3%
*-rgt-identity90.3%
associate-*l*90.3%
associate-*r/90.4%
distribute-lft-in90.3%
fma-def90.4%
*-rgt-identity90.4%
Simplified90.4%
Taylor expanded in z around inf 89.1%
unpow289.1%
Simplified89.1%
*-un-lft-identity89.1%
*-commutative89.1%
times-frac93.0%
clear-num93.0%
Applied egg-rr93.0%
associate-/r*97.2%
clear-num97.2%
frac-times98.5%
*-commutative98.5%
*-un-lft-identity98.5%
Applied egg-rr98.5%
if -0.5 < (*.f64 (*.f64 z z) (+.f64 z 1)) < 9.9999999999999992e-72Initial program 78.8%
associate-*l*78.8%
times-frac98.1%
distribute-lft-in98.1%
fma-def98.1%
*-rgt-identity98.1%
Simplified98.1%
*-commutative98.1%
associate-*l/98.1%
fma-udef98.1%
distribute-lft1-in98.1%
frac-times88.6%
associate-*r/98.1%
Applied egg-rr98.1%
Taylor expanded in z around 0 90.4%
associate-*r/98.1%
Simplified98.1%
if 9.9999999999999992e-72 < (*.f64 (*.f64 z z) (+.f64 z 1)) Initial program 87.9%
times-frac96.1%
Simplified96.1%
Final simplification97.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 5.8e-12))) (* (/ 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 <= 5.8e-12)) {
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 <= 5.8d-12))) 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 <= 5.8e-12)) {
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 <= 5.8e-12): 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 <= 5.8e-12)) 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 <= 5.8e-12)))
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, 5.8e-12]], $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 5.8 \cdot 10^{-12}\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 5.8000000000000003e-12 < z Initial program 83.2%
associate-*l*83.2%
times-frac95.2%
distribute-lft-in95.2%
fma-def95.2%
*-rgt-identity95.2%
Simplified95.2%
Taylor expanded in z around inf 93.6%
unpow293.6%
Simplified93.6%
if -1 < z < 5.8000000000000003e-12Initial program 81.3%
associate-*l*81.3%
times-frac97.5%
distribute-lft-in97.5%
fma-def97.5%
*-rgt-identity97.5%
Simplified97.5%
*-commutative97.5%
associate-*l/97.5%
fma-udef97.5%
distribute-lft1-in97.5%
frac-times89.2%
associate-*r/97.5%
Applied egg-rr97.5%
Taylor expanded in z around 0 90.1%
associate-*r/96.1%
Simplified96.1%
Final simplification94.8%
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 5.8e-12))) (* (/ y z) (/ x (* z z))) (/ (* y (/ x z)) z)))
assert(x < y);
double code(double x, double y, double z) {
double tmp;
if ((z <= -1.0) || !(z <= 5.8e-12)) {
tmp = (y / z) * (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 ((z <= (-1.0d0)) .or. (.not. (z <= 5.8d-12))) then
tmp = (y / z) * (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 ((z <= -1.0) || !(z <= 5.8e-12)) {
tmp = (y / z) * (x / (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 <= 5.8e-12): tmp = (y / z) * (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 ((z <= -1.0) || !(z <= 5.8e-12)) tmp = Float64(Float64(y / z) * Float64(x / 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 <= 5.8e-12)))
tmp = (y / z) * (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[Or[LessEqual[z, -1.0], N[Not[LessEqual[z, 5.8e-12]], $MachinePrecision]], N[(N[(y / z), $MachinePrecision] * N[(x / 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 5.8 \cdot 10^{-12}\right):\\
\;\;\;\;\frac{y}{z} \cdot \frac{x}{z \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{y \cdot \frac{x}{z}}{z}\\
\end{array}
\end{array}
if z < -1 or 5.8000000000000003e-12 < z Initial program 83.2%
/-rgt-identity83.2%
associate-/l*83.2%
associate-/l/87.2%
associate-*l*91.5%
associate-*r/91.5%
*-rgt-identity91.5%
associate-*l*91.5%
associate-*r/91.5%
distribute-lft-in91.5%
fma-def91.5%
*-rgt-identity91.5%
Simplified91.5%
Taylor expanded in z around inf 89.8%
unpow289.8%
Simplified89.8%
associate-/r*93.1%
associate-/l*95.2%
associate-/r/96.7%
associate-/r*93.9%
Applied egg-rr93.9%
if -1 < z < 5.8000000000000003e-12Initial program 81.3%
associate-*l*81.3%
times-frac97.5%
distribute-lft-in97.5%
fma-def97.5%
*-rgt-identity97.5%
Simplified97.5%
*-commutative97.5%
associate-*l/97.5%
fma-udef97.5%
distribute-lft1-in97.5%
frac-times89.2%
associate-*r/97.5%
Applied egg-rr97.5%
Taylor expanded in z around 0 90.1%
associate-*r/96.1%
Simplified96.1%
Final simplification95.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 5.8e-12))) (/ (/ y z) (* z (/ z x))) (/ (* y (/ x z)) z)))
assert(x < y);
double code(double x, double y, double z) {
double tmp;
if ((z <= -1.0) || !(z <= 5.8e-12)) {
tmp = (y / z) / (z * (z / x));
} 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 <= 5.8d-12))) then
tmp = (y / z) / (z * (z / x))
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 <= 5.8e-12)) {
tmp = (y / z) / (z * (z / x));
} 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 <= 5.8e-12): tmp = (y / z) / (z * (z / x)) 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 <= 5.8e-12)) tmp = Float64(Float64(y / z) / Float64(z * Float64(z / x))); 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 <= 5.8e-12)))
tmp = (y / z) / (z * (z / x));
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, 5.8e-12]], $MachinePrecision]], N[(N[(y / z), $MachinePrecision] / N[(z * N[(z / x), $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 5.8 \cdot 10^{-12}\right):\\
\;\;\;\;\frac{\frac{y}{z}}{z \cdot \frac{z}{x}}\\
\mathbf{else}:\\
\;\;\;\;\frac{y \cdot \frac{x}{z}}{z}\\
\end{array}
\end{array}
if z < -1 or 5.8000000000000003e-12 < z Initial program 83.2%
/-rgt-identity83.2%
associate-/l*83.2%
associate-/l/87.2%
associate-*l*91.5%
associate-*r/91.5%
*-rgt-identity91.5%
associate-*l*91.5%
associate-*r/91.5%
distribute-lft-in91.5%
fma-def91.5%
*-rgt-identity91.5%
Simplified91.5%
Taylor expanded in z around inf 89.8%
unpow289.8%
Simplified89.8%
*-un-lft-identity89.8%
*-commutative89.8%
times-frac93.0%
clear-num93.6%
Applied egg-rr93.6%
associate-/r*95.7%
clear-num95.1%
frac-times96.7%
*-commutative96.7%
*-un-lft-identity96.7%
Applied egg-rr96.7%
if -1 < z < 5.8000000000000003e-12Initial program 81.3%
associate-*l*81.3%
times-frac97.5%
distribute-lft-in97.5%
fma-def97.5%
*-rgt-identity97.5%
Simplified97.5%
*-commutative97.5%
associate-*l/97.5%
fma-udef97.5%
distribute-lft1-in97.5%
frac-times89.2%
associate-*r/97.5%
Applied egg-rr97.5%
Taylor expanded in z around 0 90.1%
associate-*r/96.1%
Simplified96.1%
Final simplification96.5%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z) :precision binary64 (if (<= z -1.0) (/ x (* z (/ (* z z) y))) (if (<= z 5.8e-12) (/ (* y (/ x z)) z) (* (/ y z) (/ x (* z z))))))
assert(x < y);
double code(double x, double y, double z) {
double tmp;
if (z <= -1.0) {
tmp = x / (z * ((z * z) / y));
} else if (z <= 5.8e-12) {
tmp = (y * (x / z)) / z;
} else {
tmp = (y / z) * (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)) then
tmp = x / (z * ((z * z) / y))
else if (z <= 5.8d-12) then
tmp = (y * (x / z)) / z
else
tmp = (y / z) * (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) {
tmp = x / (z * ((z * z) / y));
} else if (z <= 5.8e-12) {
tmp = (y * (x / z)) / z;
} else {
tmp = (y / z) * (x / (z * z));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z): tmp = 0 if z <= -1.0: tmp = x / (z * ((z * z) / y)) elif z <= 5.8e-12: tmp = (y * (x / z)) / z else: tmp = (y / z) * (x / (z * z)) return tmp
x, y = sort([x, y]) function code(x, y, z) tmp = 0.0 if (z <= -1.0) tmp = Float64(x / Float64(z * Float64(Float64(z * z) / y))); elseif (z <= 5.8e-12) tmp = Float64(Float64(y * Float64(x / z)) / z); else tmp = Float64(Float64(y / z) * 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 (z <= -1.0)
tmp = x / (z * ((z * z) / y));
elseif (z <= 5.8e-12)
tmp = (y * (x / z)) / z;
else
tmp = (y / z) * (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[z, -1.0], N[(x / N[(z * N[(N[(z * z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 5.8e-12], N[(N[(y * N[(x / z), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], N[(N[(y / z), $MachinePrecision] * N[(x / N[(z * z), $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{z \cdot z}{y}}\\
\mathbf{elif}\;z \leq 5.8 \cdot 10^{-12}:\\
\;\;\;\;\frac{y \cdot \frac{x}{z}}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{z} \cdot \frac{x}{z \cdot z}\\
\end{array}
\end{array}
if z < -1Initial program 81.4%
/-rgt-identity81.4%
associate-/l*81.4%
associate-/l/86.0%
associate-*l*90.3%
associate-*r/90.3%
*-rgt-identity90.3%
associate-*l*90.3%
associate-*r/90.4%
distribute-lft-in90.3%
fma-def90.4%
*-rgt-identity90.4%
Simplified90.4%
Taylor expanded in z around inf 89.1%
unpow289.1%
Simplified89.1%
if -1 < z < 5.8000000000000003e-12Initial program 81.3%
associate-*l*81.3%
times-frac97.5%
distribute-lft-in97.5%
fma-def97.5%
*-rgt-identity97.5%
Simplified97.5%
*-commutative97.5%
associate-*l/97.5%
fma-udef97.5%
distribute-lft1-in97.5%
frac-times89.2%
associate-*r/97.5%
Applied egg-rr97.5%
Taylor expanded in z around 0 90.1%
associate-*r/96.1%
Simplified96.1%
if 5.8000000000000003e-12 < z Initial program 85.1%
/-rgt-identity85.1%
associate-/l*85.0%
associate-/l/88.3%
associate-*l*92.7%
associate-*r/92.8%
*-rgt-identity92.8%
associate-*l*92.7%
associate-*r/92.7%
distribute-lft-in92.7%
fma-def92.7%
*-rgt-identity92.7%
Simplified92.7%
Taylor expanded in z around inf 90.7%
unpow290.7%
Simplified90.7%
associate-/r*93.1%
associate-/l*93.1%
associate-/r/94.8%
associate-/r*94.8%
Applied egg-rr94.8%
Final simplification93.9%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z) :precision binary64 (if (<= z -1.0) (/ (* x (/ (/ y z) z)) z) (if (<= z 5.8e-12) (/ (* y (/ x z)) z) (* (/ y z) (/ x (* z z))))))
assert(x < y);
double code(double x, double y, double z) {
double tmp;
if (z <= -1.0) {
tmp = (x * ((y / z) / z)) / z;
} else if (z <= 5.8e-12) {
tmp = (y * (x / z)) / z;
} else {
tmp = (y / z) * (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)) then
tmp = (x * ((y / z) / z)) / z
else if (z <= 5.8d-12) then
tmp = (y * (x / z)) / z
else
tmp = (y / z) * (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) {
tmp = (x * ((y / z) / z)) / z;
} else if (z <= 5.8e-12) {
tmp = (y * (x / z)) / z;
} else {
tmp = (y / z) * (x / (z * z));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z): tmp = 0 if z <= -1.0: tmp = (x * ((y / z) / z)) / z elif z <= 5.8e-12: tmp = (y * (x / z)) / z else: tmp = (y / z) * (x / (z * z)) return tmp
x, y = sort([x, y]) function code(x, y, z) tmp = 0.0 if (z <= -1.0) tmp = Float64(Float64(x * Float64(Float64(y / z) / z)) / z); elseif (z <= 5.8e-12) tmp = Float64(Float64(y * Float64(x / z)) / z); else tmp = Float64(Float64(y / z) * 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 (z <= -1.0)
tmp = (x * ((y / z) / z)) / z;
elseif (z <= 5.8e-12)
tmp = (y * (x / z)) / z;
else
tmp = (y / z) * (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[z, -1.0], N[(N[(x * N[(N[(y / z), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[z, 5.8e-12], N[(N[(y * N[(x / z), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], N[(N[(y / z), $MachinePrecision] * N[(x / N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1:\\
\;\;\;\;\frac{x \cdot \frac{\frac{y}{z}}{z}}{z}\\
\mathbf{elif}\;z \leq 5.8 \cdot 10^{-12}:\\
\;\;\;\;\frac{y \cdot \frac{x}{z}}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{z} \cdot \frac{x}{z \cdot z}\\
\end{array}
\end{array}
if z < -1Initial program 81.4%
associate-*l*81.4%
times-frac94.3%
distribute-lft-in94.3%
fma-def94.3%
*-rgt-identity94.3%
Simplified94.3%
*-commutative94.3%
associate-*l/92.9%
fma-udef92.9%
distribute-lft1-in92.9%
frac-times99.7%
associate-*r/99.8%
Applied egg-rr99.8%
Taylor expanded in z around inf 85.6%
unpow285.6%
*-commutative85.6%
associate-*r/93.1%
associate-/r*97.2%
Simplified97.2%
if -1 < z < 5.8000000000000003e-12Initial program 81.3%
associate-*l*81.3%
times-frac97.5%
distribute-lft-in97.5%
fma-def97.5%
*-rgt-identity97.5%
Simplified97.5%
*-commutative97.5%
associate-*l/97.5%
fma-udef97.5%
distribute-lft1-in97.5%
frac-times89.2%
associate-*r/97.5%
Applied egg-rr97.5%
Taylor expanded in z around 0 90.1%
associate-*r/96.1%
Simplified96.1%
if 5.8000000000000003e-12 < z Initial program 85.1%
/-rgt-identity85.1%
associate-/l*85.0%
associate-/l/88.3%
associate-*l*92.7%
associate-*r/92.8%
*-rgt-identity92.8%
associate-*l*92.7%
associate-*r/92.7%
distribute-lft-in92.7%
fma-def92.7%
*-rgt-identity92.7%
Simplified92.7%
Taylor expanded in z around inf 90.7%
unpow290.7%
Simplified90.7%
associate-/r*93.1%
associate-/l*93.1%
associate-/r/94.8%
associate-/r*94.8%
Applied egg-rr94.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 (<= z -1.0) (/ (/ x z) (* z (/ z y))) (if (<= z 5.8e-12) (/ (* y (/ x z)) z) (* (/ y z) (/ x (* z z))))))
assert(x < y);
double code(double x, double y, double z) {
double tmp;
if (z <= -1.0) {
tmp = (x / z) / (z * (z / y));
} else if (z <= 5.8e-12) {
tmp = (y * (x / z)) / z;
} else {
tmp = (y / z) * (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)) then
tmp = (x / z) / (z * (z / y))
else if (z <= 5.8d-12) then
tmp = (y * (x / z)) / z
else
tmp = (y / z) * (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) {
tmp = (x / z) / (z * (z / y));
} else if (z <= 5.8e-12) {
tmp = (y * (x / z)) / z;
} else {
tmp = (y / z) * (x / (z * z));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z): tmp = 0 if z <= -1.0: tmp = (x / z) / (z * (z / y)) elif z <= 5.8e-12: tmp = (y * (x / z)) / z else: tmp = (y / z) * (x / (z * z)) return tmp
x, y = sort([x, y]) function code(x, y, z) tmp = 0.0 if (z <= -1.0) tmp = Float64(Float64(x / z) / Float64(z * Float64(z / y))); elseif (z <= 5.8e-12) tmp = Float64(Float64(y * Float64(x / z)) / z); else tmp = Float64(Float64(y / z) * 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 (z <= -1.0)
tmp = (x / z) / (z * (z / y));
elseif (z <= 5.8e-12)
tmp = (y * (x / z)) / z;
else
tmp = (y / z) * (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[z, -1.0], N[(N[(x / z), $MachinePrecision] / N[(z * N[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 5.8e-12], N[(N[(y * N[(x / z), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], N[(N[(y / z), $MachinePrecision] * N[(x / N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1:\\
\;\;\;\;\frac{\frac{x}{z}}{z \cdot \frac{z}{y}}\\
\mathbf{elif}\;z \leq 5.8 \cdot 10^{-12}:\\
\;\;\;\;\frac{y \cdot \frac{x}{z}}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{z} \cdot \frac{x}{z \cdot z}\\
\end{array}
\end{array}
if z < -1Initial program 81.4%
/-rgt-identity81.4%
associate-/l*81.4%
associate-/l/86.0%
associate-*l*90.3%
associate-*r/90.3%
*-rgt-identity90.3%
associate-*l*90.3%
associate-*r/90.4%
distribute-lft-in90.3%
fma-def90.4%
*-rgt-identity90.4%
Simplified90.4%
Taylor expanded in z around inf 89.1%
unpow289.1%
Simplified89.1%
associate-/r*93.1%
add-sqr-sqrt49.7%
*-un-lft-identity49.7%
times-frac49.7%
div-inv49.7%
associate-*l*52.4%
div-inv52.4%
Applied egg-rr52.4%
times-frac52.4%
*-lft-identity52.4%
rem-square-sqrt97.2%
Simplified97.2%
if -1 < z < 5.8000000000000003e-12Initial program 81.3%
associate-*l*81.3%
times-frac97.5%
distribute-lft-in97.5%
fma-def97.5%
*-rgt-identity97.5%
Simplified97.5%
*-commutative97.5%
associate-*l/97.5%
fma-udef97.5%
distribute-lft1-in97.5%
frac-times89.2%
associate-*r/97.5%
Applied egg-rr97.5%
Taylor expanded in z around 0 90.1%
associate-*r/96.1%
Simplified96.1%
if 5.8000000000000003e-12 < z Initial program 85.1%
/-rgt-identity85.1%
associate-/l*85.0%
associate-/l/88.3%
associate-*l*92.7%
associate-*r/92.8%
*-rgt-identity92.8%
associate-*l*92.7%
associate-*r/92.7%
distribute-lft-in92.7%
fma-def92.7%
*-rgt-identity92.7%
Simplified92.7%
Taylor expanded in z around inf 90.7%
unpow290.7%
Simplified90.7%
associate-/r*93.1%
associate-/l*93.1%
associate-/r/94.8%
associate-/r*94.8%
Applied egg-rr94.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 -1e-310))) (/ y (/ z x)) (* (/ y z) (- x))))
assert(x < y);
double code(double x, double y, double z) {
double tmp;
if ((z <= -1.0) || !(z <= -1e-310)) {
tmp = y / (z / x);
} else {
tmp = (y / z) * -x;
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if ((z <= (-1.0d0)) .or. (.not. (z <= (-1d-310)))) then
tmp = y / (z / x)
else
tmp = (y / z) * -x
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -1.0) || !(z <= -1e-310)) {
tmp = y / (z / x);
} else {
tmp = (y / z) * -x;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z): tmp = 0 if (z <= -1.0) or not (z <= -1e-310): tmp = y / (z / x) else: tmp = (y / z) * -x return tmp
x, y = sort([x, y]) function code(x, y, z) tmp = 0.0 if ((z <= -1.0) || !(z <= -1e-310)) tmp = Float64(y / Float64(z / x)); else tmp = Float64(Float64(y / z) * Float64(-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) || ~((z <= -1e-310)))
tmp = y / (z / x);
else
tmp = (y / z) * -x;
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_] := If[Or[LessEqual[z, -1.0], N[Not[LessEqual[z, -1e-310]], $MachinePrecision]], N[(y / N[(z / x), $MachinePrecision]), $MachinePrecision], N[(N[(y / z), $MachinePrecision] * (-x)), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1 \lor \neg \left(z \leq -1 \cdot 10^{-310}\right):\\
\;\;\;\;\frac{y}{\frac{z}{x}}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{z} \cdot \left(-x\right)\\
\end{array}
\end{array}
if z < -1 or -9.999999999999969e-311 < z Initial program 83.2%
associate-*l*83.2%
times-frac95.6%
distribute-lft-in95.6%
fma-def95.6%
*-rgt-identity95.6%
Simplified95.6%
Taylor expanded in z around 0 52.8%
neg-mul-152.8%
+-commutative52.8%
unsub-neg52.8%
Simplified52.8%
Taylor expanded in z around inf 19.9%
associate-*r/23.8%
neg-mul-123.8%
distribute-rgt-neg-in23.8%
distribute-neg-frac23.8%
Simplified23.8%
add-sqr-sqrt19.3%
sqrt-unprod36.8%
distribute-frac-neg36.8%
distribute-frac-neg36.8%
sqr-neg36.8%
sqrt-unprod22.4%
add-sqr-sqrt35.3%
clear-num35.8%
div-inv35.8%
Applied egg-rr35.8%
if -1 < z < -9.999999999999969e-311Initial program 79.9%
associate-*l*79.9%
times-frac98.3%
distribute-lft-in98.3%
fma-def98.3%
*-rgt-identity98.3%
Simplified98.3%
Taylor expanded in z around 0 97.9%
neg-mul-197.9%
+-commutative97.9%
unsub-neg97.9%
Simplified97.9%
Taylor expanded in z around inf 36.4%
associate-*r/36.4%
neg-mul-136.4%
distribute-rgt-neg-in36.4%
associate-*l/39.2%
distribute-rgt-neg-out39.2%
Simplified39.2%
Final simplification36.7%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z) :precision binary64 (if (<= x -6000000000.0) (/ x (* z (/ z y))) (* (/ x z) (/ y z))))
assert(x < y);
double code(double x, double y, double z) {
double tmp;
if (x <= -6000000000.0) {
tmp = x / (z * (z / y));
} else {
tmp = (x / z) * (y / z);
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (x <= (-6000000000.0d0)) then
tmp = x / (z * (z / y))
else
tmp = (x / z) * (y / z)
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z) {
double tmp;
if (x <= -6000000000.0) {
tmp = x / (z * (z / y));
} else {
tmp = (x / z) * (y / z);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z): tmp = 0 if x <= -6000000000.0: tmp = x / (z * (z / y)) else: tmp = (x / z) * (y / z) return tmp
x, y = sort([x, y]) function code(x, y, z) tmp = 0.0 if (x <= -6000000000.0) tmp = Float64(x / Float64(z * Float64(z / y))); else tmp = Float64(Float64(x / z) * Float64(y / z)); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z)
tmp = 0.0;
if (x <= -6000000000.0)
tmp = x / (z * (z / y));
else
tmp = (x / z) * (y / z);
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_] := If[LessEqual[x, -6000000000.0], N[(x / N[(z * N[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / z), $MachinePrecision] * N[(y / z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -6000000000:\\
\;\;\;\;\frac{x}{z \cdot \frac{z}{y}}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{z} \cdot \frac{y}{z}\\
\end{array}
\end{array}
if x < -6e9Initial program 82.7%
/-rgt-identity82.7%
associate-/l*82.6%
associate-/l/87.7%
associate-*l*89.3%
associate-*r/89.3%
*-rgt-identity89.3%
associate-*l*89.4%
associate-*r/89.3%
distribute-lft-in89.3%
fma-def89.3%
*-rgt-identity89.3%
Simplified89.3%
Taylor expanded in z around 0 76.1%
if -6e9 < x Initial program 82.2%
associate-*l*82.2%
times-frac97.8%
distribute-lft-in97.8%
fma-def97.8%
*-rgt-identity97.8%
Simplified97.8%
Taylor expanded in z around 0 68.8%
unpow268.8%
associate-/l/72.7%
associate-*r/76.9%
associate-*l/77.8%
Simplified77.8%
Final simplification77.4%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z) :precision binary64 (if (<= y 2e-56) (/ x (* z (/ z y))) (/ y (* z (/ z x)))))
assert(x < y);
double code(double x, double y, double z) {
double tmp;
if (y <= 2e-56) {
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 <= 2d-56) 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 <= 2e-56) {
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 <= 2e-56: 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 <= 2e-56) 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 <= 2e-56)
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, 2e-56], 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 2 \cdot 10^{-56}:\\
\;\;\;\;\frac{x}{z \cdot \frac{z}{y}}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{z \cdot \frac{z}{x}}\\
\end{array}
\end{array}
if y < 2.0000000000000001e-56Initial program 83.5%
/-rgt-identity83.5%
associate-/l*83.5%
associate-/l/85.2%
associate-*l*85.7%
associate-*r/85.7%
*-rgt-identity85.7%
associate-*l*91.2%
associate-*r/91.2%
distribute-lft-in91.2%
fma-def91.2%
*-rgt-identity91.2%
Simplified91.2%
Taylor expanded in z around 0 80.5%
if 2.0000000000000001e-56 < y Initial program 79.1%
associate-*l*79.1%
times-frac96.9%
distribute-lft-in96.8%
fma-def96.9%
*-rgt-identity96.9%
Simplified96.9%
Taylor expanded in z around 0 59.6%
unpow259.6%
associate-/l*68.1%
Simplified68.1%
associate-/l*68.1%
associate-/r/68.1%
Applied egg-rr68.1%
Final simplification77.1%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z) :precision binary64 (let* ((t_0 (/ y (/ z x)))) (if (<= z -1e-310) (- t_0) t_0)))
assert(x < y);
double code(double x, double y, double z) {
double t_0 = y / (z / x);
double tmp;
if (z <= -1e-310) {
tmp = -t_0;
} else {
tmp = t_0;
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = y / (z / x)
if (z <= (-1d-310)) then
tmp = -t_0
else
tmp = t_0
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z) {
double t_0 = y / (z / x);
double tmp;
if (z <= -1e-310) {
tmp = -t_0;
} else {
tmp = t_0;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z): t_0 = y / (z / x) tmp = 0 if z <= -1e-310: tmp = -t_0 else: tmp = t_0 return tmp
x, y = sort([x, y]) function code(x, y, z) t_0 = Float64(y / Float64(z / x)) tmp = 0.0 if (z <= -1e-310) tmp = Float64(-t_0); else tmp = t_0; end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z)
t_0 = y / (z / x);
tmp = 0.0;
if (z <= -1e-310)
tmp = -t_0;
else
tmp = t_0;
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
code[x_, y_, z_] := Block[{t$95$0 = N[(y / N[(z / x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1e-310], (-t$95$0), t$95$0]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_0 := \frac{y}{\frac{z}{x}}\\
\mathbf{if}\;z \leq -1 \cdot 10^{-310}:\\
\;\;\;\;-t_0\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if z < -9.999999999999969e-311Initial program 80.6%
associate-*l*80.6%
times-frac96.3%
distribute-lft-in96.3%
fma-def96.3%
*-rgt-identity96.3%
Simplified96.3%
Taylor expanded in z around 0 64.8%
neg-mul-164.8%
+-commutative64.8%
unsub-neg64.8%
Simplified64.8%
Taylor expanded in z around inf 32.0%
associate-*r/32.0%
neg-mul-132.0%
distribute-rgt-neg-in32.0%
associate-*l/36.2%
distribute-rgt-neg-out36.2%
Simplified36.2%
associate-*l/32.0%
associate-/l*35.4%
Applied egg-rr35.4%
if -9.999999999999969e-311 < z Initial program 84.2%
associate-*l*84.2%
times-frac96.3%
distribute-lft-in96.3%
fma-def96.3%
*-rgt-identity96.3%
Simplified96.3%
Taylor expanded in z around 0 64.7%
neg-mul-164.7%
+-commutative64.7%
unsub-neg64.7%
Simplified64.7%
Taylor expanded in z around inf 15.5%
associate-*r/19.3%
neg-mul-119.3%
distribute-rgt-neg-in19.3%
distribute-neg-frac19.3%
Simplified19.3%
add-sqr-sqrt15.3%
sqrt-unprod30.0%
distribute-frac-neg30.0%
distribute-frac-neg30.0%
sqr-neg30.0%
sqrt-unprod21.6%
add-sqr-sqrt35.1%
clear-num35.8%
div-inv35.8%
Applied egg-rr35.8%
Final simplification35.6%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z) :precision binary64 (* (/ x z) (/ y z)))
assert(x < y);
double code(double x, double y, double z) {
return (x / z) * (y / z);
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = (x / z) * (y / z)
end function
assert x < y;
public static double code(double x, double y, double z) {
return (x / z) * (y / z);
}
[x, y] = sort([x, y]) def code(x, y, z): return (x / z) * (y / z)
x, y = sort([x, y]) function code(x, y, z) return Float64(Float64(x / z) * Float64(y / z)) end
x, y = num2cell(sort([x, y])){:}
function tmp = code(x, y, z)
tmp = (x / z) * (y / z);
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_] := N[(N[(x / z), $MachinePrecision] * N[(y / z), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\frac{x}{z} \cdot \frac{y}{z}
\end{array}
Initial program 82.3%
associate-*l*82.3%
times-frac96.3%
distribute-lft-in96.3%
fma-def96.3%
*-rgt-identity96.3%
Simplified96.3%
Taylor expanded in z around 0 69.8%
unpow269.8%
associate-/l/71.3%
associate-*r/74.5%
associate-*l/75.6%
Simplified75.6%
Final simplification75.6%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z) :precision binary64 (/ y (/ z x)))
assert(x < y);
double code(double x, double y, double z) {
return y / (z / x);
}
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)
end function
assert x < y;
public static double code(double x, double y, double z) {
return y / (z / x);
}
[x, y] = sort([x, y]) def code(x, y, z): return y / (z / x)
x, y = sort([x, y]) function code(x, y, z) return Float64(y / Float64(z / x)) end
x, y = num2cell(sort([x, y])){:}
function tmp = code(x, y, z)
tmp = y / (z / x);
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_] := N[(y / N[(z / x), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\frac{y}{\frac{z}{x}}
\end{array}
Initial program 82.3%
associate-*l*82.3%
times-frac96.3%
distribute-lft-in96.3%
fma-def96.3%
*-rgt-identity96.3%
Simplified96.3%
Taylor expanded in z around 0 64.8%
neg-mul-164.8%
+-commutative64.8%
unsub-neg64.8%
Simplified64.8%
Taylor expanded in z around inf 24.3%
associate-*r/27.9%
neg-mul-127.9%
distribute-rgt-neg-in27.9%
distribute-neg-frac27.9%
Simplified27.9%
add-sqr-sqrt20.5%
sqrt-unprod35.1%
distribute-frac-neg35.1%
distribute-frac-neg35.1%
sqr-neg35.1%
sqrt-unprod16.9%
add-sqr-sqrt26.6%
clear-num26.9%
div-inv26.9%
Applied egg-rr26.9%
Final simplification26.9%
(FPCore (x y z) :precision binary64 (if (< z 249.6182814532307) (/ (* y (/ x z)) (+ z (* z z))) (/ (* (/ (/ y z) (+ 1.0 z)) x) z)))
double code(double x, double y, double z) {
double tmp;
if (z < 249.6182814532307) {
tmp = (y * (x / z)) / (z + (z * z));
} else {
tmp = (((y / z) / (1.0 + z)) * x) / z;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (z < 249.6182814532307d0) then
tmp = (y * (x / z)) / (z + (z * z))
else
tmp = (((y / z) / (1.0d0 + z)) * x) / z
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z < 249.6182814532307) {
tmp = (y * (x / z)) / (z + (z * z));
} else {
tmp = (((y / z) / (1.0 + z)) * x) / z;
}
return tmp;
}
def code(x, y, z): tmp = 0 if z < 249.6182814532307: tmp = (y * (x / z)) / (z + (z * z)) else: tmp = (((y / z) / (1.0 + z)) * x) / z return tmp
function code(x, y, z) tmp = 0.0 if (z < 249.6182814532307) tmp = Float64(Float64(y * Float64(x / z)) / Float64(z + Float64(z * z))); else tmp = Float64(Float64(Float64(Float64(y / z) / Float64(1.0 + z)) * x) / z); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z < 249.6182814532307) tmp = (y * (x / z)) / (z + (z * z)); else tmp = (((y / z) / (1.0 + z)) * x) / z; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Less[z, 249.6182814532307], N[(N[(y * N[(x / z), $MachinePrecision]), $MachinePrecision] / N[(z + N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(y / z), $MachinePrecision] / N[(1.0 + z), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision] / z), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z < 249.6182814532307:\\
\;\;\;\;\frac{y \cdot \frac{x}{z}}{z + z \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\frac{y}{z}}{1 + z} \cdot x}{z}\\
\end{array}
\end{array}
herbie shell --seed 2023185
(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))))