
(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 14 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 (if (<= z -2e+36) (+ 1.0 (/ (/ x z) (- y t))) (+ 1.0 (/ (/ x (- y t)) (- z y)))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -2e+36) {
tmp = 1.0 + ((x / z) / (y - t));
} else {
tmp = 1.0 + ((x / (y - 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 <= (-2d+36)) then
tmp = 1.0d0 + ((x / z) / (y - t))
else
tmp = 1.0d0 + ((x / (y - 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 <= -2e+36) {
tmp = 1.0 + ((x / z) / (y - t));
} else {
tmp = 1.0 + ((x / (y - t)) / (z - y));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if z <= -2e+36: tmp = 1.0 + ((x / z) / (y - t)) else: tmp = 1.0 + ((x / (y - 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 <= -2e+36) tmp = Float64(1.0 + Float64(Float64(x / z) / Float64(y - t))); else tmp = Float64(1.0 + Float64(Float64(x / Float64(y - 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 <= -2e+36)
tmp = 1.0 + ((x / z) / (y - t));
else
tmp = 1.0 + ((x / (y - 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, -2e+36], N[(1.0 + N[(N[(x / z), $MachinePrecision] / N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(N[(x / N[(y - t), $MachinePrecision]), $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 \cdot 10^{+36}:\\
\;\;\;\;1 + \frac{\frac{x}{z}}{y - t}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{\frac{x}{y - t}}{z - y}\\
\end{array}
\end{array}
if z < -2.00000000000000008e36Initial program 99.9%
sub-neg99.9%
distribute-frac-neg99.9%
*-lft-identity99.9%
associate-/r*100.0%
associate-*r/100.0%
metadata-eval100.0%
times-frac100.0%
neg-mul-1100.0%
remove-double-neg100.0%
neg-mul-1100.0%
neg-sub0100.0%
associate-+l-100.0%
neg-sub0100.0%
+-commutative100.0%
sub-neg100.0%
Simplified100.0%
Taylor expanded in z around inf 99.9%
associate-/r*100.0%
Simplified100.0%
if -2.00000000000000008e36 < z Initial program 96.0%
sub-neg96.0%
distribute-frac-neg96.0%
*-lft-identity96.0%
associate-/r*98.0%
associate-*r/98.0%
metadata-eval98.0%
times-frac98.0%
neg-mul-198.0%
remove-double-neg98.0%
neg-mul-198.0%
neg-sub098.0%
associate-+l-98.0%
neg-sub098.0%
+-commutative98.0%
sub-neg98.0%
Simplified98.0%
clear-num98.0%
inv-pow98.0%
div-inv98.0%
clear-num98.7%
Applied egg-rr98.7%
unpow-198.7%
associate-/r*98.7%
Simplified98.7%
Taylor expanded in x around 0 96.0%
associate-/r*99.4%
Simplified99.4%
Final simplification99.6%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ x (- y t))))
(if (<= z -2.3e-22)
(+ 1.0 (/ (/ x z) (- y t)))
(if (<= z -1.02e-88)
(- 1.0 (/ x (* y (- y z))))
(if (or (<= z -1.95e-125) (not (<= z 7.5e-79)))
(+ 1.0 (/ t_1 z))
(- 1.0 (/ t_1 y)))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = x / (y - t);
double tmp;
if (z <= -2.3e-22) {
tmp = 1.0 + ((x / z) / (y - t));
} else if (z <= -1.02e-88) {
tmp = 1.0 - (x / (y * (y - z)));
} else if ((z <= -1.95e-125) || !(z <= 7.5e-79)) {
tmp = 1.0 + (t_1 / z);
} else {
tmp = 1.0 - (t_1 / 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) :: t_1
real(8) :: tmp
t_1 = x / (y - t)
if (z <= (-2.3d-22)) then
tmp = 1.0d0 + ((x / z) / (y - t))
else if (z <= (-1.02d-88)) then
tmp = 1.0d0 - (x / (y * (y - z)))
else if ((z <= (-1.95d-125)) .or. (.not. (z <= 7.5d-79))) then
tmp = 1.0d0 + (t_1 / z)
else
tmp = 1.0d0 - (t_1 / 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 t_1 = x / (y - t);
double tmp;
if (z <= -2.3e-22) {
tmp = 1.0 + ((x / z) / (y - t));
} else if (z <= -1.02e-88) {
tmp = 1.0 - (x / (y * (y - z)));
} else if ((z <= -1.95e-125) || !(z <= 7.5e-79)) {
tmp = 1.0 + (t_1 / z);
} else {
tmp = 1.0 - (t_1 / y);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = x / (y - t) tmp = 0 if z <= -2.3e-22: tmp = 1.0 + ((x / z) / (y - t)) elif z <= -1.02e-88: tmp = 1.0 - (x / (y * (y - z))) elif (z <= -1.95e-125) or not (z <= 7.5e-79): tmp = 1.0 + (t_1 / z) else: tmp = 1.0 - (t_1 / y) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(x / Float64(y - t)) tmp = 0.0 if (z <= -2.3e-22) tmp = Float64(1.0 + Float64(Float64(x / z) / Float64(y - t))); elseif (z <= -1.02e-88) tmp = Float64(1.0 - Float64(x / Float64(y * Float64(y - z)))); elseif ((z <= -1.95e-125) || !(z <= 7.5e-79)) tmp = Float64(1.0 + Float64(t_1 / z)); else tmp = Float64(1.0 - Float64(t_1 / y)); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = x / (y - t);
tmp = 0.0;
if (z <= -2.3e-22)
tmp = 1.0 + ((x / z) / (y - t));
elseif (z <= -1.02e-88)
tmp = 1.0 - (x / (y * (y - z)));
elseif ((z <= -1.95e-125) || ~((z <= 7.5e-79)))
tmp = 1.0 + (t_1 / z);
else
tmp = 1.0 - (t_1 / 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_] := Block[{t$95$1 = N[(x / N[(y - t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.3e-22], N[(1.0 + N[(N[(x / z), $MachinePrecision] / N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -1.02e-88], N[(1.0 - N[(x / N[(y * N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[z, -1.95e-125], N[Not[LessEqual[z, 7.5e-79]], $MachinePrecision]], N[(1.0 + N[(t$95$1 / z), $MachinePrecision]), $MachinePrecision], N[(1.0 - N[(t$95$1 / y), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \frac{x}{y - t}\\
\mathbf{if}\;z \leq -2.3 \cdot 10^{-22}:\\
\;\;\;\;1 + \frac{\frac{x}{z}}{y - t}\\
\mathbf{elif}\;z \leq -1.02 \cdot 10^{-88}:\\
\;\;\;\;1 - \frac{x}{y \cdot \left(y - z\right)}\\
\mathbf{elif}\;z \leq -1.95 \cdot 10^{-125} \lor \neg \left(z \leq 7.5 \cdot 10^{-79}\right):\\
\;\;\;\;1 + \frac{t\_1}{z}\\
\mathbf{else}:\\
\;\;\;\;1 - \frac{t\_1}{y}\\
\end{array}
\end{array}
if z < -2.2999999999999998e-22Initial program 99.9%
sub-neg99.9%
distribute-frac-neg99.9%
*-lft-identity99.9%
associate-/r*100.0%
associate-*r/100.0%
metadata-eval100.0%
times-frac100.0%
neg-mul-1100.0%
remove-double-neg100.0%
neg-mul-1100.0%
neg-sub0100.0%
associate-+l-100.0%
neg-sub0100.0%
+-commutative100.0%
sub-neg100.0%
Simplified100.0%
Taylor expanded in z around inf 97.3%
associate-/r*97.4%
Simplified97.4%
if -2.2999999999999998e-22 < z < -1.02000000000000001e-88Initial program 100.0%
Taylor expanded in t around 0 73.8%
if -1.02000000000000001e-88 < z < -1.94999999999999991e-125 or 7.49999999999999969e-79 < z Initial program 99.9%
sub-neg99.9%
distribute-frac-neg99.9%
*-lft-identity99.9%
associate-/r*98.9%
associate-*r/98.9%
metadata-eval98.9%
times-frac98.9%
neg-mul-198.9%
remove-double-neg98.9%
neg-mul-198.9%
neg-sub098.9%
associate-+l-98.9%
neg-sub098.9%
+-commutative98.9%
sub-neg98.9%
Simplified98.9%
Taylor expanded in z around inf 99.1%
associate-/r*98.1%
Simplified98.1%
associate-/l/99.1%
div-inv99.1%
Applied egg-rr99.1%
un-div-inv99.1%
associate-/r*98.1%
Applied egg-rr98.1%
if -1.94999999999999991e-125 < z < 7.49999999999999969e-79Initial program 90.8%
Taylor expanded in z around 0 85.0%
div-inv85.0%
associate-/r*85.0%
Applied egg-rr85.0%
*-commutative85.0%
associate-*l/88.4%
associate-*r/88.4%
associate-*l/88.4%
*-lft-identity88.4%
Simplified88.4%
Final simplification93.6%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- 1.0 (/ x (* t z)))))
(if (<= z -9.5e+76)
t_1
(if (<= z -2.25e-88)
(+ 1.0 (/ x (* y z)))
(if (<= z 3.1e-80) (+ 1.0 (/ (/ x t) y)) t_1)))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = 1.0 - (x / (t * z));
double tmp;
if (z <= -9.5e+76) {
tmp = t_1;
} else if (z <= -2.25e-88) {
tmp = 1.0 + (x / (y * z));
} else if (z <= 3.1e-80) {
tmp = 1.0 + ((x / t) / y);
} else {
tmp = t_1;
}
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) :: t_1
real(8) :: tmp
t_1 = 1.0d0 - (x / (t * z))
if (z <= (-9.5d+76)) then
tmp = t_1
else if (z <= (-2.25d-88)) then
tmp = 1.0d0 + (x / (y * z))
else if (z <= 3.1d-80) then
tmp = 1.0d0 + ((x / t) / y)
else
tmp = t_1
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 t_1 = 1.0 - (x / (t * z));
double tmp;
if (z <= -9.5e+76) {
tmp = t_1;
} else if (z <= -2.25e-88) {
tmp = 1.0 + (x / (y * z));
} else if (z <= 3.1e-80) {
tmp = 1.0 + ((x / t) / y);
} else {
tmp = t_1;
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = 1.0 - (x / (t * z)) tmp = 0 if z <= -9.5e+76: tmp = t_1 elif z <= -2.25e-88: tmp = 1.0 + (x / (y * z)) elif z <= 3.1e-80: tmp = 1.0 + ((x / t) / y) else: tmp = t_1 return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(1.0 - Float64(x / Float64(t * z))) tmp = 0.0 if (z <= -9.5e+76) tmp = t_1; elseif (z <= -2.25e-88) tmp = Float64(1.0 + Float64(x / Float64(y * z))); elseif (z <= 3.1e-80) tmp = Float64(1.0 + Float64(Float64(x / t) / y)); else tmp = t_1; end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = 1.0 - (x / (t * z));
tmp = 0.0;
if (z <= -9.5e+76)
tmp = t_1;
elseif (z <= -2.25e-88)
tmp = 1.0 + (x / (y * z));
elseif (z <= 3.1e-80)
tmp = 1.0 + ((x / t) / y);
else
tmp = t_1;
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_] := Block[{t$95$1 = N[(1.0 - N[(x / N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -9.5e+76], t$95$1, If[LessEqual[z, -2.25e-88], N[(1.0 + N[(x / N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.1e-80], N[(1.0 + N[(N[(x / t), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := 1 - \frac{x}{t \cdot z}\\
\mathbf{if}\;z \leq -9.5 \cdot 10^{+76}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -2.25 \cdot 10^{-88}:\\
\;\;\;\;1 + \frac{x}{y \cdot z}\\
\mathbf{elif}\;z \leq 3.1 \cdot 10^{-80}:\\
\;\;\;\;1 + \frac{\frac{x}{t}}{y}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -9.5000000000000003e76 or 3.10000000000000016e-80 < z Initial program 100.0%
Taylor expanded in y around 0 86.2%
if -9.5000000000000003e76 < z < -2.24999999999999996e-88Initial program 99.9%
sub-neg99.9%
distribute-frac-neg99.9%
*-lft-identity99.9%
associate-/r*94.2%
associate-*r/94.2%
metadata-eval94.2%
times-frac94.2%
neg-mul-194.2%
remove-double-neg94.2%
neg-mul-194.2%
neg-sub094.2%
associate-+l-94.2%
neg-sub094.2%
+-commutative94.2%
sub-neg94.2%
Simplified94.2%
Taylor expanded in z around inf 91.4%
associate-/r*85.7%
Simplified85.7%
Taylor expanded in y around inf 59.8%
*-commutative59.8%
Simplified59.8%
if -2.24999999999999996e-88 < z < 3.10000000000000016e-80Initial program 91.2%
sub-neg91.2%
distribute-frac-neg91.2%
*-lft-identity91.2%
associate-/r*97.8%
associate-*r/97.8%
metadata-eval97.8%
times-frac97.8%
neg-mul-197.8%
remove-double-neg97.8%
neg-mul-197.8%
neg-sub097.8%
associate-+l-97.8%
neg-sub097.8%
+-commutative97.8%
sub-neg97.8%
Simplified97.8%
clear-num97.7%
inv-pow97.7%
div-inv97.7%
clear-num98.7%
Applied egg-rr98.7%
unpow-198.7%
associate-/r*98.7%
Simplified98.7%
Taylor expanded in x around 0 91.2%
associate-/r*99.9%
Simplified99.9%
Taylor expanded in t around inf 71.8%
mul-1-neg71.8%
associate-/r*75.1%
distribute-neg-frac75.1%
distribute-neg-frac75.1%
Simplified75.1%
Taylor expanded in z around 0 64.9%
associate-/r*65.1%
Simplified65.1%
Final simplification75.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 (<= t -1.25e-275)
(+ 1.0 (/ (/ x z) (- y t)))
(if (<= t 2.5e-120)
(+ 1.0 (/ (/ 1.0 y) (/ (- z y) x)))
(- 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.25e-275) {
tmp = 1.0 + ((x / z) / (y - t));
} else if (t <= 2.5e-120) {
tmp = 1.0 + ((1.0 / y) / ((z - y) / x));
} 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.25d-275)) then
tmp = 1.0d0 + ((x / z) / (y - t))
else if (t <= 2.5d-120) then
tmp = 1.0d0 + ((1.0d0 / y) / ((z - y) / x))
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.25e-275) {
tmp = 1.0 + ((x / z) / (y - t));
} else if (t <= 2.5e-120) {
tmp = 1.0 + ((1.0 / y) / ((z - y) / x));
} 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.25e-275: tmp = 1.0 + ((x / z) / (y - t)) elif t <= 2.5e-120: tmp = 1.0 + ((1.0 / y) / ((z - y) / x)) 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.25e-275) tmp = Float64(1.0 + Float64(Float64(x / z) / Float64(y - t))); elseif (t <= 2.5e-120) tmp = Float64(1.0 + Float64(Float64(1.0 / y) / Float64(Float64(z - y) / x))); 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 (t <= -1.25e-275)
tmp = 1.0 + ((x / z) / (y - t));
elseif (t <= 2.5e-120)
tmp = 1.0 + ((1.0 / y) / ((z - y) / x));
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.25e-275], N[(1.0 + N[(N[(x / z), $MachinePrecision] / N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.5e-120], N[(1.0 + N[(N[(1.0 / y), $MachinePrecision] / N[(N[(z - y), $MachinePrecision] / x), $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}\;t \leq -1.25 \cdot 10^{-275}:\\
\;\;\;\;1 + \frac{\frac{x}{z}}{y - t}\\
\mathbf{elif}\;t \leq 2.5 \cdot 10^{-120}:\\
\;\;\;\;1 + \frac{\frac{1}{y}}{\frac{z - y}{x}}\\
\mathbf{else}:\\
\;\;\;\;1 - \frac{\frac{x}{t}}{z - y}\\
\end{array}
\end{array}
if t < -1.24999999999999996e-275Initial program 98.3%
sub-neg98.3%
distribute-frac-neg98.3%
*-lft-identity98.3%
associate-/r*97.7%
associate-*r/97.7%
metadata-eval97.7%
times-frac97.7%
neg-mul-197.7%
remove-double-neg97.7%
neg-mul-197.7%
neg-sub097.7%
associate-+l-97.7%
neg-sub097.7%
+-commutative97.7%
sub-neg97.7%
Simplified97.7%
Taylor expanded in z around inf 80.6%
associate-/r*79.4%
Simplified79.4%
if -1.24999999999999996e-275 < t < 2.50000000000000003e-120Initial program 86.1%
sub-neg86.1%
distribute-frac-neg86.1%
*-lft-identity86.1%
associate-/r*100.0%
associate-*r/100.0%
metadata-eval100.0%
times-frac100.0%
neg-mul-1100.0%
remove-double-neg100.0%
neg-mul-1100.0%
neg-sub0100.0%
associate-+l-100.0%
neg-sub0100.0%
+-commutative100.0%
sub-neg100.0%
Simplified100.0%
clear-num99.9%
inv-pow99.9%
div-inv99.9%
clear-num99.9%
Applied egg-rr99.9%
unpow-199.9%
associate-/r*99.8%
Simplified99.8%
Taylor expanded in y around inf 94.3%
if 2.50000000000000003e-120 < t Initial program 99.9%
sub-neg99.9%
distribute-frac-neg99.9%
*-lft-identity99.9%
associate-/r*98.9%
associate-*r/98.9%
metadata-eval98.9%
times-frac98.9%
neg-mul-198.9%
remove-double-neg98.9%
neg-mul-198.9%
neg-sub098.9%
associate-+l-98.9%
neg-sub098.9%
+-commutative98.9%
sub-neg98.9%
Simplified98.9%
clear-num98.8%
inv-pow98.8%
div-inv98.8%
clear-num99.8%
Applied egg-rr99.8%
unpow-199.8%
associate-/r*99.8%
Simplified99.8%
Taylor expanded in t around inf 94.4%
mul-1-neg94.4%
associate-/r*94.4%
Simplified94.4%
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 (or (<= y -3.4e+16) (not (<= y 3.4e-8))) (- 1.0 (/ (/ x y) y)) (+ 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 ((y <= -3.4e+16) || !(y <= 3.4e-8)) {
tmp = 1.0 - ((x / y) / y);
} 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 ((y <= (-3.4d+16)) .or. (.not. (y <= 3.4d-8))) then
tmp = 1.0d0 - ((x / y) / y)
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 ((y <= -3.4e+16) || !(y <= 3.4e-8)) {
tmp = 1.0 - ((x / y) / y);
} 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 (y <= -3.4e+16) or not (y <= 3.4e-8): tmp = 1.0 - ((x / y) / y) 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 ((y <= -3.4e+16) || !(y <= 3.4e-8)) tmp = Float64(1.0 - Float64(Float64(x / y) / y)); else tmp = Float64(1.0 + Float64(Float64(x / z) / 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 ((y <= -3.4e+16) || ~((y <= 3.4e-8)))
tmp = 1.0 - ((x / y) / y);
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[Or[LessEqual[y, -3.4e+16], N[Not[LessEqual[y, 3.4e-8]], $MachinePrecision]], N[(1.0 - N[(N[(x / y), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(N[(x / z), $MachinePrecision] / N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.4 \cdot 10^{+16} \lor \neg \left(y \leq 3.4 \cdot 10^{-8}\right):\\
\;\;\;\;1 - \frac{\frac{x}{y}}{y}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{\frac{x}{z}}{y - t}\\
\end{array}
\end{array}
if y < -3.4e16 or 3.4e-8 < y Initial program 100.0%
Taylor expanded in z around 0 98.2%
div-inv98.2%
associate-/r*98.2%
Applied egg-rr98.2%
*-commutative98.2%
associate-*l/98.2%
associate-*r/98.2%
associate-*l/98.2%
*-lft-identity98.2%
Simplified98.2%
Taylor expanded in y around inf 94.6%
if -3.4e16 < y < 3.4e-8Initial program 93.7%
sub-neg93.7%
distribute-frac-neg93.7%
*-lft-identity93.7%
associate-/r*96.9%
associate-*r/96.9%
metadata-eval96.9%
times-frac96.9%
neg-mul-196.9%
remove-double-neg96.9%
neg-mul-196.9%
neg-sub096.9%
associate-+l-96.9%
neg-sub096.9%
+-commutative96.9%
sub-neg96.9%
Simplified96.9%
Taylor expanded in z around inf 81.6%
associate-/r*82.0%
Simplified82.0%
Final simplification88.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 (or (<= y -3.5e-28) (not (<= y 1.6e-63))) (- 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 ((y <= -3.5e-28) || !(y <= 1.6e-63)) {
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 ((y <= (-3.5d-28)) .or. (.not. (y <= 1.6d-63))) 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 ((y <= -3.5e-28) || !(y <= 1.6e-63)) {
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 (y <= -3.5e-28) or not (y <= 1.6e-63): 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 ((y <= -3.5e-28) || !(y <= 1.6e-63)) tmp = Float64(1.0 - Float64(x / Float64(y * Float64(y - t)))); else tmp = Float64(1.0 + Float64(Float64(x / z) / 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 ((y <= -3.5e-28) || ~((y <= 1.6e-63)))
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[Or[LessEqual[y, -3.5e-28], N[Not[LessEqual[y, 1.6e-63]], $MachinePrecision]], N[(1.0 - N[(x / N[(y * N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(N[(x / z), $MachinePrecision] / N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.5 \cdot 10^{-28} \lor \neg \left(y \leq 1.6 \cdot 10^{-63}\right):\\
\;\;\;\;1 - \frac{x}{y \cdot \left(y - t\right)}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{\frac{x}{z}}{y - t}\\
\end{array}
\end{array}
if y < -3.5e-28 or 1.59999999999999994e-63 < y Initial program 100.0%
Taylor expanded in z around 0 94.9%
if -3.5e-28 < y < 1.59999999999999994e-63Initial program 92.6%
sub-neg92.6%
distribute-frac-neg92.6%
*-lft-identity92.6%
associate-/r*96.4%
associate-*r/96.4%
metadata-eval96.4%
times-frac96.4%
neg-mul-196.4%
remove-double-neg96.4%
neg-mul-196.4%
neg-sub096.4%
associate-+l-96.4%
neg-sub096.4%
+-commutative96.4%
sub-neg96.4%
Simplified96.4%
Taylor expanded in z around inf 83.6%
associate-/r*84.1%
Simplified84.1%
Final simplification90.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.8e-81)
(- 1.0 (/ x (* y (- y z))))
(if (<= y 2.7e-62)
(+ 1.0 (/ (/ x z) (- y t)))
(- 1.0 (/ x (* y (- y t)))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -6.8e-81) {
tmp = 1.0 - (x / (y * (y - z)));
} else if (y <= 2.7e-62) {
tmp = 1.0 + ((x / z) / (y - t));
} else {
tmp = 1.0 - (x / (y * (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 (y <= (-6.8d-81)) then
tmp = 1.0d0 - (x / (y * (y - z)))
else if (y <= 2.7d-62) then
tmp = 1.0d0 + ((x / z) / (y - t))
else
tmp = 1.0d0 - (x / (y * (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 (y <= -6.8e-81) {
tmp = 1.0 - (x / (y * (y - z)));
} else if (y <= 2.7e-62) {
tmp = 1.0 + ((x / z) / (y - t));
} else {
tmp = 1.0 - (x / (y * (y - t)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if y <= -6.8e-81: tmp = 1.0 - (x / (y * (y - z))) elif y <= 2.7e-62: tmp = 1.0 + ((x / z) / (y - t)) else: tmp = 1.0 - (x / (y * (y - t))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (y <= -6.8e-81) tmp = Float64(1.0 - Float64(x / Float64(y * Float64(y - z)))); elseif (y <= 2.7e-62) tmp = Float64(1.0 + Float64(Float64(x / z) / Float64(y - t))); else tmp = Float64(1.0 - Float64(x / Float64(y * 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 (y <= -6.8e-81)
tmp = 1.0 - (x / (y * (y - z)));
elseif (y <= 2.7e-62)
tmp = 1.0 + ((x / z) / (y - t));
else
tmp = 1.0 - (x / (y * (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[y, -6.8e-81], N[(1.0 - N[(x / N[(y * N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.7e-62], N[(1.0 + N[(N[(x / z), $MachinePrecision] / N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 - N[(x / N[(y * N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -6.8 \cdot 10^{-81}:\\
\;\;\;\;1 - \frac{x}{y \cdot \left(y - z\right)}\\
\mathbf{elif}\;y \leq 2.7 \cdot 10^{-62}:\\
\;\;\;\;1 + \frac{\frac{x}{z}}{y - t}\\
\mathbf{else}:\\
\;\;\;\;1 - \frac{x}{y \cdot \left(y - t\right)}\\
\end{array}
\end{array}
if y < -6.7999999999999997e-81Initial program 100.0%
Taylor expanded in t around 0 96.3%
if -6.7999999999999997e-81 < y < 2.70000000000000019e-62Initial program 91.7%
sub-neg91.7%
distribute-frac-neg91.7%
*-lft-identity91.7%
associate-/r*95.9%
associate-*r/95.9%
metadata-eval95.9%
times-frac95.9%
neg-mul-195.9%
remove-double-neg95.9%
neg-mul-195.9%
neg-sub095.9%
associate-+l-95.9%
neg-sub095.9%
+-commutative95.9%
sub-neg95.9%
Simplified95.9%
Taylor expanded in z around inf 84.6%
associate-/r*85.1%
Simplified85.1%
if 2.70000000000000019e-62 < y Initial program 100.0%
Taylor expanded in z around 0 94.4%
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 (<= t -1.35e-272)
(+ 1.0 (/ (/ x z) (- y t)))
(if (<= t 1.25e-116)
(- 1.0 (/ x (* y (- y z))))
(- 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.35e-272) {
tmp = 1.0 + ((x / z) / (y - t));
} else if (t <= 1.25e-116) {
tmp = 1.0 - (x / (y * (y - z)));
} 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.35d-272)) then
tmp = 1.0d0 + ((x / z) / (y - t))
else if (t <= 1.25d-116) then
tmp = 1.0d0 - (x / (y * (y - z)))
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.35e-272) {
tmp = 1.0 + ((x / z) / (y - t));
} else if (t <= 1.25e-116) {
tmp = 1.0 - (x / (y * (y - z)));
} 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.35e-272: tmp = 1.0 + ((x / z) / (y - t)) elif t <= 1.25e-116: tmp = 1.0 - (x / (y * (y - z))) 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.35e-272) tmp = Float64(1.0 + Float64(Float64(x / z) / Float64(y - t))); elseif (t <= 1.25e-116) tmp = Float64(1.0 - Float64(x / Float64(y * Float64(y - z)))); 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 (t <= -1.35e-272)
tmp = 1.0 + ((x / z) / (y - t));
elseif (t <= 1.25e-116)
tmp = 1.0 - (x / (y * (y - z)));
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.35e-272], N[(1.0 + N[(N[(x / z), $MachinePrecision] / N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.25e-116], N[(1.0 - N[(x / N[(y * N[(y - z), $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}\;t \leq -1.35 \cdot 10^{-272}:\\
\;\;\;\;1 + \frac{\frac{x}{z}}{y - t}\\
\mathbf{elif}\;t \leq 1.25 \cdot 10^{-116}:\\
\;\;\;\;1 - \frac{x}{y \cdot \left(y - z\right)}\\
\mathbf{else}:\\
\;\;\;\;1 - \frac{\frac{x}{t}}{z - y}\\
\end{array}
\end{array}
if t < -1.34999999999999996e-272Initial program 98.2%
sub-neg98.2%
distribute-frac-neg98.2%
*-lft-identity98.2%
associate-/r*97.7%
associate-*r/97.7%
metadata-eval97.7%
times-frac97.7%
neg-mul-197.7%
remove-double-neg97.7%
neg-mul-197.7%
neg-sub097.7%
associate-+l-97.7%
neg-sub097.7%
+-commutative97.7%
sub-neg97.7%
Simplified97.7%
Taylor expanded in z around inf 81.2%
associate-/r*80.0%
Simplified80.0%
if -1.34999999999999996e-272 < t < 1.2500000000000001e-116Initial program 86.5%
Taylor expanded in t around 0 84.3%
if 1.2500000000000001e-116 < t Initial program 99.9%
sub-neg99.9%
distribute-frac-neg99.9%
*-lft-identity99.9%
associate-/r*98.9%
associate-*r/98.9%
metadata-eval98.9%
times-frac98.9%
neg-mul-198.9%
remove-double-neg98.9%
neg-mul-198.9%
neg-sub098.9%
associate-+l-98.9%
neg-sub098.9%
+-commutative98.9%
sub-neg98.9%
Simplified98.9%
clear-num98.8%
inv-pow98.8%
div-inv98.8%
clear-num99.8%
Applied egg-rr99.8%
unpow-199.8%
associate-/r*99.8%
Simplified99.8%
Taylor expanded in t around inf 94.4%
mul-1-neg94.4%
associate-/r*94.4%
Simplified94.4%
Final simplification85.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 (or (<= y -11800.0) (not (<= y 1.68e-9))) (- 1.0 (/ (/ x y) y)) (- 1.0 (/ x (* t z)))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -11800.0) || !(y <= 1.68e-9)) {
tmp = 1.0 - ((x / y) / y);
} else {
tmp = 1.0 - (x / (t * 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 <= (-11800.0d0)) .or. (.not. (y <= 1.68d-9))) then
tmp = 1.0d0 - ((x / y) / y)
else
tmp = 1.0d0 - (x / (t * 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 <= -11800.0) || !(y <= 1.68e-9)) {
tmp = 1.0 - ((x / y) / y);
} else {
tmp = 1.0 - (x / (t * z));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if (y <= -11800.0) or not (y <= 1.68e-9): tmp = 1.0 - ((x / y) / y) else: tmp = 1.0 - (x / (t * z)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if ((y <= -11800.0) || !(y <= 1.68e-9)) tmp = Float64(1.0 - Float64(Float64(x / y) / y)); else tmp = Float64(1.0 - Float64(x / Float64(t * 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 <= -11800.0) || ~((y <= 1.68e-9)))
tmp = 1.0 - ((x / y) / y);
else
tmp = 1.0 - (x / (t * 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, -11800.0], N[Not[LessEqual[y, 1.68e-9]], $MachinePrecision]], N[(1.0 - N[(N[(x / y), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], N[(1.0 - N[(x / N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -11800 \lor \neg \left(y \leq 1.68 \cdot 10^{-9}\right):\\
\;\;\;\;1 - \frac{\frac{x}{y}}{y}\\
\mathbf{else}:\\
\;\;\;\;1 - \frac{x}{t \cdot z}\\
\end{array}
\end{array}
if y < -11800 or 1.68e-9 < y Initial program 100.0%
Taylor expanded in z around 0 97.9%
div-inv97.9%
associate-/r*97.9%
Applied egg-rr97.9%
*-commutative97.9%
associate-*l/97.8%
associate-*r/97.9%
associate-*l/97.9%
*-lft-identity97.9%
Simplified97.9%
Taylor expanded in y around inf 94.4%
if -11800 < y < 1.68e-9Initial program 93.6%
Taylor expanded in y around 0 72.0%
Final simplification83.6%
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.7e-7) (not (<= y 9e-10))) (- 1.0 (/ (/ x y) y)) (- 1.0 (/ (/ x z) t))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -2.7e-7) || !(y <= 9e-10)) {
tmp = 1.0 - ((x / y) / y);
} else {
tmp = 1.0 - ((x / 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 ((y <= (-2.7d-7)) .or. (.not. (y <= 9d-10))) then
tmp = 1.0d0 - ((x / y) / y)
else
tmp = 1.0d0 - ((x / 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 ((y <= -2.7e-7) || !(y <= 9e-10)) {
tmp = 1.0 - ((x / y) / y);
} else {
tmp = 1.0 - ((x / z) / t);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if (y <= -2.7e-7) or not (y <= 9e-10): tmp = 1.0 - ((x / y) / y) else: tmp = 1.0 - ((x / z) / t) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if ((y <= -2.7e-7) || !(y <= 9e-10)) tmp = Float64(1.0 - Float64(Float64(x / y) / y)); else tmp = Float64(1.0 - Float64(Float64(x / 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 ((y <= -2.7e-7) || ~((y <= 9e-10)))
tmp = 1.0 - ((x / y) / y);
else
tmp = 1.0 - ((x / 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[Or[LessEqual[y, -2.7e-7], N[Not[LessEqual[y, 9e-10]], $MachinePrecision]], N[(1.0 - N[(N[(x / y), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], N[(1.0 - N[(N[(x / z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.7 \cdot 10^{-7} \lor \neg \left(y \leq 9 \cdot 10^{-10}\right):\\
\;\;\;\;1 - \frac{\frac{x}{y}}{y}\\
\mathbf{else}:\\
\;\;\;\;1 - \frac{\frac{x}{z}}{t}\\
\end{array}
\end{array}
if y < -2.70000000000000009e-7 or 8.9999999999999999e-10 < y Initial program 100.0%
Taylor expanded in z around 0 97.2%
div-inv97.1%
associate-/r*97.1%
Applied egg-rr97.1%
*-commutative97.1%
associate-*l/97.1%
associate-*r/97.1%
associate-*l/97.1%
*-lft-identity97.1%
Simplified97.1%
Taylor expanded in y around inf 93.7%
if -2.70000000000000009e-7 < y < 8.9999999999999999e-10Initial program 93.5%
sub-neg93.5%
distribute-frac-neg93.5%
*-lft-identity93.5%
associate-/r*96.8%
associate-*r/96.8%
metadata-eval96.8%
times-frac96.8%
neg-mul-196.8%
remove-double-neg96.8%
neg-mul-196.8%
neg-sub096.8%
associate-+l-96.8%
neg-sub096.8%
+-commutative96.8%
sub-neg96.8%
Simplified96.8%
clear-num96.8%
inv-pow96.8%
div-inv96.7%
clear-num97.8%
Applied egg-rr97.8%
unpow-197.8%
associate-/r*97.8%
Simplified97.8%
Taylor expanded in x around 0 93.5%
associate-/r*96.8%
Simplified96.8%
Taylor expanded in t around inf 81.0%
mul-1-neg81.0%
associate-/r*81.1%
distribute-neg-frac81.1%
distribute-neg-frac81.1%
Simplified81.1%
Taylor expanded in z around inf 72.6%
associate-*r/72.6%
*-commutative72.6%
associate-/r*71.4%
neg-mul-171.4%
Simplified71.4%
Final simplification83.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 (/ (/ 1.0 (- y t)) (/ (- z 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 - t)) / ((z - 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 - t)) / ((z - 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 - t)) / ((z - y) / x));
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): return 1.0 + ((1.0 / (y - t)) / ((z - 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 - t)) / Float64(Float64(z - 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 - t)) / ((z - 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 - t), $MachinePrecision]), $MachinePrecision] / N[(N[(z - y), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
1 + \frac{\frac{1}{y - t}}{\frac{z - y}{x}}
\end{array}
Initial program 96.9%
sub-neg96.9%
distribute-frac-neg96.9%
*-lft-identity96.9%
associate-/r*98.5%
associate-*r/98.5%
metadata-eval98.5%
times-frac98.5%
neg-mul-198.5%
remove-double-neg98.5%
neg-mul-198.5%
neg-sub098.5%
associate-+l-98.5%
neg-sub098.5%
+-commutative98.5%
sub-neg98.5%
Simplified98.5%
clear-num98.4%
inv-pow98.4%
div-inv98.4%
clear-num98.9%
Applied egg-rr98.9%
unpow-198.9%
associate-/r*98.9%
Simplified98.9%
Final simplification98.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 9.5e-82) (+ 1.0 (/ x (* y z))) (+ 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 (t <= 9.5e-82) {
tmp = 1.0 + (x / (y * z));
} 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 (t <= 9.5d-82) then
tmp = 1.0d0 + (x / (y * z))
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 (t <= 9.5e-82) {
tmp = 1.0 + (x / (y * z));
} 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 t <= 9.5e-82: tmp = 1.0 + (x / (y * z)) 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 (t <= 9.5e-82) tmp = Float64(1.0 + Float64(x / Float64(y * z))); 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 (t <= 9.5e-82)
tmp = 1.0 + (x / (y * z));
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[t, 9.5e-82], N[(1.0 + N[(x / N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 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}\;t \leq 9.5 \cdot 10^{-82}:\\
\;\;\;\;1 + \frac{x}{y \cdot z}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{x}{y \cdot t}\\
\end{array}
\end{array}
if t < 9.4999999999999996e-82Initial program 95.5%
sub-neg95.5%
distribute-frac-neg95.5%
*-lft-identity95.5%
associate-/r*98.3%
associate-*r/98.3%
metadata-eval98.3%
times-frac98.3%
neg-mul-198.3%
remove-double-neg98.3%
neg-mul-198.3%
neg-sub098.3%
associate-+l-98.3%
neg-sub098.3%
+-commutative98.3%
sub-neg98.3%
Simplified98.3%
Taylor expanded in z around inf 78.0%
associate-/r*78.8%
Simplified78.8%
Taylor expanded in y around inf 59.6%
*-commutative59.6%
Simplified59.6%
if 9.4999999999999996e-82 < t Initial program 99.9%
sub-neg99.9%
distribute-frac-neg99.9%
*-lft-identity99.9%
associate-/r*98.7%
associate-*r/98.7%
metadata-eval98.7%
times-frac98.7%
neg-mul-198.7%
remove-double-neg98.7%
neg-mul-198.7%
neg-sub098.7%
associate-+l-98.7%
neg-sub098.7%
+-commutative98.7%
sub-neg98.7%
Simplified98.7%
clear-num98.7%
inv-pow98.7%
div-inv98.7%
clear-num99.8%
Applied egg-rr99.8%
unpow-199.8%
associate-/r*99.8%
Simplified99.8%
Taylor expanded in x around 0 99.9%
associate-/r*99.9%
Simplified99.9%
Taylor expanded in t around inf 98.7%
mul-1-neg98.7%
associate-/r*98.7%
distribute-neg-frac98.7%
distribute-neg-frac98.7%
Simplified98.7%
Taylor expanded in z around 0 74.3%
Final simplification64.1%
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 96.9%
sub-neg96.9%
distribute-frac-neg96.9%
*-lft-identity96.9%
associate-/r*98.5%
associate-*r/98.5%
metadata-eval98.5%
times-frac98.5%
neg-mul-198.5%
remove-double-neg98.5%
neg-mul-198.5%
neg-sub098.5%
associate-+l-98.5%
neg-sub098.5%
+-commutative98.5%
sub-neg98.5%
Simplified98.5%
Final simplification98.5%
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 t))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
return 1.0 + (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 + (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 + (x / (y * t));
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): return 1.0 + (x / (y * t))
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) return Float64(1.0 + 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 + (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[(x / N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
1 + \frac{x}{y \cdot t}
\end{array}
Initial program 96.9%
sub-neg96.9%
distribute-frac-neg96.9%
*-lft-identity96.9%
associate-/r*98.5%
associate-*r/98.5%
metadata-eval98.5%
times-frac98.5%
neg-mul-198.5%
remove-double-neg98.5%
neg-mul-198.5%
neg-sub098.5%
associate-+l-98.5%
neg-sub098.5%
+-commutative98.5%
sub-neg98.5%
Simplified98.5%
clear-num98.4%
inv-pow98.4%
div-inv98.4%
clear-num98.9%
Applied egg-rr98.9%
unpow-198.9%
associate-/r*98.9%
Simplified98.9%
Taylor expanded in x around 0 96.9%
associate-/r*98.5%
Simplified98.5%
Taylor expanded in t around inf 80.2%
mul-1-neg80.2%
associate-/r*80.2%
distribute-neg-frac80.2%
distribute-neg-frac80.2%
Simplified80.2%
Taylor expanded in z around 0 57.6%
Final simplification57.6%
herbie shell --seed 2024036
(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)))))