
(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 10 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 (/ (- z y) (/ x (- y t))))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
return 1.0 + (1.0 / ((z - y) / (x / (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 + (1.0d0 / ((z - y) / (x / (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 + (1.0 / ((z - y) / (x / (y - t))));
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): return 1.0 + (1.0 / ((z - y) / (x / (y - t))))
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) return Float64(1.0 + Float64(1.0 / Float64(Float64(z - y) / Float64(x / Float64(y - t))))) end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
tmp = 1.0 + (1.0 / ((z - y) / (x / (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[(1.0 / N[(N[(z - y), $MachinePrecision] / N[(x / N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
1 + \frac{1}{\frac{z - y}{\frac{x}{y - t}}}
\end{array}
Initial program 98.8%
clear-num98.8%
inv-pow98.8%
associate-/l*99.1%
Applied egg-rr99.1%
unpow-199.1%
Simplified99.1%
clear-num98.8%
un-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 -7e-69) (not (<= y 3.7e-84))) (+ 1.0 (/ (/ x y) (- t y))) (- 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 ((y <= -7e-69) || !(y <= 3.7e-84)) {
tmp = 1.0 + ((x / y) / (t - y));
} 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 ((y <= (-7d-69)) .or. (.not. (y <= 3.7d-84))) then
tmp = 1.0d0 + ((x / y) / (t - y))
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 ((y <= -7e-69) || !(y <= 3.7e-84)) {
tmp = 1.0 + ((x / y) / (t - y));
} 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 (y <= -7e-69) or not (y <= 3.7e-84): tmp = 1.0 + ((x / y) / (t - y)) 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 ((y <= -7e-69) || !(y <= 3.7e-84)) tmp = Float64(1.0 + Float64(Float64(x / y) / Float64(t - y))); else tmp = Float64(1.0 - Float64(x / Float64(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 ((y <= -7e-69) || ~((y <= 3.7e-84)))
tmp = 1.0 + ((x / y) / (t - y));
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[Or[LessEqual[y, -7e-69], N[Not[LessEqual[y, 3.7e-84]], $MachinePrecision]], N[(1.0 + N[(N[(x / y), $MachinePrecision] / N[(t - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 - N[(x / N[(t * N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -7 \cdot 10^{-69} \lor \neg \left(y \leq 3.7 \cdot 10^{-84}\right):\\
\;\;\;\;1 + \frac{\frac{x}{y}}{t - y}\\
\mathbf{else}:\\
\;\;\;\;1 - \frac{x}{t \cdot \left(z - y\right)}\\
\end{array}
\end{array}
if y < -7.0000000000000003e-69 or 3.6999999999999999e-84 < y Initial program 100.0%
Taylor expanded in z around 0 92.7%
sub-neg92.7%
associate-/r*92.7%
distribute-neg-frac292.7%
neg-sub092.7%
sub-neg92.7%
+-commutative92.7%
associate--r+92.7%
neg-sub092.7%
remove-double-neg92.7%
Simplified92.7%
if -7.0000000000000003e-69 < y < 3.6999999999999999e-84Initial program 96.7%
Taylor expanded in t around inf 87.5%
Final simplification90.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 (<= t -1.1e-152)
(- 1.0 (/ (/ -1.0 (/ z x)) (- y t)))
(if (<= t 8.5e-102)
(+ 1.0 (/ x (* y (- z y))))
(- 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 (t <= -1.1e-152) {
tmp = 1.0 - ((-1.0 / (z / x)) / (y - t));
} else if (t <= 8.5e-102) {
tmp = 1.0 + (x / (y * (z - y)));
} 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 (t <= (-1.1d-152)) then
tmp = 1.0d0 - (((-1.0d0) / (z / x)) / (y - t))
else if (t <= 8.5d-102) then
tmp = 1.0d0 + (x / (y * (z - y)))
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 (t <= -1.1e-152) {
tmp = 1.0 - ((-1.0 / (z / x)) / (y - t));
} else if (t <= 8.5e-102) {
tmp = 1.0 + (x / (y * (z - y)));
} 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 t <= -1.1e-152: tmp = 1.0 - ((-1.0 / (z / x)) / (y - t)) elif t <= 8.5e-102: tmp = 1.0 + (x / (y * (z - y))) 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 (t <= -1.1e-152) tmp = Float64(1.0 - Float64(Float64(-1.0 / Float64(z / x)) / Float64(y - t))); elseif (t <= 8.5e-102) tmp = Float64(1.0 + Float64(x / Float64(y * Float64(z - y)))); else tmp = Float64(1.0 - Float64(x / Float64(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 (t <= -1.1e-152)
tmp = 1.0 - ((-1.0 / (z / x)) / (y - t));
elseif (t <= 8.5e-102)
tmp = 1.0 + (x / (y * (z - y)));
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[t, -1.1e-152], N[(1.0 - N[(N[(-1.0 / N[(z / x), $MachinePrecision]), $MachinePrecision] / N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 8.5e-102], N[(1.0 + N[(x / N[(y * N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 - N[(x / N[(t * N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.1 \cdot 10^{-152}:\\
\;\;\;\;1 - \frac{\frac{-1}{\frac{z}{x}}}{y - t}\\
\mathbf{elif}\;t \leq 8.5 \cdot 10^{-102}:\\
\;\;\;\;1 + \frac{x}{y \cdot \left(z - y\right)}\\
\mathbf{else}:\\
\;\;\;\;1 - \frac{x}{t \cdot \left(z - y\right)}\\
\end{array}
\end{array}
if t < -1.09999999999999992e-152Initial program 99.9%
Taylor expanded in z around inf 75.8%
associate-/r*74.9%
Simplified74.9%
clear-num74.9%
inv-pow74.9%
Applied egg-rr74.9%
unpow-174.9%
Simplified74.9%
if -1.09999999999999992e-152 < t < 8.49999999999999973e-102Initial program 95.9%
Taylor expanded in t around 0 93.2%
if 8.49999999999999973e-102 < t Initial program 99.9%
Taylor expanded in t around inf 95.9%
Final simplification86.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 (<= t -6e-152) (+ 1.0 (/ (/ x z) (- y t))) (if (<= t 3e-101) (+ 1.0 (/ x (* y (- z y)))) (- 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 (t <= -6e-152) {
tmp = 1.0 + ((x / z) / (y - t));
} else if (t <= 3e-101) {
tmp = 1.0 + (x / (y * (z - y)));
} 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 (t <= (-6d-152)) then
tmp = 1.0d0 + ((x / z) / (y - t))
else if (t <= 3d-101) then
tmp = 1.0d0 + (x / (y * (z - y)))
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 (t <= -6e-152) {
tmp = 1.0 + ((x / z) / (y - t));
} else if (t <= 3e-101) {
tmp = 1.0 + (x / (y * (z - y)));
} 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 t <= -6e-152: tmp = 1.0 + ((x / z) / (y - t)) elif t <= 3e-101: tmp = 1.0 + (x / (y * (z - y))) 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 (t <= -6e-152) tmp = Float64(1.0 + Float64(Float64(x / z) / Float64(y - t))); elseif (t <= 3e-101) tmp = Float64(1.0 + Float64(x / Float64(y * Float64(z - y)))); else tmp = Float64(1.0 - Float64(x / Float64(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 (t <= -6e-152)
tmp = 1.0 + ((x / z) / (y - t));
elseif (t <= 3e-101)
tmp = 1.0 + (x / (y * (z - y)));
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[t, -6e-152], N[(1.0 + N[(N[(x / z), $MachinePrecision] / N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3e-101], N[(1.0 + N[(x / N[(y * N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 - N[(x / N[(t * N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -6 \cdot 10^{-152}:\\
\;\;\;\;1 + \frac{\frac{x}{z}}{y - t}\\
\mathbf{elif}\;t \leq 3 \cdot 10^{-101}:\\
\;\;\;\;1 + \frac{x}{y \cdot \left(z - y\right)}\\
\mathbf{else}:\\
\;\;\;\;1 - \frac{x}{t \cdot \left(z - y\right)}\\
\end{array}
\end{array}
if t < -6e-152Initial program 99.9%
Taylor expanded in z around inf 75.8%
associate-/r*74.9%
Simplified74.9%
if -6e-152 < t < 3.0000000000000003e-101Initial program 95.9%
Taylor expanded in t around 0 93.2%
if 3.0000000000000003e-101 < t Initial program 99.9%
Taylor expanded in t around inf 95.9%
Final simplification86.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 -5e-75)
(+ 1.0 (/ (/ x z) (- y t)))
(if (<= z 3.5e-217)
(+ 1.0 (/ (/ x y) (- t y)))
(- 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 <= -5e-75) {
tmp = 1.0 + ((x / z) / (y - t));
} else if (z <= 3.5e-217) {
tmp = 1.0 + ((x / y) / (t - y));
} 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 <= (-5d-75)) then
tmp = 1.0d0 + ((x / z) / (y - t))
else if (z <= 3.5d-217) then
tmp = 1.0d0 + ((x / y) / (t - y))
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 <= -5e-75) {
tmp = 1.0 + ((x / z) / (y - t));
} else if (z <= 3.5e-217) {
tmp = 1.0 + ((x / y) / (t - y));
} 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 <= -5e-75: tmp = 1.0 + ((x / z) / (y - t)) elif z <= 3.5e-217: tmp = 1.0 + ((x / y) / (t - y)) 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 <= -5e-75) tmp = Float64(1.0 + Float64(Float64(x / z) / Float64(y - t))); elseif (z <= 3.5e-217) tmp = Float64(1.0 + Float64(Float64(x / y) / Float64(t - y))); else tmp = Float64(1.0 - Float64(x / Float64(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 <= -5e-75)
tmp = 1.0 + ((x / z) / (y - t));
elseif (z <= 3.5e-217)
tmp = 1.0 + ((x / y) / (t - y));
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, -5e-75], N[(1.0 + N[(N[(x / z), $MachinePrecision] / N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.5e-217], N[(1.0 + N[(N[(x / y), $MachinePrecision] / N[(t - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 - N[(x / N[(t * N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5 \cdot 10^{-75}:\\
\;\;\;\;1 + \frac{\frac{x}{z}}{y - t}\\
\mathbf{elif}\;z \leq 3.5 \cdot 10^{-217}:\\
\;\;\;\;1 + \frac{\frac{x}{y}}{t - y}\\
\mathbf{else}:\\
\;\;\;\;1 - \frac{x}{t \cdot \left(z - y\right)}\\
\end{array}
\end{array}
if z < -4.99999999999999979e-75Initial program 100.0%
Taylor expanded in z around inf 95.9%
associate-/r*95.9%
Simplified95.9%
if -4.99999999999999979e-75 < z < 3.5e-217Initial program 98.4%
Taylor expanded in z around 0 96.9%
sub-neg96.9%
associate-/r*97.0%
distribute-neg-frac297.0%
neg-sub097.0%
sub-neg97.0%
+-commutative97.0%
associate--r+97.0%
neg-sub097.0%
remove-double-neg97.0%
Simplified97.0%
if 3.5e-217 < z Initial program 98.0%
Taylor expanded in t around inf 72.7%
Final simplification87.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 (<= y -1.95e-135) 1.0 (if (<= y 2.1e-113) (- 1.0 (/ x (* t (- z y)))) 1.0)))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.95e-135) {
tmp = 1.0;
} else if (y <= 2.1e-113) {
tmp = 1.0 - (x / (t * (z - y)));
} 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.95d-135)) then
tmp = 1.0d0
else if (y <= 2.1d-113) then
tmp = 1.0d0 - (x / (t * (z - y)))
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.95e-135) {
tmp = 1.0;
} else if (y <= 2.1e-113) {
tmp = 1.0 - (x / (t * (z - y)));
} 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.95e-135: tmp = 1.0 elif y <= 2.1e-113: tmp = 1.0 - (x / (t * (z - y))) 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.95e-135) tmp = 1.0; elseif (y <= 2.1e-113) tmp = Float64(1.0 - Float64(x / Float64(t * Float64(z - y)))); 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.95e-135)
tmp = 1.0;
elseif (y <= 2.1e-113)
tmp = 1.0 - (x / (t * (z - y)));
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.95e-135], 1.0, If[LessEqual[y, 2.1e-113], N[(1.0 - N[(x / N[(t * N[(z - y), $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 -1.95 \cdot 10^{-135}:\\
\;\;\;\;1\\
\mathbf{elif}\;y \leq 2.1 \cdot 10^{-113}:\\
\;\;\;\;1 - \frac{x}{t \cdot \left(z - y\right)}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if y < -1.95000000000000011e-135 or 2.1e-113 < y Initial program 100.0%
Taylor expanded in x around 0 84.8%
if -1.95000000000000011e-135 < y < 2.1e-113Initial program 95.9%
Taylor expanded in t around inf 89.9%
Final simplification86.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 -2.6e-142) 1.0 (if (<= y 2.1e-113) (- 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 <= -2.6e-142) {
tmp = 1.0;
} else if (y <= 2.1e-113) {
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 <= (-2.6d-142)) then
tmp = 1.0d0
else if (y <= 2.1d-113) 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 <= -2.6e-142) {
tmp = 1.0;
} else if (y <= 2.1e-113) {
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 <= -2.6e-142: tmp = 1.0 elif y <= 2.1e-113: 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 <= -2.6e-142) tmp = 1.0; elseif (y <= 2.1e-113) 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 <= -2.6e-142)
tmp = 1.0;
elseif (y <= 2.1e-113)
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, -2.6e-142], 1.0, If[LessEqual[y, 2.1e-113], 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 -2.6 \cdot 10^{-142}:\\
\;\;\;\;1\\
\mathbf{elif}\;y \leq 2.1 \cdot 10^{-113}:\\
\;\;\;\;1 - \frac{\frac{x}{t}}{z}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if y < -2.6e-142 or 2.1e-113 < y Initial program 100.0%
Taylor expanded in x around 0 84.9%
if -2.6e-142 < y < 2.1e-113Initial program 95.8%
clear-num95.8%
inv-pow95.8%
associate-/l*98.3%
Applied egg-rr98.3%
unpow-198.3%
Simplified98.3%
Taylor expanded in y around 0 74.8%
associate-/r*76.0%
Simplified76.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 (<= y -2.4e-142) 1.0 (if (<= y 2.1e-113) (- 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 <= -2.4e-142) {
tmp = 1.0;
} else if (y <= 2.1e-113) {
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 <= (-2.4d-142)) then
tmp = 1.0d0
else if (y <= 2.1d-113) 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 <= -2.4e-142) {
tmp = 1.0;
} else if (y <= 2.1e-113) {
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 <= -2.4e-142: tmp = 1.0 elif y <= 2.1e-113: 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 <= -2.4e-142) tmp = 1.0; elseif (y <= 2.1e-113) 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 <= -2.4e-142)
tmp = 1.0;
elseif (y <= 2.1e-113)
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, -2.4e-142], 1.0, If[LessEqual[y, 2.1e-113], 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 -2.4 \cdot 10^{-142}:\\
\;\;\;\;1\\
\mathbf{elif}\;y \leq 2.1 \cdot 10^{-113}:\\
\;\;\;\;1 - \frac{x}{z \cdot t}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if y < -2.39999999999999988e-142 or 2.1e-113 < y Initial program 100.0%
Taylor expanded in x around 0 84.9%
if -2.39999999999999988e-142 < y < 2.1e-113Initial program 95.8%
Taylor expanded in y around 0 74.8%
Final simplification82.0%
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 98.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)
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.8%
Taylor expanded in x around 0 74.7%
herbie shell --seed 2024139
(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)))))