
(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 13 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 (/ (/ 1.0 (- y z)) (/ (- t y) x))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
return 1.0 + ((1.0 / (y - z)) / ((t - y) / x));
}
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 + ((1.0d0 / (y - z)) / ((t - y) / x))
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
return 1.0 + ((1.0 / (y - z)) / ((t - y) / x));
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): return 1.0 + ((1.0 / (y - z)) / ((t - y) / x))
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) return Float64(1.0 + Float64(Float64(1.0 / Float64(y - z)) / Float64(Float64(t - y) / x))) end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
tmp = 1.0 + ((1.0 / (y - z)) / ((t - y) / x));
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[(1.0 / N[(y - z), $MachinePrecision]), $MachinePrecision] / N[(N[(t - y), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
1 + \frac{\frac{1}{y - z}}{\frac{t - y}{x}}
\end{array}
Initial program 97.3%
*-un-lft-identity97.3%
times-frac98.8%
Applied egg-rr98.8%
clear-num98.7%
div-inv98.8%
Applied egg-rr98.8%
Final simplification98.8%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (or (<= y -1.26e-76) (not (<= y 5.8e-55))) (+ 1.0 (/ x (* y (- z y)))) (+ 1.0 (* (/ 1.0 (- y z)) (/ x t)))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -1.26e-76) || !(y <= 5.8e-55)) {
tmp = 1.0 + (x / (y * (z - y)));
} else {
tmp = 1.0 + ((1.0 / (y - z)) * (x / 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 ((y <= (-1.26d-76)) .or. (.not. (y <= 5.8d-55))) then
tmp = 1.0d0 + (x / (y * (z - y)))
else
tmp = 1.0d0 + ((1.0d0 / (y - z)) * (x / 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 ((y <= -1.26e-76) || !(y <= 5.8e-55)) {
tmp = 1.0 + (x / (y * (z - y)));
} else {
tmp = 1.0 + ((1.0 / (y - z)) * (x / t));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if (y <= -1.26e-76) or not (y <= 5.8e-55): tmp = 1.0 + (x / (y * (z - y))) else: tmp = 1.0 + ((1.0 / (y - z)) * (x / t)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if ((y <= -1.26e-76) || !(y <= 5.8e-55)) tmp = Float64(1.0 + Float64(x / Float64(y * Float64(z - y)))); else tmp = Float64(1.0 + Float64(Float64(1.0 / Float64(y - z)) * Float64(x / 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 ((y <= -1.26e-76) || ~((y <= 5.8e-55)))
tmp = 1.0 + (x / (y * (z - y)));
else
tmp = 1.0 + ((1.0 / (y - z)) * (x / 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[Or[LessEqual[y, -1.26e-76], N[Not[LessEqual[y, 5.8e-55]], $MachinePrecision]], N[(1.0 + N[(x / N[(y * N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(N[(1.0 / N[(y - z), $MachinePrecision]), $MachinePrecision] * N[(x / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.26 \cdot 10^{-76} \lor \neg \left(y \leq 5.8 \cdot 10^{-55}\right):\\
\;\;\;\;1 + \frac{x}{y \cdot \left(z - y\right)}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{1}{y - z} \cdot \frac{x}{t}\\
\end{array}
\end{array}
if y < -1.26e-76 or 5.8e-55 < y Initial program 100.0%
Taylor expanded in t around 0 95.2%
if -1.26e-76 < y < 5.8e-55Initial program 92.6%
Taylor expanded in t around inf 84.4%
associate-/r*86.1%
div-inv86.1%
Applied egg-rr86.1%
Final simplification92.0%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (or (<= y -2.5e-69) (not (<= y 2.3e-55))) (+ 1.0 (/ x (* y (- z y)))) (+ 1.0 (/ (/ x t) (- y z)))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -2.5e-69) || !(y <= 2.3e-55)) {
tmp = 1.0 + (x / (y * (z - y)));
} else {
tmp = 1.0 + ((x / t) / (y - z));
}
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 <= (-2.5d-69)) .or. (.not. (y <= 2.3d-55))) then
tmp = 1.0d0 + (x / (y * (z - y)))
else
tmp = 1.0d0 + ((x / t) / (y - z))
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 <= -2.5e-69) || !(y <= 2.3e-55)) {
tmp = 1.0 + (x / (y * (z - y)));
} else {
tmp = 1.0 + ((x / t) / (y - z));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if (y <= -2.5e-69) or not (y <= 2.3e-55): tmp = 1.0 + (x / (y * (z - y))) else: tmp = 1.0 + ((x / t) / (y - z)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if ((y <= -2.5e-69) || !(y <= 2.3e-55)) tmp = Float64(1.0 + Float64(x / Float64(y * Float64(z - y)))); else tmp = Float64(1.0 + Float64(Float64(x / t) / Float64(y - z))); 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 <= -2.5e-69) || ~((y <= 2.3e-55)))
tmp = 1.0 + (x / (y * (z - y)));
else
tmp = 1.0 + ((x / t) / (y - z));
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[Or[LessEqual[y, -2.5e-69], N[Not[LessEqual[y, 2.3e-55]], $MachinePrecision]], N[(1.0 + N[(x / N[(y * N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(N[(x / t), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.5 \cdot 10^{-69} \lor \neg \left(y \leq 2.3 \cdot 10^{-55}\right):\\
\;\;\;\;1 + \frac{x}{y \cdot \left(z - y\right)}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{\frac{x}{t}}{y - z}\\
\end{array}
\end{array}
if y < -2.50000000000000017e-69 or 2.30000000000000011e-55 < y Initial program 100.0%
Taylor expanded in t around 0 95.2%
if -2.50000000000000017e-69 < y < 2.30000000000000011e-55Initial program 92.6%
*-un-lft-identity92.6%
times-frac96.7%
Applied egg-rr96.7%
clear-num96.5%
div-inv96.9%
Applied egg-rr96.9%
Taylor expanded in t around inf 84.4%
associate-/r*86.1%
Simplified86.1%
Final simplification92.0%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (or (<= y -8e-69) (not (<= y 2.2e-55))) (+ 1.0 (/ (/ x y) (- t y))) (+ 1.0 (/ (/ x t) (- y z)))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -8e-69) || !(y <= 2.2e-55)) {
tmp = 1.0 + ((x / y) / (t - y));
} else {
tmp = 1.0 + ((x / t) / (y - z));
}
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 <= (-8d-69)) .or. (.not. (y <= 2.2d-55))) then
tmp = 1.0d0 + ((x / y) / (t - y))
else
tmp = 1.0d0 + ((x / t) / (y - z))
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 <= -8e-69) || !(y <= 2.2e-55)) {
tmp = 1.0 + ((x / y) / (t - y));
} else {
tmp = 1.0 + ((x / t) / (y - z));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if (y <= -8e-69) or not (y <= 2.2e-55): tmp = 1.0 + ((x / y) / (t - y)) else: tmp = 1.0 + ((x / t) / (y - z)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if ((y <= -8e-69) || !(y <= 2.2e-55)) tmp = Float64(1.0 + Float64(Float64(x / y) / Float64(t - y))); else tmp = Float64(1.0 + Float64(Float64(x / t) / Float64(y - z))); 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 <= -8e-69) || ~((y <= 2.2e-55)))
tmp = 1.0 + ((x / y) / (t - y));
else
tmp = 1.0 + ((x / t) / (y - z));
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[Or[LessEqual[y, -8e-69], N[Not[LessEqual[y, 2.2e-55]], $MachinePrecision]], N[(1.0 + N[(N[(x / y), $MachinePrecision] / N[(t - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(N[(x / t), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -8 \cdot 10^{-69} \lor \neg \left(y \leq 2.2 \cdot 10^{-55}\right):\\
\;\;\;\;1 + \frac{\frac{x}{y}}{t - y}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{\frac{x}{t}}{y - z}\\
\end{array}
\end{array}
if y < -7.9999999999999997e-69 or 2.2e-55 < y Initial program 100.0%
Taylor expanded in z around 0 94.4%
sub-neg94.4%
associate-/r*94.4%
distribute-neg-frac294.4%
neg-sub094.4%
sub-neg94.4%
+-commutative94.4%
associate--r+94.4%
neg-sub094.4%
remove-double-neg94.4%
Simplified94.4%
if -7.9999999999999997e-69 < y < 2.2e-55Initial program 92.6%
*-un-lft-identity92.6%
times-frac96.7%
Applied egg-rr96.7%
clear-num96.5%
div-inv96.9%
Applied egg-rr96.9%
Taylor expanded in t around inf 84.4%
associate-/r*86.1%
Simplified86.1%
Final simplification91.5%
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 -2e-126)
(- 1.0 (/ (/ x z) (- t y)))
(if (<= z 1.2e-226)
(+ 1.0 (/ (/ x y) (- t y)))
(+ 1.0 (/ x (* (- y z) t))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -2e-126) {
tmp = 1.0 - ((x / z) / (t - y));
} else if (z <= 1.2e-226) {
tmp = 1.0 + ((x / y) / (t - y));
} else {
tmp = 1.0 + (x / ((y - z) * 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 <= (-2d-126)) then
tmp = 1.0d0 - ((x / z) / (t - y))
else if (z <= 1.2d-226) then
tmp = 1.0d0 + ((x / y) / (t - y))
else
tmp = 1.0d0 + (x / ((y - z) * 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 <= -2e-126) {
tmp = 1.0 - ((x / z) / (t - y));
} else if (z <= 1.2e-226) {
tmp = 1.0 + ((x / y) / (t - y));
} else {
tmp = 1.0 + (x / ((y - z) * t));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if z <= -2e-126: tmp = 1.0 - ((x / z) / (t - y)) elif z <= 1.2e-226: tmp = 1.0 + ((x / y) / (t - y)) else: tmp = 1.0 + (x / ((y - z) * t)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (z <= -2e-126) tmp = Float64(1.0 - Float64(Float64(x / z) / Float64(t - y))); elseif (z <= 1.2e-226) tmp = Float64(1.0 + Float64(Float64(x / y) / Float64(t - y))); else tmp = Float64(1.0 + Float64(x / Float64(Float64(y - z) * 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 <= -2e-126)
tmp = 1.0 - ((x / z) / (t - y));
elseif (z <= 1.2e-226)
tmp = 1.0 + ((x / y) / (t - y));
else
tmp = 1.0 + (x / ((y - z) * 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, -2e-126], N[(1.0 - N[(N[(x / z), $MachinePrecision] / N[(t - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.2e-226], N[(1.0 + N[(N[(x / y), $MachinePrecision] / N[(t - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(x / N[(N[(y - z), $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 \cdot 10^{-126}:\\
\;\;\;\;1 - \frac{\frac{x}{z}}{t - y}\\
\mathbf{elif}\;z \leq 1.2 \cdot 10^{-226}:\\
\;\;\;\;1 + \frac{\frac{x}{y}}{t - y}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{x}{\left(y - z\right) \cdot t}\\
\end{array}
\end{array}
if z < -1.9999999999999999e-126Initial program 98.9%
Taylor expanded in z around inf 88.3%
associate-/r*89.4%
Simplified89.4%
if -1.9999999999999999e-126 < z < 1.2e-226Initial program 92.2%
Taylor expanded in z around 0 84.1%
sub-neg84.1%
associate-/r*85.3%
distribute-neg-frac285.3%
neg-sub085.3%
sub-neg85.3%
+-commutative85.3%
associate--r+85.3%
neg-sub085.3%
remove-double-neg85.3%
Simplified85.3%
if 1.2e-226 < z Initial program 99.9%
Taylor expanded in t around inf 84.5%
Final simplification86.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 -2.3e-23) 1.0 (if (<= y 8.5e-55) (+ 1.0 (/ (/ x t) (- y z))) 1.0)))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -2.3e-23) {
tmp = 1.0;
} else if (y <= 8.5e-55) {
tmp = 1.0 + ((x / t) / (y - 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 <= (-2.3d-23)) then
tmp = 1.0d0
else if (y <= 8.5d-55) then
tmp = 1.0d0 + ((x / t) / (y - 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 <= -2.3e-23) {
tmp = 1.0;
} else if (y <= 8.5e-55) {
tmp = 1.0 + ((x / t) / (y - 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 <= -2.3e-23: tmp = 1.0 elif y <= 8.5e-55: tmp = 1.0 + ((x / t) / (y - 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 <= -2.3e-23) tmp = 1.0; elseif (y <= 8.5e-55) tmp = Float64(1.0 + Float64(Float64(x / t) / Float64(y - 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 <= -2.3e-23)
tmp = 1.0;
elseif (y <= 8.5e-55)
tmp = 1.0 + ((x / t) / (y - 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, -2.3e-23], 1.0, If[LessEqual[y, 8.5e-55], N[(1.0 + N[(N[(x / t), $MachinePrecision] / N[(y - z), $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 -2.3 \cdot 10^{-23}:\\
\;\;\;\;1\\
\mathbf{elif}\;y \leq 8.5 \cdot 10^{-55}:\\
\;\;\;\;1 + \frac{\frac{x}{t}}{y - z}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if y < -2.3000000000000001e-23 or 8.49999999999999968e-55 < y Initial program 100.0%
Taylor expanded in x around 0 90.7%
if -2.3000000000000001e-23 < y < 8.49999999999999968e-55Initial program 93.4%
*-un-lft-identity93.4%
times-frac97.0%
Applied egg-rr97.0%
clear-num96.8%
div-inv97.2%
Applied egg-rr97.2%
Taylor expanded in t around inf 84.3%
associate-/r*85.8%
Simplified85.8%
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 -8.6e-23) 1.0 (if (<= y 7.6e-56) (+ 1.0 (/ x (* (- y 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 <= -8.6e-23) {
tmp = 1.0;
} else if (y <= 7.6e-56) {
tmp = 1.0 + (x / ((y - 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 <= (-8.6d-23)) then
tmp = 1.0d0
else if (y <= 7.6d-56) then
tmp = 1.0d0 + (x / ((y - 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 <= -8.6e-23) {
tmp = 1.0;
} else if (y <= 7.6e-56) {
tmp = 1.0 + (x / ((y - 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 <= -8.6e-23: tmp = 1.0 elif y <= 7.6e-56: tmp = 1.0 + (x / ((y - 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 <= -8.6e-23) tmp = 1.0; elseif (y <= 7.6e-56) tmp = Float64(1.0 + Float64(x / Float64(Float64(y - 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 <= -8.6e-23)
tmp = 1.0;
elseif (y <= 7.6e-56)
tmp = 1.0 + (x / ((y - 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, -8.6e-23], 1.0, If[LessEqual[y, 7.6e-56], N[(1.0 + N[(x / N[(N[(y - z), $MachinePrecision] * 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 -8.6 \cdot 10^{-23}:\\
\;\;\;\;1\\
\mathbf{elif}\;y \leq 7.6 \cdot 10^{-56}:\\
\;\;\;\;1 + \frac{x}{\left(y - z\right) \cdot t}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if y < -8.60000000000000004e-23 or 7.6000000000000004e-56 < y Initial program 100.0%
Taylor expanded in x around 0 90.7%
if -8.60000000000000004e-23 < y < 7.6000000000000004e-56Initial program 93.4%
Taylor expanded in t around inf 84.3%
Final simplification88.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 -1.5e-48) 1.0 (if (<= y 7.6e-56) (- 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.5e-48) {
tmp = 1.0;
} else if (y <= 7.6e-56) {
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.5d-48)) then
tmp = 1.0d0
else if (y <= 7.6d-56) 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.5e-48) {
tmp = 1.0;
} else if (y <= 7.6e-56) {
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.5e-48: tmp = 1.0 elif y <= 7.6e-56: 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.5e-48) tmp = 1.0; elseif (y <= 7.6e-56) 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.5e-48)
tmp = 1.0;
elseif (y <= 7.6e-56)
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.5e-48], 1.0, If[LessEqual[y, 7.6e-56], 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.5 \cdot 10^{-48}:\\
\;\;\;\;1\\
\mathbf{elif}\;y \leq 7.6 \cdot 10^{-56}:\\
\;\;\;\;1 - \frac{\frac{x}{t}}{z}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if y < -1.5e-48 or 7.6000000000000004e-56 < y Initial program 100.0%
Taylor expanded in x around 0 89.8%
if -1.5e-48 < y < 7.6000000000000004e-56Initial program 93.1%
clear-num93.0%
inv-pow93.0%
associate-/l*97.0%
Applied egg-rr97.0%
unpow-197.0%
Simplified97.0%
Taylor expanded in y around 0 75.3%
associate-/r*76.4%
Simplified76.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 -1.6e-48) 1.0 (if (<= y 1.6e-55) (- 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 <= -1.6e-48) {
tmp = 1.0;
} else if (y <= 1.6e-55) {
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 <= (-1.6d-48)) then
tmp = 1.0d0
else if (y <= 1.6d-55) 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 <= -1.6e-48) {
tmp = 1.0;
} else if (y <= 1.6e-55) {
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 <= -1.6e-48: tmp = 1.0 elif y <= 1.6e-55: 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 <= -1.6e-48) tmp = 1.0; elseif (y <= 1.6e-55) 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 <= -1.6e-48)
tmp = 1.0;
elseif (y <= 1.6e-55)
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, -1.6e-48], 1.0, If[LessEqual[y, 1.6e-55], 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 -1.6 \cdot 10^{-48}:\\
\;\;\;\;1\\
\mathbf{elif}\;y \leq 1.6 \cdot 10^{-55}:\\
\;\;\;\;1 - \frac{x}{z \cdot t}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if y < -1.5999999999999999e-48 or 1.6000000000000001e-55 < y Initial program 100.0%
Taylor expanded in x around 0 89.8%
if -1.5999999999999999e-48 < y < 1.6000000000000001e-55Initial program 93.1%
Taylor expanded in y around 0 75.3%
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 (+ 1.0 (/ 1.0 (* (- y z) (/ (- t y) x)))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
return 1.0 + (1.0 / ((y - z) * ((t - y) / x)));
}
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 + (1.0d0 / ((y - z) * ((t - y) / x)))
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
return 1.0 + (1.0 / ((y - z) * ((t - y) / x)));
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): return 1.0 + (1.0 / ((y - z) * ((t - y) / x)))
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) return Float64(1.0 + Float64(1.0 / Float64(Float64(y - z) * Float64(Float64(t - y) / x)))) end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
tmp = 1.0 + (1.0 / ((y - z) * ((t - y) / x)));
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[(1.0 / N[(N[(y - z), $MachinePrecision] * N[(N[(t - y), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
1 + \frac{1}{\left(y - z\right) \cdot \frac{t - y}{x}}
\end{array}
Initial program 97.3%
clear-num97.3%
inv-pow97.3%
associate-/l*98.8%
Applied egg-rr98.8%
unpow-198.8%
Simplified98.8%
Final simplification98.8%
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 (* (/ 1.0 (- y z)) (/ x (- t y)))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
return 1.0 + ((1.0 / (y - z)) * (x / (t - y)));
}
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 + ((1.0d0 / (y - z)) * (x / (t - y)))
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
return 1.0 + ((1.0 / (y - z)) * (x / (t - y)));
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): return 1.0 + ((1.0 / (y - z)) * (x / (t - y)))
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) return Float64(1.0 + Float64(Float64(1.0 / Float64(y - z)) * Float64(x / Float64(t - y)))) end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
tmp = 1.0 + ((1.0 / (y - z)) * (x / (t - y)));
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[(1.0 / N[(y - z), $MachinePrecision]), $MachinePrecision] * N[(x / N[(t - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
1 + \frac{1}{y - z} \cdot \frac{x}{t - y}
\end{array}
Initial program 97.3%
*-un-lft-identity97.3%
times-frac98.8%
Applied egg-rr98.8%
Final simplification98.8%
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 (* (- y z) (- t y)))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
return 1.0 + (x / ((y - z) * (t - y)));
}
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 / ((y - z) * (t - y)))
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 - y)));
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): return 1.0 + (x / ((y - z) * (t - y)))
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) return Float64(1.0 + Float64(x / Float64(Float64(y - z) * Float64(t - y)))) end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
tmp = 1.0 + (x / ((y - z) * (t - y)));
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[(x / N[(N[(y - z), $MachinePrecision] * N[(t - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
1 + \frac{x}{\left(y - z\right) \cdot \left(t - y\right)}
\end{array}
Initial program 97.3%
Final simplification97.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 97.3%
Taylor expanded in x around 0 72.4%
herbie shell --seed 2024146
(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)))))