
(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 15 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z) :precision binary64 (/ (* x y) (* (* z z) (+ z 1.0))))
double code(double x, double y, double z) {
return (x * y) / ((z * z) * (z + 1.0));
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = (x * y) / ((z * z) * (z + 1.0d0))
end function
public static double code(double x, double y, double z) {
return (x * y) / ((z * z) * (z + 1.0));
}
def code(x, y, z): return (x * y) / ((z * z) * (z + 1.0))
function code(x, y, z) return Float64(Float64(x * y) / Float64(Float64(z * z) * Float64(z + 1.0))) end
function tmp = code(x, y, z) tmp = (x * y) / ((z * z) * (z + 1.0)); end
code[x_, y_, z_] := N[(N[(x * y), $MachinePrecision] / N[(N[(z * z), $MachinePrecision] * N[(z + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x \cdot y}{\left(z \cdot z\right) \cdot \left(z + 1\right)}
\end{array}
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* (+ z 1.0) (* z z))))
(if (<= t_0 -2e+42)
(/ (/ x z) (* z (/ z y)))
(if (<= t_0 1e-291)
(/ 1.0 (* z (/ (/ z x) y)))
(if (<= t_0 5e+151)
(* (/ y (* z z)) (/ x (+ z 1.0)))
(/ (/ y z) (* z (/ z x))))))))assert(x < y);
double code(double x, double y, double z) {
double t_0 = (z + 1.0) * (z * z);
double tmp;
if (t_0 <= -2e+42) {
tmp = (x / z) / (z * (z / y));
} else if (t_0 <= 1e-291) {
tmp = 1.0 / (z * ((z / x) / y));
} else if (t_0 <= 5e+151) {
tmp = (y / (z * z)) * (x / (z + 1.0));
} 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) :: t_0
real(8) :: tmp
t_0 = (z + 1.0d0) * (z * z)
if (t_0 <= (-2d+42)) then
tmp = (x / z) / (z * (z / y))
else if (t_0 <= 1d-291) then
tmp = 1.0d0 / (z * ((z / x) / y))
else if (t_0 <= 5d+151) then
tmp = (y / (z * z)) * (x / (z + 1.0d0))
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 t_0 = (z + 1.0) * (z * z);
double tmp;
if (t_0 <= -2e+42) {
tmp = (x / z) / (z * (z / y));
} else if (t_0 <= 1e-291) {
tmp = 1.0 / (z * ((z / x) / y));
} else if (t_0 <= 5e+151) {
tmp = (y / (z * z)) * (x / (z + 1.0));
} else {
tmp = (y / z) / (z * (z / x));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z): t_0 = (z + 1.0) * (z * z) tmp = 0 if t_0 <= -2e+42: tmp = (x / z) / (z * (z / y)) elif t_0 <= 1e-291: tmp = 1.0 / (z * ((z / x) / y)) elif t_0 <= 5e+151: tmp = (y / (z * z)) * (x / (z + 1.0)) else: tmp = (y / z) / (z * (z / x)) 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 <= -2e+42) tmp = Float64(Float64(x / z) / Float64(z * Float64(z / y))); elseif (t_0 <= 1e-291) tmp = Float64(1.0 / Float64(z * Float64(Float64(z / x) / y))); elseif (t_0 <= 5e+151) tmp = Float64(Float64(y / Float64(z * z)) * Float64(x / Float64(z + 1.0))); 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)
t_0 = (z + 1.0) * (z * z);
tmp = 0.0;
if (t_0 <= -2e+42)
tmp = (x / z) / (z * (z / y));
elseif (t_0 <= 1e-291)
tmp = 1.0 / (z * ((z / x) / y));
elseif (t_0 <= 5e+151)
tmp = (y / (z * z)) * (x / (z + 1.0));
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_] := Block[{t$95$0 = N[(N[(z + 1.0), $MachinePrecision] * N[(z * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -2e+42], N[(N[(x / z), $MachinePrecision] / N[(z * N[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 1e-291], N[(1.0 / N[(z * N[(N[(z / x), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 5e+151], N[(N[(y / N[(z * z), $MachinePrecision]), $MachinePrecision] * N[(x / N[(z + 1.0), $MachinePrecision]), $MachinePrecision]), $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}
t_0 := \left(z + 1\right) \cdot \left(z \cdot z\right)\\
\mathbf{if}\;t_0 \leq -2 \cdot 10^{+42}:\\
\;\;\;\;\frac{\frac{x}{z}}{z \cdot \frac{z}{y}}\\
\mathbf{elif}\;t_0 \leq 10^{-291}:\\
\;\;\;\;\frac{1}{z \cdot \frac{\frac{z}{x}}{y}}\\
\mathbf{elif}\;t_0 \leq 5 \cdot 10^{+151}:\\
\;\;\;\;\frac{y}{z \cdot z} \cdot \frac{x}{z + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{y}{z}}{z \cdot \frac{z}{x}}\\
\end{array}
\end{array}
if (*.f64 (*.f64 z z) (+.f64 z 1)) < -2.00000000000000009e42Initial program 79.7%
*-commutative79.7%
associate-*r/85.5%
sqr-neg85.5%
associate-*l*85.5%
associate-*l*85.5%
sqr-neg85.5%
associate-*l*85.5%
distribute-lft-in85.5%
fma-def85.5%
*-rgt-identity85.5%
Simplified85.5%
associate-*r/79.7%
*-commutative79.7%
fma-udef79.7%
distribute-lft-in29.7%
*-un-lft-identity29.7%
distribute-rgt-in79.7%
associate-/r*83.1%
frac-times94.5%
associate-/l*92.8%
div-inv92.9%
clear-num92.9%
Applied egg-rr92.9%
Taylor expanded in z around inf 91.5%
unpow291.5%
associate-/l*92.8%
Simplified92.8%
associate-/r/92.9%
Applied egg-rr92.9%
if -2.00000000000000009e42 < (*.f64 (*.f64 z z) (+.f64 z 1)) < 9.99999999999999962e-292Initial program 79.8%
*-commutative79.8%
associate-*r/78.4%
sqr-neg78.4%
associate-*l*78.4%
associate-*l*78.4%
sqr-neg78.4%
associate-*l*78.4%
distribute-lft-in78.4%
fma-def78.4%
*-rgt-identity78.4%
Simplified78.4%
Taylor expanded in z around 0 79.8%
unpow279.8%
*-rgt-identity79.8%
times-frac78.4%
/-rgt-identity78.4%
Simplified78.4%
associate-*l/79.8%
associate-/r*93.3%
clear-num93.3%
add-sqr-sqrt42.5%
sqrt-prod42.5%
sqr-neg42.5%
sqrt-unprod1.8%
add-sqr-sqrt2.0%
associate-/l/2.0%
add-sqr-sqrt1.8%
sqrt-unprod42.5%
sqr-neg42.5%
sqrt-prod42.6%
add-sqr-sqrt93.3%
associate-/r*99.8%
Applied egg-rr99.8%
if 9.99999999999999962e-292 < (*.f64 (*.f64 z z) (+.f64 z 1)) < 5.0000000000000002e151Initial program 93.1%
*-commutative93.1%
sqr-neg93.1%
times-frac92.6%
sqr-neg92.6%
Simplified92.6%
if 5.0000000000000002e151 < (*.f64 (*.f64 z z) (+.f64 z 1)) Initial program 74.9%
*-commutative74.9%
associate-*r/75.6%
sqr-neg75.6%
associate-*l*75.6%
associate-*l*75.6%
sqr-neg75.6%
associate-*l*75.6%
distribute-lft-in75.6%
fma-def75.6%
*-rgt-identity75.6%
Simplified75.6%
associate-*r/74.9%
*-commutative74.9%
associate-/r*78.5%
associate-*r/82.6%
fma-udef82.6%
distribute-lft1-in82.6%
frac-times99.7%
clear-num99.7%
frac-times96.4%
*-un-lft-identity96.4%
Applied egg-rr96.4%
Taylor expanded in z around inf 84.4%
unpow284.4%
associate-*r/96.4%
Simplified96.4%
Final simplification95.1%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z) :precision binary64 (if (or (<= (* x y) -1e-65) (not (<= (* x y) 4e+19))) (* y (/ x (* z z))) (* (/ x z) (/ y z))))
assert(x < y);
double code(double x, double y, double z) {
double tmp;
if (((x * y) <= -1e-65) || !((x * y) <= 4e+19)) {
tmp = y * (x / (z * z));
} else {
tmp = (x / z) * (y / z);
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (((x * y) <= (-1d-65)) .or. (.not. ((x * y) <= 4d+19))) then
tmp = y * (x / (z * z))
else
tmp = (x / z) * (y / z)
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z) {
double tmp;
if (((x * y) <= -1e-65) || !((x * y) <= 4e+19)) {
tmp = y * (x / (z * z));
} else {
tmp = (x / z) * (y / z);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z): tmp = 0 if ((x * y) <= -1e-65) or not ((x * y) <= 4e+19): tmp = y * (x / (z * z)) else: tmp = (x / z) * (y / z) return tmp
x, y = sort([x, y]) function code(x, y, z) tmp = 0.0 if ((Float64(x * y) <= -1e-65) || !(Float64(x * y) <= 4e+19)) tmp = Float64(y * Float64(x / Float64(z * z))); else tmp = Float64(Float64(x / z) * Float64(y / z)); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z)
tmp = 0.0;
if (((x * y) <= -1e-65) || ~(((x * y) <= 4e+19)))
tmp = y * (x / (z * z));
else
tmp = (x / z) * (y / z);
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_] := If[Or[LessEqual[N[(x * y), $MachinePrecision], -1e-65], N[Not[LessEqual[N[(x * y), $MachinePrecision], 4e+19]], $MachinePrecision]], N[(y * N[(x / N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / z), $MachinePrecision] * N[(y / z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -1 \cdot 10^{-65} \lor \neg \left(x \cdot y \leq 4 \cdot 10^{+19}\right):\\
\;\;\;\;y \cdot \frac{x}{z \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{z} \cdot \frac{y}{z}\\
\end{array}
\end{array}
if (*.f64 x y) < -9.99999999999999923e-66 or 4e19 < (*.f64 x y) Initial program 82.5%
*-commutative82.5%
associate-*r/84.9%
sqr-neg84.9%
associate-*l*84.9%
associate-*l*84.9%
sqr-neg84.9%
associate-*l*84.9%
distribute-lft-in84.9%
fma-def84.9%
*-rgt-identity84.9%
Simplified84.9%
Taylor expanded in z around 0 71.8%
unpow271.8%
*-rgt-identity71.8%
times-frac72.9%
/-rgt-identity72.9%
Simplified72.9%
if -9.99999999999999923e-66 < (*.f64 x y) < 4e19Initial program 84.0%
*-commutative84.0%
associate-*r/87.6%
sqr-neg87.6%
associate-*l*87.6%
associate-*l*87.6%
sqr-neg87.6%
associate-*l*87.6%
distribute-lft-in87.6%
fma-def87.6%
*-rgt-identity87.6%
Simplified87.6%
Taylor expanded in z around 0 78.8%
unpow278.8%
times-frac94.6%
Simplified94.6%
Final simplification82.3%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z) :precision binary64 (if (or (<= z -44000000000.0) (not (<= z 0.75))) (* (/ x z) (/ y (* z z))) (* (/ y z) (- (/ x z) x))))
assert(x < y);
double code(double x, double y, double z) {
double tmp;
if ((z <= -44000000000.0) || !(z <= 0.75)) {
tmp = (x / z) * (y / (z * z));
} else {
tmp = (y / z) * ((x / 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 <= (-44000000000.0d0)) .or. (.not. (z <= 0.75d0))) then
tmp = (x / z) * (y / (z * z))
else
tmp = (y / z) * ((x / 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 <= -44000000000.0) || !(z <= 0.75)) {
tmp = (x / z) * (y / (z * z));
} else {
tmp = (y / z) * ((x / z) - x);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z): tmp = 0 if (z <= -44000000000.0) or not (z <= 0.75): tmp = (x / z) * (y / (z * z)) else: tmp = (y / z) * ((x / z) - x) return tmp
x, y = sort([x, y]) function code(x, y, z) tmp = 0.0 if ((z <= -44000000000.0) || !(z <= 0.75)) tmp = Float64(Float64(x / z) * Float64(y / Float64(z * z))); else tmp = Float64(Float64(y / z) * Float64(Float64(x / z) - x)); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z)
tmp = 0.0;
if ((z <= -44000000000.0) || ~((z <= 0.75)))
tmp = (x / z) * (y / (z * z));
else
tmp = (y / z) * ((x / 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, -44000000000.0], N[Not[LessEqual[z, 0.75]], $MachinePrecision]], N[(N[(x / z), $MachinePrecision] * N[(y / N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y / z), $MachinePrecision] * N[(N[(x / z), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -44000000000 \lor \neg \left(z \leq 0.75\right):\\
\;\;\;\;\frac{x}{z} \cdot \frac{y}{z \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{z} \cdot \left(\frac{x}{z} - x\right)\\
\end{array}
\end{array}
if z < -4.4e10 or 0.75 < z Initial program 79.4%
*-commutative79.4%
sqr-neg79.4%
times-frac90.0%
sqr-neg90.0%
Simplified90.0%
Taylor expanded in z around inf 89.4%
if -4.4e10 < z < 0.75Initial program 86.6%
*-commutative86.6%
associate-*r/89.5%
sqr-neg89.5%
associate-*l*89.5%
associate-*l*89.5%
sqr-neg89.5%
associate-*l*89.5%
distribute-lft-in89.5%
fma-def89.5%
*-rgt-identity89.5%
Simplified89.5%
associate-*r/86.6%
*-commutative86.6%
fma-udef86.6%
distribute-lft-in86.6%
*-un-lft-identity86.6%
distribute-rgt-in86.6%
associate-/r*86.6%
frac-times96.3%
associate-/l*96.2%
div-inv96.2%
clear-num97.2%
Applied egg-rr97.2%
Taylor expanded in z around 0 63.3%
+-commutative63.3%
unpow263.3%
times-frac72.9%
mul-1-neg72.9%
associate-*r/72.0%
distribute-lft-neg-out72.0%
fma-def72.0%
distribute-lft-neg-out72.0%
*-commutative72.0%
associate-*l/72.9%
fma-neg72.9%
associate-*l/72.0%
*-commutative72.0%
distribute-rgt-out--94.7%
Simplified94.7%
Final simplification92.2%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z) :precision binary64 (if (or (<= z -44000000000.0) (not (<= z 0.75))) (/ (/ x z) (* z (/ z y))) (* (/ y z) (- (/ x z) x))))
assert(x < y);
double code(double x, double y, double z) {
double tmp;
if ((z <= -44000000000.0) || !(z <= 0.75)) {
tmp = (x / z) / (z * (z / y));
} else {
tmp = (y / z) * ((x / 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 <= (-44000000000.0d0)) .or. (.not. (z <= 0.75d0))) then
tmp = (x / z) / (z * (z / y))
else
tmp = (y / z) * ((x / 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 <= -44000000000.0) || !(z <= 0.75)) {
tmp = (x / z) / (z * (z / y));
} else {
tmp = (y / z) * ((x / z) - x);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z): tmp = 0 if (z <= -44000000000.0) or not (z <= 0.75): tmp = (x / z) / (z * (z / y)) else: tmp = (y / z) * ((x / z) - x) return tmp
x, y = sort([x, y]) function code(x, y, z) tmp = 0.0 if ((z <= -44000000000.0) || !(z <= 0.75)) tmp = Float64(Float64(x / z) / Float64(z * Float64(z / y))); else tmp = Float64(Float64(y / z) * Float64(Float64(x / z) - x)); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z)
tmp = 0.0;
if ((z <= -44000000000.0) || ~((z <= 0.75)))
tmp = (x / z) / (z * (z / y));
else
tmp = (y / z) * ((x / 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, -44000000000.0], N[Not[LessEqual[z, 0.75]], $MachinePrecision]], N[(N[(x / z), $MachinePrecision] / N[(z * N[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y / z), $MachinePrecision] * N[(N[(x / z), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -44000000000 \lor \neg \left(z \leq 0.75\right):\\
\;\;\;\;\frac{\frac{x}{z}}{z \cdot \frac{z}{y}}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{z} \cdot \left(\frac{x}{z} - x\right)\\
\end{array}
\end{array}
if z < -4.4e10 or 0.75 < z Initial program 79.4%
*-commutative79.4%
associate-*r/82.4%
sqr-neg82.4%
associate-*l*82.4%
associate-*l*82.4%
sqr-neg82.4%
associate-*l*82.4%
distribute-lft-in82.4%
fma-def82.4%
*-rgt-identity82.4%
Simplified82.4%
associate-*r/79.4%
*-commutative79.4%
fma-udef79.4%
distribute-lft-in55.8%
*-un-lft-identity55.8%
distribute-rgt-in79.4%
associate-/r*82.6%
frac-times97.2%
associate-/l*95.8%
div-inv95.8%
clear-num95.8%
Applied egg-rr95.8%
Taylor expanded in z around inf 88.5%
unpow288.5%
associate-/l*95.1%
Simplified95.1%
associate-/r/95.2%
Applied egg-rr95.2%
if -4.4e10 < z < 0.75Initial program 86.6%
*-commutative86.6%
associate-*r/89.5%
sqr-neg89.5%
associate-*l*89.5%
associate-*l*89.5%
sqr-neg89.5%
associate-*l*89.5%
distribute-lft-in89.5%
fma-def89.5%
*-rgt-identity89.5%
Simplified89.5%
associate-*r/86.6%
*-commutative86.6%
fma-udef86.6%
distribute-lft-in86.6%
*-un-lft-identity86.6%
distribute-rgt-in86.6%
associate-/r*86.6%
frac-times96.3%
associate-/l*96.2%
div-inv96.2%
clear-num97.2%
Applied egg-rr97.2%
Taylor expanded in z around 0 63.3%
+-commutative63.3%
unpow263.3%
times-frac72.9%
mul-1-neg72.9%
associate-*r/72.0%
distribute-lft-neg-out72.0%
fma-def72.0%
distribute-lft-neg-out72.0%
*-commutative72.0%
associate-*l/72.9%
fma-neg72.9%
associate-*l/72.0%
*-commutative72.0%
distribute-rgt-out--94.7%
Simplified94.7%
Final simplification94.9%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z) :precision binary64 (if (<= z -1.8e-144) (* x (/ y (* z z))) (if (<= z 2.2e-78) (/ (* x (/ y z)) z) (* y (/ x (* z z))))))
assert(x < y);
double code(double x, double y, double z) {
double tmp;
if (z <= -1.8e-144) {
tmp = x * (y / (z * z));
} else if (z <= 2.2e-78) {
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 (z <= (-1.8d-144)) then
tmp = x * (y / (z * z))
else if (z <= 2.2d-78) 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 (z <= -1.8e-144) {
tmp = x * (y / (z * z));
} else if (z <= 2.2e-78) {
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 z <= -1.8e-144: tmp = x * (y / (z * z)) elif z <= 2.2e-78: 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 (z <= -1.8e-144) tmp = Float64(x * Float64(y / Float64(z * z))); elseif (z <= 2.2e-78) tmp = Float64(Float64(x * 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 (z <= -1.8e-144)
tmp = x * (y / (z * z));
elseif (z <= 2.2e-78)
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[z, -1.8e-144], N[(x * N[(y / N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.2e-78], N[(N[(x * N[(y / z), $MachinePrecision]), $MachinePrecision] / z), $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}\;z \leq -1.8 \cdot 10^{-144}:\\
\;\;\;\;x \cdot \frac{y}{z \cdot z}\\
\mathbf{elif}\;z \leq 2.2 \cdot 10^{-78}:\\
\;\;\;\;\frac{x \cdot \frac{y}{z}}{z}\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{x}{z \cdot z}\\
\end{array}
\end{array}
if z < -1.8e-144Initial program 84.3%
*-commutative84.3%
sqr-neg84.3%
times-frac90.8%
sqr-neg90.8%
Simplified90.8%
Taylor expanded in z around 0 74.0%
if -1.8e-144 < z < 2.1999999999999999e-78Initial program 82.9%
*-commutative82.9%
sqr-neg82.9%
times-frac78.4%
sqr-neg78.4%
Simplified78.4%
Taylor expanded in z around 0 78.4%
associate-/r*85.2%
associate-*l/97.2%
Applied egg-rr97.2%
if 2.1999999999999999e-78 < z Initial program 82.2%
*-commutative82.2%
associate-*r/85.1%
sqr-neg85.1%
associate-*l*85.1%
associate-*l*85.1%
sqr-neg85.1%
associate-*l*85.1%
distribute-lft-in85.1%
fma-def85.1%
*-rgt-identity85.1%
Simplified85.1%
Taylor expanded in z around 0 70.5%
unpow270.5%
*-rgt-identity70.5%
times-frac73.4%
/-rgt-identity73.4%
Simplified73.4%
Final simplification80.1%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z) :precision binary64 (if (<= z -44000000000.0) (/ x (/ (* z (- z)) y)) (if (<= z 4.3e-79) (/ (* x (/ y z)) z) (* y (/ x (* z z))))))
assert(x < y);
double code(double x, double y, double z) {
double tmp;
if (z <= -44000000000.0) {
tmp = x / ((z * -z) / y);
} else if (z <= 4.3e-79) {
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 (z <= (-44000000000.0d0)) then
tmp = x / ((z * -z) / y)
else if (z <= 4.3d-79) 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 (z <= -44000000000.0) {
tmp = x / ((z * -z) / y);
} else if (z <= 4.3e-79) {
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 z <= -44000000000.0: tmp = x / ((z * -z) / y) elif z <= 4.3e-79: 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 (z <= -44000000000.0) tmp = Float64(x / Float64(Float64(z * Float64(-z)) / y)); elseif (z <= 4.3e-79) tmp = Float64(Float64(x * 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 (z <= -44000000000.0)
tmp = x / ((z * -z) / y);
elseif (z <= 4.3e-79)
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[z, -44000000000.0], N[(x / N[(N[(z * (-z)), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 4.3e-79], N[(N[(x * N[(y / z), $MachinePrecision]), $MachinePrecision] / z), $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}\;z \leq -44000000000:\\
\;\;\;\;\frac{x}{\frac{z \cdot \left(-z\right)}{y}}\\
\mathbf{elif}\;z \leq 4.3 \cdot 10^{-79}:\\
\;\;\;\;\frac{x \cdot \frac{y}{z}}{z}\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{x}{z \cdot z}\\
\end{array}
\end{array}
if z < -4.4e10Initial program 79.7%
*-commutative79.7%
sqr-neg79.7%
times-frac92.4%
sqr-neg92.4%
Simplified92.4%
Taylor expanded in z around 0 68.4%
*-commutative68.4%
associate-*r/64.4%
frac-times53.5%
clear-num53.6%
frac-2neg53.6%
frac-times66.7%
*-un-lft-identity66.7%
add-sqr-sqrt31.7%
sqrt-unprod51.3%
sqr-neg51.3%
sqrt-unprod35.6%
add-sqr-sqrt69.6%
Applied egg-rr69.6%
associate-/r*56.4%
associate-/l*54.7%
associate-/r*67.1%
*-commutative67.1%
distribute-rgt-neg-in67.1%
associate-/l*71.2%
Simplified71.2%
if -4.4e10 < z < 4.29999999999999982e-79Initial program 85.9%
*-commutative85.9%
sqr-neg85.9%
times-frac81.3%
sqr-neg81.3%
Simplified81.3%
Taylor expanded in z around 0 80.2%
associate-/r*84.9%
associate-*l/93.5%
Applied egg-rr93.5%
if 4.29999999999999982e-79 < z Initial program 82.2%
*-commutative82.2%
associate-*r/85.1%
sqr-neg85.1%
associate-*l*85.1%
associate-*l*85.1%
sqr-neg85.1%
associate-*l*85.1%
distribute-lft-in85.1%
fma-def85.1%
*-rgt-identity85.1%
Simplified85.1%
Taylor expanded in z around 0 70.5%
unpow270.5%
*-rgt-identity70.5%
times-frac73.4%
/-rgt-identity73.4%
Simplified73.4%
Final simplification80.9%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z) :precision binary64 (/ (/ x z) (* (+ z 1.0) (/ z y))))
assert(x < y);
double code(double x, double y, double z) {
return (x / z) / ((z + 1.0) * (z / y));
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = (x / z) / ((z + 1.0d0) * (z / y))
end function
assert x < y;
public static double code(double x, double y, double z) {
return (x / z) / ((z + 1.0) * (z / y));
}
[x, y] = sort([x, y]) def code(x, y, z): return (x / z) / ((z + 1.0) * (z / y))
x, y = sort([x, y]) function code(x, y, z) return Float64(Float64(x / z) / Float64(Float64(z + 1.0) * Float64(z / y))) end
x, y = num2cell(sort([x, y])){:}
function tmp = code(x, y, z)
tmp = (x / z) / ((z + 1.0) * (z / y));
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_] := N[(N[(x / z), $MachinePrecision] / N[(N[(z + 1.0), $MachinePrecision] * N[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\frac{\frac{x}{z}}{\left(z + 1\right) \cdot \frac{z}{y}}
\end{array}
Initial program 83.1%
*-commutative83.1%
associate-*r/86.1%
sqr-neg86.1%
associate-*l*86.1%
associate-*l*86.1%
sqr-neg86.1%
associate-*l*86.1%
distribute-lft-in86.1%
fma-def86.1%
*-rgt-identity86.1%
Simplified86.1%
associate-*r/83.1%
*-commutative83.1%
fma-udef83.1%
distribute-lft-in71.8%
*-un-lft-identity71.8%
distribute-rgt-in83.1%
associate-/r*84.7%
frac-times96.7%
associate-/l*96.0%
div-inv96.0%
clear-num96.5%
Applied egg-rr96.5%
Final simplification96.5%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z) :precision binary64 (/ (* (/ x z) (/ y z)) (+ z 1.0)))
assert(x < y);
double code(double x, double y, double z) {
return ((x / z) * (y / z)) / (z + 1.0);
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = ((x / z) * (y / z)) / (z + 1.0d0)
end function
assert x < y;
public static double code(double x, double y, double z) {
return ((x / z) * (y / z)) / (z + 1.0);
}
[x, y] = sort([x, y]) def code(x, y, z): return ((x / z) * (y / z)) / (z + 1.0)
x, y = sort([x, y]) function code(x, y, z) return Float64(Float64(Float64(x / z) * Float64(y / z)) / Float64(z + 1.0)) end
x, y = num2cell(sort([x, y])){:}
function tmp = code(x, y, z)
tmp = ((x / z) * (y / z)) / (z + 1.0);
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_] := N[(N[(N[(x / z), $MachinePrecision] * N[(y / z), $MachinePrecision]), $MachinePrecision] / N[(z + 1.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\frac{\frac{x}{z} \cdot \frac{y}{z}}{z + 1}
\end{array}
Initial program 83.1%
associate-*l*83.1%
times-frac93.3%
associate-/r*96.4%
associate-*r/96.7%
Simplified96.7%
Final simplification96.7%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z) :precision binary64 (if (<= x -2.1e-81) (* x (/ y (* z z))) (* (/ x z) (/ y z))))
assert(x < y);
double code(double x, double y, double z) {
double tmp;
if (x <= -2.1e-81) {
tmp = x * (y / (z * z));
} else {
tmp = (x / z) * (y / z);
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (x <= (-2.1d-81)) then
tmp = x * (y / (z * z))
else
tmp = (x / z) * (y / z)
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z) {
double tmp;
if (x <= -2.1e-81) {
tmp = x * (y / (z * z));
} else {
tmp = (x / z) * (y / z);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z): tmp = 0 if x <= -2.1e-81: tmp = x * (y / (z * z)) else: tmp = (x / z) * (y / z) return tmp
x, y = sort([x, y]) function code(x, y, z) tmp = 0.0 if (x <= -2.1e-81) tmp = Float64(x * Float64(y / Float64(z * z))); else tmp = Float64(Float64(x / z) * Float64(y / z)); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z)
tmp = 0.0;
if (x <= -2.1e-81)
tmp = x * (y / (z * z));
else
tmp = (x / z) * (y / z);
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_] := If[LessEqual[x, -2.1e-81], N[(x * N[(y / N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / z), $MachinePrecision] * N[(y / z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.1 \cdot 10^{-81}:\\
\;\;\;\;x \cdot \frac{y}{z \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{z} \cdot \frac{y}{z}\\
\end{array}
\end{array}
if x < -2.0999999999999999e-81Initial program 84.5%
*-commutative84.5%
sqr-neg84.5%
times-frac95.0%
sqr-neg95.0%
Simplified95.0%
Taylor expanded in z around 0 80.1%
if -2.0999999999999999e-81 < x Initial program 82.6%
*-commutative82.6%
associate-*r/83.9%
sqr-neg83.9%
associate-*l*83.9%
associate-*l*83.9%
sqr-neg83.9%
associate-*l*83.9%
distribute-lft-in83.9%
fma-def83.9%
*-rgt-identity83.9%
Simplified83.9%
Taylor expanded in z around 0 73.8%
unpow273.8%
times-frac78.4%
Simplified78.4%
Final simplification78.9%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z) :precision binary64 (if (<= z -5e-310) (* (/ x z) (- y)) (* (/ x z) y)))
assert(x < y);
double code(double x, double y, double z) {
double tmp;
if (z <= -5e-310) {
tmp = (x / z) * -y;
} 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 <= (-5d-310)) then
tmp = (x / z) * -y
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 <= -5e-310) {
tmp = (x / z) * -y;
} else {
tmp = (x / z) * y;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z): tmp = 0 if z <= -5e-310: tmp = (x / z) * -y else: tmp = (x / z) * y return tmp
x, y = sort([x, y]) function code(x, y, z) tmp = 0.0 if (z <= -5e-310) tmp = Float64(Float64(x / z) * Float64(-y)); else tmp = Float64(Float64(x / z) * y); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z)
tmp = 0.0;
if (z <= -5e-310)
tmp = (x / z) * -y;
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, -5e-310], N[(N[(x / z), $MachinePrecision] * (-y)), $MachinePrecision], N[(N[(x / z), $MachinePrecision] * y), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5 \cdot 10^{-310}:\\
\;\;\;\;\frac{x}{z} \cdot \left(-y\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{z} \cdot y\\
\end{array}
\end{array}
if z < -4.999999999999985e-310Initial program 82.2%
*-commutative82.2%
associate-*r/86.9%
sqr-neg86.9%
associate-*l*86.9%
associate-*l*86.9%
sqr-neg86.9%
associate-*l*86.9%
distribute-lft-in86.9%
fma-def86.9%
*-rgt-identity86.9%
Simplified86.9%
Taylor expanded in z around 0 61.0%
+-commutative61.0%
unpow261.0%
*-commutative61.0%
times-frac67.2%
*-commutative67.2%
associate-*r/69.6%
associate-*r*69.6%
neg-mul-169.6%
distribute-rgt-out69.6%
Simplified69.6%
Taylor expanded in z around inf 38.9%
mul-1-neg38.9%
Simplified38.9%
if -4.999999999999985e-310 < z Initial program 83.9%
*-commutative83.9%
associate-*r/85.4%
sqr-neg85.4%
associate-*l*85.4%
associate-*l*85.4%
sqr-neg85.4%
associate-*l*85.4%
distribute-lft-in85.4%
fma-def85.4%
*-rgt-identity85.4%
Simplified85.4%
Taylor expanded in z around 0 40.7%
+-commutative40.7%
unpow240.7%
*-commutative40.7%
times-frac44.8%
*-commutative44.8%
associate-*r/46.5%
associate-*r*46.5%
neg-mul-146.5%
distribute-rgt-out68.4%
Simplified68.4%
Taylor expanded in z around inf 20.6%
mul-1-neg20.6%
Simplified20.6%
expm1-log1p-u20.3%
expm1-udef27.5%
add-sqr-sqrt14.6%
sqrt-unprod33.6%
sqr-neg33.6%
sqrt-unprod21.3%
add-sqr-sqrt44.3%
associate-*l/44.3%
Applied egg-rr44.3%
expm1-def35.2%
expm1-log1p42.8%
associate-*l/46.0%
Simplified46.0%
Final simplification42.7%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z) :precision binary64 (if (<= z -5e-310) (* x (/ (- y) z)) (* (/ x z) y)))
assert(x < y);
double code(double x, double y, double z) {
double tmp;
if (z <= -5e-310) {
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 <= (-5d-310)) 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 <= -5e-310) {
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 <= -5e-310: 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 <= -5e-310) tmp = Float64(x * Float64(Float64(-y) / z)); else tmp = Float64(Float64(x / z) * y); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z)
tmp = 0.0;
if (z <= -5e-310)
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, -5e-310], N[(x * N[((-y) / z), $MachinePrecision]), $MachinePrecision], N[(N[(x / z), $MachinePrecision] * y), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5 \cdot 10^{-310}:\\
\;\;\;\;x \cdot \frac{-y}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{z} \cdot y\\
\end{array}
\end{array}
if z < -4.999999999999985e-310Initial program 82.2%
*-commutative82.2%
associate-*r/86.9%
sqr-neg86.9%
associate-*l*86.9%
associate-*l*86.9%
sqr-neg86.9%
associate-*l*86.9%
distribute-lft-in86.9%
fma-def86.9%
*-rgt-identity86.9%
Simplified86.9%
Taylor expanded in z around 0 61.0%
+-commutative61.0%
unpow261.0%
*-commutative61.0%
times-frac67.2%
*-commutative67.2%
associate-*r/69.6%
associate-*r*69.6%
neg-mul-169.6%
distribute-rgt-out69.6%
Simplified69.6%
Taylor expanded in z around inf 35.0%
mul-1-neg35.0%
associate-*r/40.5%
distribute-lft-neg-out40.5%
*-commutative40.5%
Simplified40.5%
if -4.999999999999985e-310 < z Initial program 83.9%
*-commutative83.9%
associate-*r/85.4%
sqr-neg85.4%
associate-*l*85.4%
associate-*l*85.4%
sqr-neg85.4%
associate-*l*85.4%
distribute-lft-in85.4%
fma-def85.4%
*-rgt-identity85.4%
Simplified85.4%
Taylor expanded in z around 0 40.7%
+-commutative40.7%
unpow240.7%
*-commutative40.7%
times-frac44.8%
*-commutative44.8%
associate-*r/46.5%
associate-*r*46.5%
neg-mul-146.5%
distribute-rgt-out68.4%
Simplified68.4%
Taylor expanded in z around inf 20.6%
mul-1-neg20.6%
Simplified20.6%
expm1-log1p-u20.3%
expm1-udef27.5%
add-sqr-sqrt14.6%
sqrt-unprod33.6%
sqr-neg33.6%
sqrt-unprod21.3%
add-sqr-sqrt44.3%
associate-*l/44.3%
Applied egg-rr44.3%
expm1-def35.2%
expm1-log1p42.8%
associate-*l/46.0%
Simplified46.0%
Final simplification43.4%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z) :precision binary64 (if (<= x -5e+89) (* x (/ y z)) (* (/ x z) y)))
assert(x < y);
double code(double x, double y, double z) {
double tmp;
if (x <= -5e+89) {
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 (x <= (-5d+89)) 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 (x <= -5e+89) {
tmp = x * (y / z);
} else {
tmp = (x / z) * y;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z): tmp = 0 if x <= -5e+89: 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 (x <= -5e+89) tmp = Float64(x * Float64(y / z)); else tmp = Float64(Float64(x / z) * y); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z)
tmp = 0.0;
if (x <= -5e+89)
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[x, -5e+89], N[(x * N[(y / z), $MachinePrecision]), $MachinePrecision], N[(N[(x / z), $MachinePrecision] * y), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -5 \cdot 10^{+89}:\\
\;\;\;\;x \cdot \frac{y}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{z} \cdot y\\
\end{array}
\end{array}
if x < -4.99999999999999983e89Initial program 74.6%
*-commutative74.6%
associate-*r/85.6%
sqr-neg85.6%
associate-*l*85.7%
associate-*l*85.6%
sqr-neg85.6%
associate-*l*85.7%
distribute-lft-in85.7%
fma-def85.7%
*-rgt-identity85.7%
Simplified85.7%
Taylor expanded in z around 0 30.8%
+-commutative30.8%
unpow230.8%
*-commutative30.8%
times-frac31.0%
*-commutative31.0%
associate-*r/31.1%
associate-*r*31.1%
neg-mul-131.1%
distribute-rgt-out54.5%
Simplified54.5%
Taylor expanded in z around inf 12.1%
mul-1-neg12.1%
Simplified12.1%
expm1-log1p-u5.5%
expm1-udef15.7%
add-sqr-sqrt7.0%
sqrt-unprod13.9%
sqr-neg13.9%
sqrt-unprod9.0%
add-sqr-sqrt33.6%
associate-*l/33.5%
Applied egg-rr33.5%
expm1-def23.3%
expm1-log1p30.6%
associate-*r/38.8%
Simplified38.8%
if -4.99999999999999983e89 < x Initial program 85.1%
*-commutative85.1%
associate-*r/86.2%
sqr-neg86.2%
associate-*l*86.2%
associate-*l*86.2%
sqr-neg86.2%
associate-*l*86.2%
distribute-lft-in86.2%
fma-def86.2%
*-rgt-identity86.2%
Simplified86.2%
Taylor expanded in z around 0 54.5%
+-commutative54.5%
unpow254.5%
*-commutative54.5%
times-frac60.6%
*-commutative60.6%
associate-*r/63.1%
associate-*r*63.1%
neg-mul-163.1%
distribute-rgt-out72.2%
Simplified72.2%
Taylor expanded in z around inf 33.0%
mul-1-neg33.0%
Simplified33.0%
expm1-log1p-u29.0%
expm1-udef36.5%
add-sqr-sqrt17.0%
sqrt-unprod35.4%
sqr-neg35.4%
sqrt-unprod22.3%
add-sqr-sqrt40.2%
associate-*l/40.2%
Applied egg-rr40.2%
expm1-def29.9%
expm1-log1p34.0%
associate-*l/37.4%
Simplified37.4%
Final simplification37.7%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z) :precision binary64 (if (<= x -4e+90) (* x (/ y z)) (/ y (/ z x))))
assert(x < y);
double code(double x, double y, double z) {
double tmp;
if (x <= -4e+90) {
tmp = x * (y / z);
} 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 (x <= (-4d+90)) then
tmp = x * (y / z)
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 (x <= -4e+90) {
tmp = x * (y / z);
} else {
tmp = y / (z / x);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z): tmp = 0 if x <= -4e+90: tmp = x * (y / z) else: tmp = y / (z / x) return tmp
x, y = sort([x, y]) function code(x, y, z) tmp = 0.0 if (x <= -4e+90) tmp = Float64(x * Float64(y / z)); else tmp = Float64(y / 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 <= -4e+90)
tmp = x * (y / z);
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[LessEqual[x, -4e+90], N[(x * N[(y / z), $MachinePrecision]), $MachinePrecision], N[(y / N[(z / x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -4 \cdot 10^{+90}:\\
\;\;\;\;x \cdot \frac{y}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{\frac{z}{x}}\\
\end{array}
\end{array}
if x < -3.99999999999999987e90Initial program 74.6%
*-commutative74.6%
associate-*r/85.6%
sqr-neg85.6%
associate-*l*85.7%
associate-*l*85.6%
sqr-neg85.6%
associate-*l*85.7%
distribute-lft-in85.7%
fma-def85.7%
*-rgt-identity85.7%
Simplified85.7%
Taylor expanded in z around 0 30.8%
+-commutative30.8%
unpow230.8%
*-commutative30.8%
times-frac31.0%
*-commutative31.0%
associate-*r/31.1%
associate-*r*31.1%
neg-mul-131.1%
distribute-rgt-out54.5%
Simplified54.5%
Taylor expanded in z around inf 12.1%
mul-1-neg12.1%
Simplified12.1%
expm1-log1p-u5.5%
expm1-udef15.7%
add-sqr-sqrt7.0%
sqrt-unprod13.9%
sqr-neg13.9%
sqrt-unprod9.0%
add-sqr-sqrt33.6%
associate-*l/33.5%
Applied egg-rr33.5%
expm1-def23.3%
expm1-log1p30.6%
associate-*r/38.8%
Simplified38.8%
if -3.99999999999999987e90 < x Initial program 85.1%
*-commutative85.1%
associate-*r/86.2%
sqr-neg86.2%
associate-*l*86.2%
associate-*l*86.2%
sqr-neg86.2%
associate-*l*86.2%
distribute-lft-in86.2%
fma-def86.2%
*-rgt-identity86.2%
Simplified86.2%
Taylor expanded in z around 0 54.5%
+-commutative54.5%
unpow254.5%
*-commutative54.5%
times-frac60.6%
*-commutative60.6%
associate-*r/63.1%
associate-*r*63.1%
neg-mul-163.1%
distribute-rgt-out72.2%
Simplified72.2%
Taylor expanded in z around inf 33.0%
mul-1-neg33.0%
Simplified33.0%
*-commutative33.0%
clear-num33.0%
un-div-inv33.0%
add-sqr-sqrt16.4%
sqrt-unprod35.1%
sqr-neg35.1%
sqrt-unprod20.0%
add-sqr-sqrt37.4%
Applied egg-rr37.4%
Final simplification37.7%
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 83.1%
*-commutative83.1%
associate-*r/86.1%
sqr-neg86.1%
associate-*l*86.1%
associate-*l*86.1%
sqr-neg86.1%
associate-*l*86.1%
distribute-lft-in86.1%
fma-def86.1%
*-rgt-identity86.1%
Simplified86.1%
Taylor expanded in z around 0 74.8%
unpow274.8%
times-frac74.5%
Simplified74.5%
Final simplification74.5%
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 83.1%
*-commutative83.1%
associate-*r/86.1%
sqr-neg86.1%
associate-*l*86.1%
associate-*l*86.1%
sqr-neg86.1%
associate-*l*86.1%
distribute-lft-in86.1%
fma-def86.1%
*-rgt-identity86.1%
Simplified86.1%
Taylor expanded in z around 0 50.1%
+-commutative50.1%
unpow250.1%
*-commutative50.1%
times-frac55.2%
*-commutative55.2%
associate-*r/57.2%
associate-*r*57.2%
neg-mul-157.2%
distribute-rgt-out69.0%
Simplified69.0%
Taylor expanded in z around inf 29.1%
mul-1-neg29.1%
Simplified29.1%
expm1-log1p-u24.6%
expm1-udef32.6%
add-sqr-sqrt15.2%
sqrt-unprod31.4%
sqr-neg31.4%
sqrt-unprod19.8%
add-sqr-sqrt39.0%
associate-*l/39.0%
Applied egg-rr39.0%
expm1-def28.7%
expm1-log1p33.3%
associate-*r/36.3%
Simplified36.3%
Final simplification36.3%
(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 2023275
(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))))