
(FPCore (x y z t) :precision binary64 (- 1.0 (/ x (* (- y z) (- y t)))))
double code(double x, double y, double z, double t) {
return 1.0 - (x / ((y - z) * (y - t)));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = 1.0d0 - (x / ((y - z) * (y - t)))
end function
public static double code(double x, double y, double z, double t) {
return 1.0 - (x / ((y - z) * (y - t)));
}
def code(x, y, z, t): return 1.0 - (x / ((y - z) * (y - t)))
function code(x, y, z, t) return Float64(1.0 - Float64(x / Float64(Float64(y - z) * Float64(y - t)))) end
function tmp = code(x, y, z, t) tmp = 1.0 - (x / ((y - z) * (y - t))); end
code[x_, y_, z_, t_] := N[(1.0 - N[(x / N[(N[(y - z), $MachinePrecision] * N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
1 - \frac{x}{\left(y - z\right) \cdot \left(y - t\right)}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 12 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (- 1.0 (/ x (* (- y z) (- y t)))))
double code(double x, double y, double z, double t) {
return 1.0 - (x / ((y - z) * (y - t)));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = 1.0d0 - (x / ((y - z) * (y - t)))
end function
public static double code(double x, double y, double z, double t) {
return 1.0 - (x / ((y - z) * (y - t)));
}
def code(x, y, z, t): return 1.0 - (x / ((y - z) * (y - t)))
function code(x, y, z, t) return Float64(1.0 - Float64(x / Float64(Float64(y - z) * Float64(y - t)))) end
function tmp = code(x, y, z, t) tmp = 1.0 - (x / ((y - z) * (y - t))); end
code[x_, y_, z_, t_] := N[(1.0 - N[(x / N[(N[(y - z), $MachinePrecision] * N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
1 - \frac{x}{\left(y - z\right) \cdot \left(y - t\right)}
\end{array}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (+ 1.0 (/ (/ x (- z y)) (- y t))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
return 1.0 + ((x / (z - y)) / (y - t));
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = 1.0d0 + ((x / (z - y)) / (y - t))
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
return 1.0 + ((x / (z - y)) / (y - t));
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): return 1.0 + ((x / (z - y)) / (y - t))
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) return Float64(1.0 + Float64(Float64(x / Float64(z - y)) / Float64(y - t))) end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
tmp = 1.0 + ((x / (z - y)) / (y - t));
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := N[(1.0 + N[(N[(x / N[(z - y), $MachinePrecision]), $MachinePrecision] / N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
1 + \frac{\frac{x}{z - y}}{y - t}
\end{array}
Initial program 98.5%
sub-neg98.5%
neg-mul-198.5%
*-commutative98.5%
*-commutative98.5%
associate-/r*98.4%
associate-*r/98.4%
metadata-eval98.4%
times-frac98.4%
*-lft-identity98.4%
neg-mul-198.4%
sub-neg98.4%
+-commutative98.4%
distribute-neg-out98.4%
remove-double-neg98.4%
sub-neg98.4%
Simplified98.4%
Final simplification98.4%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= y -1400.0) 1.0 (if (<= y 3.8e-90) (+ 1.0 (/ x (* z (- y t)))) 1.0)))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1400.0) {
tmp = 1.0;
} else if (y <= 3.8e-90) {
tmp = 1.0 + (x / (z * (y - t)));
} else {
tmp = 1.0;
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= (-1400.0d0)) then
tmp = 1.0d0
else if (y <= 3.8d-90) then
tmp = 1.0d0 + (x / (z * (y - t)))
else
tmp = 1.0d0
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1400.0) {
tmp = 1.0;
} else if (y <= 3.8e-90) {
tmp = 1.0 + (x / (z * (y - t)));
} else {
tmp = 1.0;
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if y <= -1400.0: tmp = 1.0 elif y <= 3.8e-90: tmp = 1.0 + (x / (z * (y - t))) else: tmp = 1.0 return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (y <= -1400.0) tmp = 1.0; elseif (y <= 3.8e-90) tmp = Float64(1.0 + Float64(x / Float64(z * Float64(y - t)))); else tmp = 1.0; end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (y <= -1400.0)
tmp = 1.0;
elseif (y <= 3.8e-90)
tmp = 1.0 + (x / (z * (y - t)));
else
tmp = 1.0;
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[y, -1400.0], 1.0, If[LessEqual[y, 3.8e-90], N[(1.0 + N[(x / N[(z * N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1.0]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1400:\\
\;\;\;\;1\\
\mathbf{elif}\;y \leq 3.8 \cdot 10^{-90}:\\
\;\;\;\;1 + \frac{x}{z \cdot \left(y - t\right)}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if y < -1400 or 3.8e-90 < y Initial program 100.0%
Taylor expanded in t around 0 93.3%
Taylor expanded in x around 0 91.5%
if -1400 < y < 3.8e-90Initial program 96.6%
sub-neg96.6%
neg-mul-196.6%
*-commutative96.6%
*-commutative96.6%
associate-/r*96.3%
associate-*r/96.3%
metadata-eval96.3%
times-frac96.3%
*-lft-identity96.3%
neg-mul-196.3%
sub-neg96.3%
+-commutative96.3%
distribute-neg-out96.3%
remove-double-neg96.3%
sub-neg96.3%
Simplified96.3%
Taylor expanded in z around inf 76.5%
*-commutative76.5%
Simplified76.5%
Final simplification85.2%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= y -3.05) 1.0 (if (<= y 4.8e-91) (+ 1.0 (/ (/ x z) (- y t))) 1.0)))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -3.05) {
tmp = 1.0;
} else if (y <= 4.8e-91) {
tmp = 1.0 + ((x / z) / (y - t));
} else {
tmp = 1.0;
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= (-3.05d0)) then
tmp = 1.0d0
else if (y <= 4.8d-91) then
tmp = 1.0d0 + ((x / z) / (y - t))
else
tmp = 1.0d0
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -3.05) {
tmp = 1.0;
} else if (y <= 4.8e-91) {
tmp = 1.0 + ((x / z) / (y - t));
} else {
tmp = 1.0;
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if y <= -3.05: tmp = 1.0 elif y <= 4.8e-91: tmp = 1.0 + ((x / z) / (y - t)) else: tmp = 1.0 return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (y <= -3.05) tmp = 1.0; elseif (y <= 4.8e-91) tmp = Float64(1.0 + Float64(Float64(x / z) / Float64(y - t))); else tmp = 1.0; end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (y <= -3.05)
tmp = 1.0;
elseif (y <= 4.8e-91)
tmp = 1.0 + ((x / z) / (y - t));
else
tmp = 1.0;
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[y, -3.05], 1.0, If[LessEqual[y, 4.8e-91], N[(1.0 + N[(N[(x / z), $MachinePrecision] / N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1.0]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.05:\\
\;\;\;\;1\\
\mathbf{elif}\;y \leq 4.8 \cdot 10^{-91}:\\
\;\;\;\;1 + \frac{\frac{x}{z}}{y - t}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if y < -3.0499999999999998 or 4.80000000000000022e-91 < y Initial program 100.0%
Taylor expanded in t around 0 93.3%
Taylor expanded in x around 0 91.5%
if -3.0499999999999998 < y < 4.80000000000000022e-91Initial program 96.6%
sub-neg96.6%
neg-mul-196.6%
*-commutative96.6%
*-commutative96.6%
associate-/r*96.3%
associate-*r/96.3%
metadata-eval96.3%
times-frac96.3%
*-lft-identity96.3%
neg-mul-196.3%
sub-neg96.3%
+-commutative96.3%
distribute-neg-out96.3%
remove-double-neg96.3%
sub-neg96.3%
Simplified96.3%
Taylor expanded in z around inf 76.5%
associate-/r*78.2%
Simplified78.2%
Final simplification85.9%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(if (<= z -2.9e-97)
(+ 1.0 (/ (/ x z) (- y t)))
(if (<= z 3.25e-142)
(- 1.0 (/ x (* y (- y t))))
(- 1.0 (/ x (* (- z y) t))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -2.9e-97) {
tmp = 1.0 + ((x / z) / (y - t));
} else if (z <= 3.25e-142) {
tmp = 1.0 - (x / (y * (y - t)));
} else {
tmp = 1.0 - (x / ((z - y) * t));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (z <= (-2.9d-97)) then
tmp = 1.0d0 + ((x / z) / (y - t))
else if (z <= 3.25d-142) then
tmp = 1.0d0 - (x / (y * (y - t)))
else
tmp = 1.0d0 - (x / ((z - y) * t))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -2.9e-97) {
tmp = 1.0 + ((x / z) / (y - t));
} else if (z <= 3.25e-142) {
tmp = 1.0 - (x / (y * (y - t)));
} else {
tmp = 1.0 - (x / ((z - y) * t));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if z <= -2.9e-97: tmp = 1.0 + ((x / z) / (y - t)) elif z <= 3.25e-142: tmp = 1.0 - (x / (y * (y - t))) else: tmp = 1.0 - (x / ((z - y) * t)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (z <= -2.9e-97) tmp = Float64(1.0 + Float64(Float64(x / z) / Float64(y - t))); elseif (z <= 3.25e-142) tmp = Float64(1.0 - Float64(x / Float64(y * Float64(y - t)))); else tmp = Float64(1.0 - Float64(x / Float64(Float64(z - y) * t))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (z <= -2.9e-97)
tmp = 1.0 + ((x / z) / (y - t));
elseif (z <= 3.25e-142)
tmp = 1.0 - (x / (y * (y - t)));
else
tmp = 1.0 - (x / ((z - y) * t));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[z, -2.9e-97], N[(1.0 + N[(N[(x / z), $MachinePrecision] / N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.25e-142], N[(1.0 - N[(x / N[(y * N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 - N[(x / N[(N[(z - y), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.9 \cdot 10^{-97}:\\
\;\;\;\;1 + \frac{\frac{x}{z}}{y - t}\\
\mathbf{elif}\;z \leq 3.25 \cdot 10^{-142}:\\
\;\;\;\;1 - \frac{x}{y \cdot \left(y - t\right)}\\
\mathbf{else}:\\
\;\;\;\;1 - \frac{x}{\left(z - y\right) \cdot t}\\
\end{array}
\end{array}
if z < -2.8999999999999999e-97Initial program 98.9%
sub-neg98.9%
neg-mul-198.9%
*-commutative98.9%
*-commutative98.9%
associate-/r*98.8%
associate-*r/98.8%
metadata-eval98.8%
times-frac98.8%
*-lft-identity98.8%
neg-mul-198.8%
sub-neg98.8%
+-commutative98.8%
distribute-neg-out98.8%
remove-double-neg98.8%
sub-neg98.8%
Simplified98.8%
Taylor expanded in z around inf 92.6%
associate-/r*92.4%
Simplified92.4%
if -2.8999999999999999e-97 < z < 3.25000000000000013e-142Initial program 96.4%
Taylor expanded in z around 0 88.9%
if 3.25000000000000013e-142 < z Initial program 99.9%
clear-num99.9%
associate-/r/100.0%
*-commutative100.0%
associate-/r*99.9%
Applied egg-rr99.9%
Taylor expanded in t around inf 86.3%
associate-/r*86.2%
Simplified86.2%
*-commutative86.2%
frac-2neg86.2%
distribute-neg-frac86.2%
metadata-eval86.2%
associate-*r/86.2%
div-inv86.2%
sub-neg86.2%
distribute-neg-in86.2%
add-sqr-sqrt0.0%
sqrt-unprod76.9%
sqr-neg76.9%
sqrt-unprod76.0%
add-sqr-sqrt76.0%
add-sqr-sqrt0.0%
sqrt-unprod86.7%
sqr-neg86.7%
sqrt-unprod86.2%
add-sqr-sqrt86.2%
Applied egg-rr86.2%
associate-/l/86.3%
*-commutative86.3%
+-commutative86.3%
unsub-neg86.3%
Simplified86.3%
Final simplification89.1%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(if (<= z -2.75e-97)
(+ 1.0 (/ (/ x z) (- y t)))
(if (<= z 4.1e-144)
(- 1.0 (/ x (* y (- y t))))
(- 1.0 (/ (/ x t) (- z y))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -2.75e-97) {
tmp = 1.0 + ((x / z) / (y - t));
} else if (z <= 4.1e-144) {
tmp = 1.0 - (x / (y * (y - t)));
} else {
tmp = 1.0 - ((x / t) / (z - y));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (z <= (-2.75d-97)) then
tmp = 1.0d0 + ((x / z) / (y - t))
else if (z <= 4.1d-144) then
tmp = 1.0d0 - (x / (y * (y - t)))
else
tmp = 1.0d0 - ((x / t) / (z - y))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -2.75e-97) {
tmp = 1.0 + ((x / z) / (y - t));
} else if (z <= 4.1e-144) {
tmp = 1.0 - (x / (y * (y - t)));
} else {
tmp = 1.0 - ((x / t) / (z - y));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if z <= -2.75e-97: tmp = 1.0 + ((x / z) / (y - t)) elif z <= 4.1e-144: tmp = 1.0 - (x / (y * (y - t))) else: tmp = 1.0 - ((x / t) / (z - y)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (z <= -2.75e-97) tmp = Float64(1.0 + Float64(Float64(x / z) / Float64(y - t))); elseif (z <= 4.1e-144) tmp = Float64(1.0 - Float64(x / Float64(y * Float64(y - t)))); else tmp = Float64(1.0 - Float64(Float64(x / t) / Float64(z - y))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (z <= -2.75e-97)
tmp = 1.0 + ((x / z) / (y - t));
elseif (z <= 4.1e-144)
tmp = 1.0 - (x / (y * (y - t)));
else
tmp = 1.0 - ((x / t) / (z - y));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[z, -2.75e-97], N[(1.0 + N[(N[(x / z), $MachinePrecision] / N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 4.1e-144], N[(1.0 - N[(x / N[(y * N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 - N[(N[(x / t), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.75 \cdot 10^{-97}:\\
\;\;\;\;1 + \frac{\frac{x}{z}}{y - t}\\
\mathbf{elif}\;z \leq 4.1 \cdot 10^{-144}:\\
\;\;\;\;1 - \frac{x}{y \cdot \left(y - t\right)}\\
\mathbf{else}:\\
\;\;\;\;1 - \frac{\frac{x}{t}}{z - y}\\
\end{array}
\end{array}
if z < -2.74999999999999974e-97Initial program 98.9%
sub-neg98.9%
neg-mul-198.9%
*-commutative98.9%
*-commutative98.9%
associate-/r*98.8%
associate-*r/98.8%
metadata-eval98.8%
times-frac98.8%
*-lft-identity98.8%
neg-mul-198.8%
sub-neg98.8%
+-commutative98.8%
distribute-neg-out98.8%
remove-double-neg98.8%
sub-neg98.8%
Simplified98.8%
Taylor expanded in z around inf 92.6%
associate-/r*92.4%
Simplified92.4%
if -2.74999999999999974e-97 < z < 4.1e-144Initial program 96.4%
Taylor expanded in z around 0 88.9%
if 4.1e-144 < z Initial program 99.9%
sub-neg99.9%
neg-mul-199.9%
*-commutative99.9%
*-commutative99.9%
associate-/r*100.0%
associate-*r/100.0%
metadata-eval100.0%
times-frac100.0%
*-lft-identity100.0%
neg-mul-1100.0%
sub-neg100.0%
+-commutative100.0%
distribute-neg-out100.0%
remove-double-neg100.0%
sub-neg100.0%
Simplified100.0%
Taylor expanded in t around inf 86.3%
associate-*r/86.3%
neg-mul-186.3%
associate-/r*86.2%
Simplified86.2%
Final simplification89.1%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= y -3.1e-71) 1.0 (if (<= y 7.6e-105) (- 1.0 (/ x (* z t))) 1.0)))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -3.1e-71) {
tmp = 1.0;
} else if (y <= 7.6e-105) {
tmp = 1.0 - (x / (z * t));
} else {
tmp = 1.0;
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= (-3.1d-71)) then
tmp = 1.0d0
else if (y <= 7.6d-105) then
tmp = 1.0d0 - (x / (z * t))
else
tmp = 1.0d0
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -3.1e-71) {
tmp = 1.0;
} else if (y <= 7.6e-105) {
tmp = 1.0 - (x / (z * t));
} else {
tmp = 1.0;
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if y <= -3.1e-71: tmp = 1.0 elif y <= 7.6e-105: tmp = 1.0 - (x / (z * t)) else: tmp = 1.0 return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (y <= -3.1e-71) tmp = 1.0; elseif (y <= 7.6e-105) tmp = Float64(1.0 - Float64(x / Float64(z * t))); else tmp = 1.0; end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (y <= -3.1e-71)
tmp = 1.0;
elseif (y <= 7.6e-105)
tmp = 1.0 - (x / (z * t));
else
tmp = 1.0;
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[y, -3.1e-71], 1.0, If[LessEqual[y, 7.6e-105], N[(1.0 - N[(x / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1.0]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.1 \cdot 10^{-71}:\\
\;\;\;\;1\\
\mathbf{elif}\;y \leq 7.6 \cdot 10^{-105}:\\
\;\;\;\;1 - \frac{x}{z \cdot t}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if y < -3.10000000000000002e-71 or 7.5999999999999995e-105 < y Initial program 99.9%
Taylor expanded in t around 0 89.5%
Taylor expanded in x around 0 88.0%
if -3.10000000000000002e-71 < y < 7.5999999999999995e-105Initial program 95.9%
Taylor expanded in y around 0 76.1%
Final simplification83.9%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= y -1.9e-71) 1.0 (if (<= y 9e-105) (- 1.0 (/ (/ x t) z)) 1.0)))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.9e-71) {
tmp = 1.0;
} else if (y <= 9e-105) {
tmp = 1.0 - ((x / t) / z);
} else {
tmp = 1.0;
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= (-1.9d-71)) then
tmp = 1.0d0
else if (y <= 9d-105) then
tmp = 1.0d0 - ((x / t) / z)
else
tmp = 1.0d0
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.9e-71) {
tmp = 1.0;
} else if (y <= 9e-105) {
tmp = 1.0 - ((x / t) / z);
} else {
tmp = 1.0;
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if y <= -1.9e-71: tmp = 1.0 elif y <= 9e-105: tmp = 1.0 - ((x / t) / z) else: tmp = 1.0 return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (y <= -1.9e-71) tmp = 1.0; elseif (y <= 9e-105) tmp = Float64(1.0 - Float64(Float64(x / t) / z)); else tmp = 1.0; end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (y <= -1.9e-71)
tmp = 1.0;
elseif (y <= 9e-105)
tmp = 1.0 - ((x / t) / z);
else
tmp = 1.0;
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[y, -1.9e-71], 1.0, If[LessEqual[y, 9e-105], N[(1.0 - N[(N[(x / t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], 1.0]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.9 \cdot 10^{-71}:\\
\;\;\;\;1\\
\mathbf{elif}\;y \leq 9 \cdot 10^{-105}:\\
\;\;\;\;1 - \frac{\frac{x}{t}}{z}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if y < -1.89999999999999996e-71 or 8.9999999999999995e-105 < y Initial program 99.9%
Taylor expanded in t around 0 89.5%
Taylor expanded in x around 0 88.0%
if -1.89999999999999996e-71 < y < 8.9999999999999995e-105Initial program 95.9%
clear-num95.7%
associate-/r/95.6%
*-commutative95.6%
associate-/r*95.6%
Applied egg-rr95.6%
Taylor expanded in z around inf 82.0%
mul-1-neg82.0%
*-commutative82.0%
associate-/r*82.0%
distribute-neg-frac82.0%
distribute-neg-frac82.0%
Simplified82.0%
Taylor expanded in y around 0 77.2%
Final simplification84.3%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= y -6.2e-71) 1.0 (if (<= y 9e-105) (- 1.0 (/ (/ x z) t)) 1.0)))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -6.2e-71) {
tmp = 1.0;
} else if (y <= 9e-105) {
tmp = 1.0 - ((x / z) / t);
} else {
tmp = 1.0;
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= (-6.2d-71)) then
tmp = 1.0d0
else if (y <= 9d-105) then
tmp = 1.0d0 - ((x / z) / t)
else
tmp = 1.0d0
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -6.2e-71) {
tmp = 1.0;
} else if (y <= 9e-105) {
tmp = 1.0 - ((x / z) / t);
} else {
tmp = 1.0;
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if y <= -6.2e-71: tmp = 1.0 elif y <= 9e-105: tmp = 1.0 - ((x / z) / t) else: tmp = 1.0 return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (y <= -6.2e-71) tmp = 1.0; elseif (y <= 9e-105) tmp = Float64(1.0 - Float64(Float64(x / z) / t)); else tmp = 1.0; end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (y <= -6.2e-71)
tmp = 1.0;
elseif (y <= 9e-105)
tmp = 1.0 - ((x / z) / t);
else
tmp = 1.0;
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[y, -6.2e-71], 1.0, If[LessEqual[y, 9e-105], N[(1.0 - N[(N[(x / z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], 1.0]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -6.2 \cdot 10^{-71}:\\
\;\;\;\;1\\
\mathbf{elif}\;y \leq 9 \cdot 10^{-105}:\\
\;\;\;\;1 - \frac{\frac{x}{z}}{t}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if y < -6.20000000000000004e-71 or 8.9999999999999995e-105 < y Initial program 99.9%
Taylor expanded in t around 0 89.5%
Taylor expanded in x around 0 88.0%
if -6.20000000000000004e-71 < y < 8.9999999999999995e-105Initial program 95.9%
clear-num95.7%
associate-/r/95.6%
*-commutative95.6%
associate-/r*95.6%
Applied egg-rr95.6%
Taylor expanded in y around 0 76.1%
associate-*l/76.1%
*-un-lft-identity76.1%
*-commutative76.1%
associate-/r*77.2%
Applied egg-rr77.2%
Final simplification84.3%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= t 1.25e-115) (+ 1.0 (/ (/ x z) (- y t))) (- 1.0 (/ x (* (- z y) t)))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (t <= 1.25e-115) {
tmp = 1.0 + ((x / z) / (y - t));
} else {
tmp = 1.0 - (x / ((z - y) * t));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (t <= 1.25d-115) then
tmp = 1.0d0 + ((x / z) / (y - t))
else
tmp = 1.0d0 - (x / ((z - y) * t))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= 1.25e-115) {
tmp = 1.0 + ((x / z) / (y - t));
} else {
tmp = 1.0 - (x / ((z - y) * t));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if t <= 1.25e-115: tmp = 1.0 + ((x / z) / (y - t)) else: tmp = 1.0 - (x / ((z - y) * t)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (t <= 1.25e-115) tmp = Float64(1.0 + Float64(Float64(x / z) / Float64(y - t))); else tmp = Float64(1.0 - Float64(x / Float64(Float64(z - y) * t))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (t <= 1.25e-115)
tmp = 1.0 + ((x / z) / (y - t));
else
tmp = 1.0 - (x / ((z - y) * t));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[t, 1.25e-115], N[(1.0 + N[(N[(x / z), $MachinePrecision] / N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 - N[(x / N[(N[(z - y), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq 1.25 \cdot 10^{-115}:\\
\;\;\;\;1 + \frac{\frac{x}{z}}{y - t}\\
\mathbf{else}:\\
\;\;\;\;1 - \frac{x}{\left(z - y\right) \cdot t}\\
\end{array}
\end{array}
if t < 1.2500000000000001e-115Initial program 98.0%
sub-neg98.0%
neg-mul-198.0%
*-commutative98.0%
*-commutative98.0%
associate-/r*98.9%
associate-*r/98.9%
metadata-eval98.9%
times-frac98.9%
*-lft-identity98.9%
neg-mul-198.9%
sub-neg98.9%
+-commutative98.9%
distribute-neg-out98.9%
remove-double-neg98.9%
sub-neg98.9%
Simplified98.9%
Taylor expanded in z around inf 77.6%
associate-/r*78.5%
Simplified78.5%
if 1.2500000000000001e-115 < t Initial program 99.9%
clear-num99.8%
associate-/r/100.0%
*-commutative100.0%
associate-/r*99.9%
Applied egg-rr99.9%
Taylor expanded in t around inf 92.8%
associate-/r*92.7%
Simplified92.7%
*-commutative92.7%
frac-2neg92.7%
distribute-neg-frac92.7%
metadata-eval92.7%
associate-*r/91.4%
div-inv91.4%
sub-neg91.4%
distribute-neg-in91.4%
add-sqr-sqrt49.4%
sqrt-unprod85.8%
sqr-neg85.8%
sqrt-unprod37.4%
add-sqr-sqrt79.8%
add-sqr-sqrt42.3%
sqrt-unprod85.7%
sqr-neg85.7%
sqrt-unprod41.9%
add-sqr-sqrt91.4%
Applied egg-rr91.4%
associate-/l/92.7%
*-commutative92.7%
+-commutative92.7%
unsub-neg92.7%
Simplified92.7%
Final simplification82.7%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= z -1.06e-159) 1.0 (+ 1.0 (/ x (* y t)))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.06e-159) {
tmp = 1.0;
} else {
tmp = 1.0 + (x / (y * t));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (z <= (-1.06d-159)) then
tmp = 1.0d0
else
tmp = 1.0d0 + (x / (y * t))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.06e-159) {
tmp = 1.0;
} else {
tmp = 1.0 + (x / (y * t));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if z <= -1.06e-159: tmp = 1.0 else: tmp = 1.0 + (x / (y * t)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (z <= -1.06e-159) tmp = 1.0; else tmp = Float64(1.0 + Float64(x / Float64(y * t))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (z <= -1.06e-159)
tmp = 1.0;
else
tmp = 1.0 + (x / (y * t));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[z, -1.06e-159], 1.0, N[(1.0 + N[(x / N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.06 \cdot 10^{-159}:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{x}{y \cdot t}\\
\end{array}
\end{array}
if z < -1.06e-159Initial program 99.0%
Taylor expanded in t around 0 73.0%
Taylor expanded in x around 0 79.6%
if -1.06e-159 < z Initial program 98.2%
sub-neg98.2%
neg-mul-198.2%
*-commutative98.2%
*-commutative98.2%
associate-/r*98.1%
associate-*r/98.1%
metadata-eval98.1%
times-frac98.1%
*-lft-identity98.1%
neg-mul-198.1%
sub-neg98.1%
+-commutative98.1%
distribute-neg-out98.1%
remove-double-neg98.1%
sub-neg98.1%
Simplified98.1%
Taylor expanded in z around 0 77.9%
mul-1-neg77.9%
distribute-frac-neg77.9%
associate-/r*76.6%
Simplified76.6%
Taylor expanded in y around 0 61.0%
Final simplification68.3%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= z -1.5e-159) 1.0 (+ 1.0 (/ (/ x t) y))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.5e-159) {
tmp = 1.0;
} else {
tmp = 1.0 + ((x / t) / y);
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (z <= (-1.5d-159)) then
tmp = 1.0d0
else
tmp = 1.0d0 + ((x / t) / y)
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.5e-159) {
tmp = 1.0;
} else {
tmp = 1.0 + ((x / t) / y);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if z <= -1.5e-159: tmp = 1.0 else: tmp = 1.0 + ((x / t) / y) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (z <= -1.5e-159) tmp = 1.0; else tmp = Float64(1.0 + Float64(Float64(x / t) / y)); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (z <= -1.5e-159)
tmp = 1.0;
else
tmp = 1.0 + ((x / t) / y);
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[z, -1.5e-159], 1.0, N[(1.0 + N[(N[(x / t), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.5 \cdot 10^{-159}:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{\frac{x}{t}}{y}\\
\end{array}
\end{array}
if z < -1.50000000000000005e-159Initial program 99.0%
Taylor expanded in t around 0 73.0%
Taylor expanded in x around 0 79.6%
if -1.50000000000000005e-159 < z Initial program 98.2%
sub-neg98.2%
neg-mul-198.2%
*-commutative98.2%
*-commutative98.2%
associate-/r*98.1%
associate-*r/98.1%
metadata-eval98.1%
times-frac98.1%
*-lft-identity98.1%
neg-mul-198.1%
sub-neg98.1%
+-commutative98.1%
distribute-neg-out98.1%
remove-double-neg98.1%
sub-neg98.1%
Simplified98.1%
Taylor expanded in z around 0 77.9%
mul-1-neg77.9%
distribute-frac-neg77.9%
associate-/r*76.6%
Simplified76.6%
Taylor expanded in y around 0 61.0%
associate-/r*61.0%
Simplified61.0%
Final simplification68.3%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 1.0)
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
return 1.0;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = 1.0d0
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
return 1.0;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): return 1.0
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) return 1.0 end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
tmp = 1.0;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := 1.0
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
1
\end{array}
Initial program 98.5%
Taylor expanded in t around 0 72.0%
Taylor expanded in x around 0 74.0%
Final simplification74.0%
herbie shell --seed 2024029
(FPCore (x y z t)
:name "Data.Random.Distribution.Triangular:triangularCDF from random-fu-0.2.6.2, A"
:precision binary64
(- 1.0 (/ x (* (- y z) (- y t)))))