
(FPCore (x y z t) :precision binary64 (/ x (* (- y z) (- t z))))
double code(double x, double y, double z, double t) {
return x / ((y - z) * (t - z));
}
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 = x / ((y - z) * (t - z))
end function
public static double code(double x, double y, double z, double t) {
return x / ((y - z) * (t - z));
}
def code(x, y, z, t): return x / ((y - z) * (t - z))
function code(x, y, z, t) return Float64(x / Float64(Float64(y - z) * Float64(t - z))) end
function tmp = code(x, y, z, t) tmp = x / ((y - z) * (t - z)); end
code[x_, y_, z_, t_] := N[(x / N[(N[(y - z), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{\left(y - z\right) \cdot \left(t - z\right)}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 11 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (/ x (* (- y z) (- t z))))
double code(double x, double y, double z, double t) {
return x / ((y - z) * (t - z));
}
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 = x / ((y - z) * (t - z))
end function
public static double code(double x, double y, double z, double t) {
return x / ((y - z) * (t - z));
}
def code(x, y, z, t): return x / ((y - z) * (t - z))
function code(x, y, z, t) return Float64(x / Float64(Float64(y - z) * Float64(t - z))) end
function tmp = code(x, y, z, t) tmp = x / ((y - z) * (t - z)); end
code[x_, y_, z_, t_] := N[(x / N[(N[(y - z), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{\left(y - z\right) \cdot \left(t - z\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 (/ (/ x (- t z)) (- y z)))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
return (x / (t - z)) / (y - z);
}
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 = (x / (t - z)) / (y - z)
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
return (x / (t - z)) / (y - z);
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): return (x / (t - z)) / (y - z)
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) return Float64(Float64(x / Float64(t - z)) / Float64(y - z)) end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
tmp = (x / (t - z)) / (y - z);
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := N[(N[(x / N[(t - z), $MachinePrecision]), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\frac{\frac{x}{t - z}}{y - z}
\end{array}
Initial program 87.6%
associate-/l/98.0%
Simplified98.0%
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 z) z)) (t_2 (/ x (* z (- z y)))))
(if (<= z -5.6e+159)
t_1
(if (<= z -1.95e-59)
t_2
(if (<= z 1.95e-41) (/ (/ x t) (- y z)) (if (<= z 8e+143) t_2 t_1))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = (x / z) / z;
double t_2 = x / (z * (z - y));
double tmp;
if (z <= -5.6e+159) {
tmp = t_1;
} else if (z <= -1.95e-59) {
tmp = t_2;
} else if (z <= 1.95e-41) {
tmp = (x / t) / (y - z);
} else if (z <= 8e+143) {
tmp = t_2;
} 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) :: t_2
real(8) :: tmp
t_1 = (x / z) / z
t_2 = x / (z * (z - y))
if (z <= (-5.6d+159)) then
tmp = t_1
else if (z <= (-1.95d-59)) then
tmp = t_2
else if (z <= 1.95d-41) then
tmp = (x / t) / (y - z)
else if (z <= 8d+143) then
tmp = t_2
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 = (x / z) / z;
double t_2 = x / (z * (z - y));
double tmp;
if (z <= -5.6e+159) {
tmp = t_1;
} else if (z <= -1.95e-59) {
tmp = t_2;
} else if (z <= 1.95e-41) {
tmp = (x / t) / (y - z);
} else if (z <= 8e+143) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = (x / z) / z t_2 = x / (z * (z - y)) tmp = 0 if z <= -5.6e+159: tmp = t_1 elif z <= -1.95e-59: tmp = t_2 elif z <= 1.95e-41: tmp = (x / t) / (y - z) elif z <= 8e+143: tmp = t_2 else: tmp = t_1 return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(Float64(x / z) / z) t_2 = Float64(x / Float64(z * Float64(z - y))) tmp = 0.0 if (z <= -5.6e+159) tmp = t_1; elseif (z <= -1.95e-59) tmp = t_2; elseif (z <= 1.95e-41) tmp = Float64(Float64(x / t) / Float64(y - z)); elseif (z <= 8e+143) tmp = t_2; 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 = (x / z) / z;
t_2 = x / (z * (z - y));
tmp = 0.0;
if (z <= -5.6e+159)
tmp = t_1;
elseif (z <= -1.95e-59)
tmp = t_2;
elseif (z <= 1.95e-41)
tmp = (x / t) / (y - z);
elseif (z <= 8e+143)
tmp = t_2;
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[(N[(x / z), $MachinePrecision] / z), $MachinePrecision]}, Block[{t$95$2 = N[(x / N[(z * N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -5.6e+159], t$95$1, If[LessEqual[z, -1.95e-59], t$95$2, If[LessEqual[z, 1.95e-41], N[(N[(x / t), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 8e+143], t$95$2, t$95$1]]]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \frac{\frac{x}{z}}{z}\\
t_2 := \frac{x}{z \cdot \left(z - y\right)}\\
\mathbf{if}\;z \leq -5.6 \cdot 10^{+159}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -1.95 \cdot 10^{-59}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq 1.95 \cdot 10^{-41}:\\
\;\;\;\;\frac{\frac{x}{t}}{y - z}\\
\mathbf{elif}\;z \leq 8 \cdot 10^{+143}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -5.6000000000000002e159 or 8.0000000000000002e143 < z Initial program 71.2%
Taylor expanded in t around 0 71.2%
mul-1-neg71.2%
associate-/r*97.3%
distribute-neg-frac297.3%
neg-sub097.3%
sub-neg97.3%
+-commutative97.3%
associate--r+97.3%
neg-sub097.3%
remove-double-neg97.3%
Simplified97.3%
Taylor expanded in z around inf 91.7%
if -5.6000000000000002e159 < z < -1.95000000000000009e-59 or 1.94999999999999995e-41 < z < 8.0000000000000002e143Initial program 94.3%
Taylor expanded in t around 0 76.5%
mul-1-neg76.5%
distribute-rgt-neg-in76.5%
neg-sub076.5%
sub-neg76.5%
+-commutative76.5%
associate--r+76.5%
neg-sub076.5%
remove-double-neg76.5%
Simplified76.5%
if -1.95000000000000009e-59 < z < 1.94999999999999995e-41Initial program 92.5%
associate-/l/95.4%
Simplified95.4%
Taylor expanded in t around inf 80.8%
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 z) z)) (t_2 (/ x (* z (- z y)))))
(if (<= z -5.5e+159)
t_1
(if (<= z -2.45e-59)
t_2
(if (<= z 8e-44) (/ x (* t (- y z))) (if (<= z 8e+143) t_2 t_1))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = (x / z) / z;
double t_2 = x / (z * (z - y));
double tmp;
if (z <= -5.5e+159) {
tmp = t_1;
} else if (z <= -2.45e-59) {
tmp = t_2;
} else if (z <= 8e-44) {
tmp = x / (t * (y - z));
} else if (z <= 8e+143) {
tmp = t_2;
} 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) :: t_2
real(8) :: tmp
t_1 = (x / z) / z
t_2 = x / (z * (z - y))
if (z <= (-5.5d+159)) then
tmp = t_1
else if (z <= (-2.45d-59)) then
tmp = t_2
else if (z <= 8d-44) then
tmp = x / (t * (y - z))
else if (z <= 8d+143) then
tmp = t_2
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 = (x / z) / z;
double t_2 = x / (z * (z - y));
double tmp;
if (z <= -5.5e+159) {
tmp = t_1;
} else if (z <= -2.45e-59) {
tmp = t_2;
} else if (z <= 8e-44) {
tmp = x / (t * (y - z));
} else if (z <= 8e+143) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = (x / z) / z t_2 = x / (z * (z - y)) tmp = 0 if z <= -5.5e+159: tmp = t_1 elif z <= -2.45e-59: tmp = t_2 elif z <= 8e-44: tmp = x / (t * (y - z)) elif z <= 8e+143: tmp = t_2 else: tmp = t_1 return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(Float64(x / z) / z) t_2 = Float64(x / Float64(z * Float64(z - y))) tmp = 0.0 if (z <= -5.5e+159) tmp = t_1; elseif (z <= -2.45e-59) tmp = t_2; elseif (z <= 8e-44) tmp = Float64(x / Float64(t * Float64(y - z))); elseif (z <= 8e+143) tmp = t_2; 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 = (x / z) / z;
t_2 = x / (z * (z - y));
tmp = 0.0;
if (z <= -5.5e+159)
tmp = t_1;
elseif (z <= -2.45e-59)
tmp = t_2;
elseif (z <= 8e-44)
tmp = x / (t * (y - z));
elseif (z <= 8e+143)
tmp = t_2;
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[(N[(x / z), $MachinePrecision] / z), $MachinePrecision]}, Block[{t$95$2 = N[(x / N[(z * N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -5.5e+159], t$95$1, If[LessEqual[z, -2.45e-59], t$95$2, If[LessEqual[z, 8e-44], N[(x / N[(t * N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 8e+143], t$95$2, t$95$1]]]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \frac{\frac{x}{z}}{z}\\
t_2 := \frac{x}{z \cdot \left(z - y\right)}\\
\mathbf{if}\;z \leq -5.5 \cdot 10^{+159}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -2.45 \cdot 10^{-59}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq 8 \cdot 10^{-44}:\\
\;\;\;\;\frac{x}{t \cdot \left(y - z\right)}\\
\mathbf{elif}\;z \leq 8 \cdot 10^{+143}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -5.4999999999999998e159 or 8.0000000000000002e143 < z Initial program 71.2%
Taylor expanded in t around 0 71.2%
mul-1-neg71.2%
associate-/r*97.3%
distribute-neg-frac297.3%
neg-sub097.3%
sub-neg97.3%
+-commutative97.3%
associate--r+97.3%
neg-sub097.3%
remove-double-neg97.3%
Simplified97.3%
Taylor expanded in z around inf 91.7%
if -5.4999999999999998e159 < z < -2.44999999999999989e-59 or 7.99999999999999962e-44 < z < 8.0000000000000002e143Initial program 94.3%
Taylor expanded in t around 0 76.5%
mul-1-neg76.5%
distribute-rgt-neg-in76.5%
neg-sub076.5%
sub-neg76.5%
+-commutative76.5%
associate--r+76.5%
neg-sub076.5%
remove-double-neg76.5%
Simplified76.5%
if -2.44999999999999989e-59 < z < 7.99999999999999962e-44Initial program 92.5%
Taylor expanded in t around inf 78.1%
Final simplification81.1%
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 z) z)) (t_2 (/ x (* z (- z y)))))
(if (<= z -5.5e+159)
t_1
(if (<= z -1.5e-65)
t_2
(if (<= z 1.9e-44) (/ (/ x t) y) (if (<= z 3.9e+143) t_2 t_1))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = (x / z) / z;
double t_2 = x / (z * (z - y));
double tmp;
if (z <= -5.5e+159) {
tmp = t_1;
} else if (z <= -1.5e-65) {
tmp = t_2;
} else if (z <= 1.9e-44) {
tmp = (x / t) / y;
} else if (z <= 3.9e+143) {
tmp = t_2;
} 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) :: t_2
real(8) :: tmp
t_1 = (x / z) / z
t_2 = x / (z * (z - y))
if (z <= (-5.5d+159)) then
tmp = t_1
else if (z <= (-1.5d-65)) then
tmp = t_2
else if (z <= 1.9d-44) then
tmp = (x / t) / y
else if (z <= 3.9d+143) then
tmp = t_2
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 = (x / z) / z;
double t_2 = x / (z * (z - y));
double tmp;
if (z <= -5.5e+159) {
tmp = t_1;
} else if (z <= -1.5e-65) {
tmp = t_2;
} else if (z <= 1.9e-44) {
tmp = (x / t) / y;
} else if (z <= 3.9e+143) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = (x / z) / z t_2 = x / (z * (z - y)) tmp = 0 if z <= -5.5e+159: tmp = t_1 elif z <= -1.5e-65: tmp = t_2 elif z <= 1.9e-44: tmp = (x / t) / y elif z <= 3.9e+143: tmp = t_2 else: tmp = t_1 return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(Float64(x / z) / z) t_2 = Float64(x / Float64(z * Float64(z - y))) tmp = 0.0 if (z <= -5.5e+159) tmp = t_1; elseif (z <= -1.5e-65) tmp = t_2; elseif (z <= 1.9e-44) tmp = Float64(Float64(x / t) / y); elseif (z <= 3.9e+143) tmp = t_2; 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 = (x / z) / z;
t_2 = x / (z * (z - y));
tmp = 0.0;
if (z <= -5.5e+159)
tmp = t_1;
elseif (z <= -1.5e-65)
tmp = t_2;
elseif (z <= 1.9e-44)
tmp = (x / t) / y;
elseif (z <= 3.9e+143)
tmp = t_2;
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[(N[(x / z), $MachinePrecision] / z), $MachinePrecision]}, Block[{t$95$2 = N[(x / N[(z * N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -5.5e+159], t$95$1, If[LessEqual[z, -1.5e-65], t$95$2, If[LessEqual[z, 1.9e-44], N[(N[(x / t), $MachinePrecision] / y), $MachinePrecision], If[LessEqual[z, 3.9e+143], t$95$2, t$95$1]]]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \frac{\frac{x}{z}}{z}\\
t_2 := \frac{x}{z \cdot \left(z - y\right)}\\
\mathbf{if}\;z \leq -5.5 \cdot 10^{+159}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -1.5 \cdot 10^{-65}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq 1.9 \cdot 10^{-44}:\\
\;\;\;\;\frac{\frac{x}{t}}{y}\\
\mathbf{elif}\;z \leq 3.9 \cdot 10^{+143}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -5.4999999999999998e159 or 3.8999999999999998e143 < z Initial program 71.2%
Taylor expanded in t around 0 71.2%
mul-1-neg71.2%
associate-/r*97.3%
distribute-neg-frac297.3%
neg-sub097.3%
sub-neg97.3%
+-commutative97.3%
associate--r+97.3%
neg-sub097.3%
remove-double-neg97.3%
Simplified97.3%
Taylor expanded in z around inf 91.7%
if -5.4999999999999998e159 < z < -1.49999999999999999e-65 or 1.9e-44 < z < 3.8999999999999998e143Initial program 94.3%
Taylor expanded in t around 0 76.7%
mul-1-neg76.7%
distribute-rgt-neg-in76.7%
neg-sub076.7%
sub-neg76.7%
+-commutative76.7%
associate--r+76.7%
neg-sub076.7%
remove-double-neg76.7%
Simplified76.7%
if -1.49999999999999999e-65 < z < 1.9e-44Initial program 92.4%
associate-/l/95.3%
Simplified95.3%
clear-num95.2%
inv-pow95.2%
Applied egg-rr95.2%
unpow-195.2%
Simplified95.2%
Taylor expanded in z around 0 74.6%
associate-/r*78.0%
Simplified78.0%
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 z) (- z t))))
(if (<= z -3.3e-21)
t_1
(if (<= z 1.8e-42)
(/ (/ x t) (- y z))
(if (<= z 6.5e+104) (/ x (* z (- z y))) t_1)))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = (x / z) / (z - t);
double tmp;
if (z <= -3.3e-21) {
tmp = t_1;
} else if (z <= 1.8e-42) {
tmp = (x / t) / (y - z);
} else if (z <= 6.5e+104) {
tmp = x / (z * (z - 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 = (x / z) / (z - t)
if (z <= (-3.3d-21)) then
tmp = t_1
else if (z <= 1.8d-42) then
tmp = (x / t) / (y - z)
else if (z <= 6.5d+104) then
tmp = x / (z * (z - 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 = (x / z) / (z - t);
double tmp;
if (z <= -3.3e-21) {
tmp = t_1;
} else if (z <= 1.8e-42) {
tmp = (x / t) / (y - z);
} else if (z <= 6.5e+104) {
tmp = x / (z * (z - y));
} else {
tmp = t_1;
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = (x / z) / (z - t) tmp = 0 if z <= -3.3e-21: tmp = t_1 elif z <= 1.8e-42: tmp = (x / t) / (y - z) elif z <= 6.5e+104: tmp = x / (z * (z - 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(Float64(x / z) / Float64(z - t)) tmp = 0.0 if (z <= -3.3e-21) tmp = t_1; elseif (z <= 1.8e-42) tmp = Float64(Float64(x / t) / Float64(y - z)); elseif (z <= 6.5e+104) tmp = Float64(x / Float64(z * Float64(z - 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 = (x / z) / (z - t);
tmp = 0.0;
if (z <= -3.3e-21)
tmp = t_1;
elseif (z <= 1.8e-42)
tmp = (x / t) / (y - z);
elseif (z <= 6.5e+104)
tmp = x / (z * (z - 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[(N[(x / z), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -3.3e-21], t$95$1, If[LessEqual[z, 1.8e-42], N[(N[(x / t), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 6.5e+104], N[(x / N[(z * N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \frac{\frac{x}{z}}{z - t}\\
\mathbf{if}\;z \leq -3.3 \cdot 10^{-21}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.8 \cdot 10^{-42}:\\
\;\;\;\;\frac{\frac{x}{t}}{y - z}\\
\mathbf{elif}\;z \leq 6.5 \cdot 10^{+104}:\\
\;\;\;\;\frac{x}{z \cdot \left(z - y\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -3.30000000000000009e-21 or 6.5000000000000005e104 < z Initial program 79.8%
Taylor expanded in y around 0 73.4%
mul-1-neg73.4%
associate-/r*85.5%
distribute-neg-frac285.5%
sub-neg85.5%
+-commutative85.5%
distribute-neg-in85.5%
remove-double-neg85.5%
unsub-neg85.5%
Simplified85.5%
if -3.30000000000000009e-21 < z < 1.8000000000000001e-42Initial program 92.9%
associate-/l/95.6%
Simplified95.6%
Taylor expanded in t around inf 78.4%
if 1.8000000000000001e-42 < z < 6.5000000000000005e104Initial program 99.8%
Taylor expanded in t around 0 77.9%
mul-1-neg77.9%
distribute-rgt-neg-in77.9%
neg-sub077.9%
sub-neg77.9%
+-commutative77.9%
associate--r+77.9%
neg-sub077.9%
remove-double-neg77.9%
Simplified77.9%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= z -2e+91) (/ (/ x z) (- z t)) (if (<= z 1.15e+143) (/ x (* (- t z) (- y z))) (/ (/ x z) (- z y)))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -2e+91) {
tmp = (x / z) / (z - t);
} else if (z <= 1.15e+143) {
tmp = x / ((t - z) * (y - z));
} else {
tmp = (x / z) / (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+91)) then
tmp = (x / z) / (z - t)
else if (z <= 1.15d+143) then
tmp = x / ((t - z) * (y - z))
else
tmp = (x / z) / (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+91) {
tmp = (x / z) / (z - t);
} else if (z <= 1.15e+143) {
tmp = x / ((t - z) * (y - z));
} else {
tmp = (x / z) / (z - y);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if z <= -2e+91: tmp = (x / z) / (z - t) elif z <= 1.15e+143: tmp = x / ((t - z) * (y - z)) else: tmp = (x / z) / (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+91) tmp = Float64(Float64(x / z) / Float64(z - t)); elseif (z <= 1.15e+143) tmp = Float64(x / Float64(Float64(t - z) * Float64(y - z))); else tmp = Float64(Float64(x / z) / 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+91)
tmp = (x / z) / (z - t);
elseif (z <= 1.15e+143)
tmp = x / ((t - z) * (y - z));
else
tmp = (x / z) / (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+91], N[(N[(x / z), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.15e+143], N[(x / N[(N[(t - z), $MachinePrecision] * N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / z), $MachinePrecision] / N[(z - y), $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^{+91}:\\
\;\;\;\;\frac{\frac{x}{z}}{z - t}\\
\mathbf{elif}\;z \leq 1.15 \cdot 10^{+143}:\\
\;\;\;\;\frac{x}{\left(t - z\right) \cdot \left(y - z\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{z}}{z - y}\\
\end{array}
\end{array}
if z < -2.00000000000000016e91Initial program 77.0%
Taylor expanded in y around 0 75.5%
mul-1-neg75.5%
associate-/r*90.1%
distribute-neg-frac290.1%
sub-neg90.1%
+-commutative90.1%
distribute-neg-in90.1%
remove-double-neg90.1%
unsub-neg90.1%
Simplified90.1%
if -2.00000000000000016e91 < z < 1.15e143Initial program 94.2%
if 1.15e143 < z Initial program 69.7%
Taylor expanded in t around 0 69.7%
mul-1-neg69.7%
associate-/r*97.3%
distribute-neg-frac297.3%
neg-sub097.3%
sub-neg97.3%
+-commutative97.3%
associate--r+97.3%
neg-sub097.3%
remove-double-neg97.3%
Simplified97.3%
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 (if (or (<= z -1.05e-60) (not (<= z 1.5e-41))) (/ (/ x z) (- z y)) (/ (/ x t) (- y z))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.05e-60) || !(z <= 1.5e-41)) {
tmp = (x / z) / (z - y);
} else {
tmp = (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 ((z <= (-1.05d-60)) .or. (.not. (z <= 1.5d-41))) then
tmp = (x / z) / (z - y)
else
tmp = (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 ((z <= -1.05e-60) || !(z <= 1.5e-41)) {
tmp = (x / z) / (z - y);
} else {
tmp = (x / t) / (y - z);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if (z <= -1.05e-60) or not (z <= 1.5e-41): tmp = (x / z) / (z - y) else: tmp = (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 ((z <= -1.05e-60) || !(z <= 1.5e-41)) tmp = Float64(Float64(x / z) / Float64(z - y)); else tmp = 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 ((z <= -1.05e-60) || ~((z <= 1.5e-41)))
tmp = (x / z) / (z - y);
else
tmp = (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[z, -1.05e-60], N[Not[LessEqual[z, 1.5e-41]], $MachinePrecision]], N[(N[(x / z), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision], N[(N[(x / t), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.05 \cdot 10^{-60} \lor \neg \left(z \leq 1.5 \cdot 10^{-41}\right):\\
\;\;\;\;\frac{\frac{x}{z}}{z - y}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{t}}{y - z}\\
\end{array}
\end{array}
if z < -1.04999999999999996e-60 or 1.49999999999999994e-41 < z Initial program 84.2%
Taylor expanded in t around 0 74.2%
mul-1-neg74.2%
associate-/r*86.2%
distribute-neg-frac286.2%
neg-sub086.2%
sub-neg86.2%
+-commutative86.2%
associate--r+86.2%
neg-sub086.2%
remove-double-neg86.2%
Simplified86.2%
if -1.04999999999999996e-60 < z < 1.49999999999999994e-41Initial program 92.5%
associate-/l/95.4%
Simplified95.4%
Taylor expanded in t around inf 80.8%
Final simplification84.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 (<= z -155000000000.0) (not (<= z 1.2e+17))) (/ (/ x z) z) (/ (/ x t) y)))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -155000000000.0) || !(z <= 1.2e+17)) {
tmp = (x / z) / z;
} else {
tmp = (x / t) / y;
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((z <= (-155000000000.0d0)) .or. (.not. (z <= 1.2d+17))) then
tmp = (x / z) / z
else
tmp = (x / t) / y
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -155000000000.0) || !(z <= 1.2e+17)) {
tmp = (x / z) / z;
} else {
tmp = (x / t) / y;
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if (z <= -155000000000.0) or not (z <= 1.2e+17): tmp = (x / z) / z else: tmp = (x / t) / y return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if ((z <= -155000000000.0) || !(z <= 1.2e+17)) tmp = Float64(Float64(x / z) / z); else tmp = Float64(Float64(x / t) / y); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if ((z <= -155000000000.0) || ~((z <= 1.2e+17)))
tmp = (x / z) / z;
else
tmp = (x / t) / y;
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[Or[LessEqual[z, -155000000000.0], N[Not[LessEqual[z, 1.2e+17]], $MachinePrecision]], N[(N[(x / z), $MachinePrecision] / z), $MachinePrecision], N[(N[(x / t), $MachinePrecision] / y), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -155000000000 \lor \neg \left(z \leq 1.2 \cdot 10^{+17}\right):\\
\;\;\;\;\frac{\frac{x}{z}}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{t}}{y}\\
\end{array}
\end{array}
if z < -1.55e11 or 1.2e17 < z Initial program 82.1%
Taylor expanded in t around 0 75.1%
mul-1-neg75.1%
associate-/r*89.3%
distribute-neg-frac289.3%
neg-sub089.3%
sub-neg89.3%
+-commutative89.3%
associate--r+89.3%
neg-sub089.3%
remove-double-neg89.3%
Simplified89.3%
Taylor expanded in z around inf 77.6%
if -1.55e11 < z < 1.2e17Initial program 93.0%
associate-/l/96.2%
Simplified96.2%
clear-num96.1%
inv-pow96.1%
Applied egg-rr96.1%
unpow-196.1%
Simplified96.1%
Taylor expanded in z around 0 66.4%
associate-/r*69.9%
Simplified69.9%
Final simplification73.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 (<= z -160000000000.0) (not (<= z 5.2e+23))) (/ x (* z z)) (/ (/ x t) y)))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -160000000000.0) || !(z <= 5.2e+23)) {
tmp = x / (z * z);
} else {
tmp = (x / t) / y;
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((z <= (-160000000000.0d0)) .or. (.not. (z <= 5.2d+23))) then
tmp = x / (z * z)
else
tmp = (x / t) / y
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -160000000000.0) || !(z <= 5.2e+23)) {
tmp = x / (z * z);
} else {
tmp = (x / t) / y;
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if (z <= -160000000000.0) or not (z <= 5.2e+23): tmp = x / (z * z) else: tmp = (x / t) / y return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if ((z <= -160000000000.0) || !(z <= 5.2e+23)) tmp = Float64(x / Float64(z * z)); else tmp = Float64(Float64(x / t) / y); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if ((z <= -160000000000.0) || ~((z <= 5.2e+23)))
tmp = x / (z * z);
else
tmp = (x / t) / y;
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[Or[LessEqual[z, -160000000000.0], N[Not[LessEqual[z, 5.2e+23]], $MachinePrecision]], N[(x / N[(z * z), $MachinePrecision]), $MachinePrecision], N[(N[(x / t), $MachinePrecision] / y), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -160000000000 \lor \neg \left(z \leq 5.2 \cdot 10^{+23}\right):\\
\;\;\;\;\frac{x}{z \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{t}}{y}\\
\end{array}
\end{array}
if z < -1.6e11 or 5.19999999999999983e23 < z Initial program 82.1%
Taylor expanded in t around 0 75.1%
mul-1-neg75.1%
distribute-rgt-neg-in75.1%
neg-sub075.1%
sub-neg75.1%
+-commutative75.1%
associate--r+75.1%
neg-sub075.1%
remove-double-neg75.1%
Simplified75.1%
Taylor expanded in z around inf 67.1%
if -1.6e11 < z < 5.19999999999999983e23Initial program 93.0%
associate-/l/96.2%
Simplified96.2%
clear-num96.1%
inv-pow96.1%
Applied egg-rr96.1%
unpow-196.1%
Simplified96.1%
Taylor expanded in z around 0 66.4%
associate-/r*69.9%
Simplified69.9%
Final simplification68.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 (or (<= z -3.3) (not (<= z 8e+22))) (/ x (* z z)) (/ x (* t y))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -3.3) || !(z <= 8e+22)) {
tmp = x / (z * z);
} else {
tmp = x / (t * y);
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((z <= (-3.3d0)) .or. (.not. (z <= 8d+22))) then
tmp = x / (z * z)
else
tmp = x / (t * y)
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -3.3) || !(z <= 8e+22)) {
tmp = x / (z * z);
} else {
tmp = x / (t * y);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if (z <= -3.3) or not (z <= 8e+22): tmp = x / (z * z) else: tmp = x / (t * y) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if ((z <= -3.3) || !(z <= 8e+22)) tmp = Float64(x / Float64(z * z)); else tmp = Float64(x / Float64(t * y)); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if ((z <= -3.3) || ~((z <= 8e+22)))
tmp = x / (z * z);
else
tmp = x / (t * y);
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[Or[LessEqual[z, -3.3], N[Not[LessEqual[z, 8e+22]], $MachinePrecision]], N[(x / N[(z * z), $MachinePrecision]), $MachinePrecision], N[(x / N[(t * y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.3 \lor \neg \left(z \leq 8 \cdot 10^{+22}\right):\\
\;\;\;\;\frac{x}{z \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{t \cdot y}\\
\end{array}
\end{array}
if z < -3.2999999999999998 or 8e22 < z Initial program 81.8%
Taylor expanded in t around 0 74.9%
mul-1-neg74.9%
distribute-rgt-neg-in74.9%
neg-sub074.9%
sub-neg74.9%
+-commutative74.9%
associate--r+74.9%
neg-sub074.9%
remove-double-neg74.9%
Simplified74.9%
Taylor expanded in z around inf 66.4%
if -3.2999999999999998 < z < 8e22Initial program 93.6%
Taylor expanded in z around 0 67.9%
Final simplification67.1%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (/ x (* t y)))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
return 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 = 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 x / (t * y);
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): return x / (t * y)
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) return Float64(x / Float64(t * y)) end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
tmp = 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[(x / N[(t * y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\frac{x}{t \cdot y}
\end{array}
Initial program 87.6%
Taylor expanded in z around 0 42.3%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (* (- y z) (- t z)))) (if (< (/ x t_1) 0.0) (/ (/ x (- y z)) (- t z)) (* x (/ 1.0 t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = (y - z) * (t - z);
double tmp;
if ((x / t_1) < 0.0) {
tmp = (x / (y - z)) / (t - z);
} else {
tmp = x * (1.0 / t_1);
}
return tmp;
}
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 = (y - z) * (t - z)
if ((x / t_1) < 0.0d0) then
tmp = (x / (y - z)) / (t - z)
else
tmp = x * (1.0d0 / t_1)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (y - z) * (t - z);
double tmp;
if ((x / t_1) < 0.0) {
tmp = (x / (y - z)) / (t - z);
} else {
tmp = x * (1.0 / t_1);
}
return tmp;
}
def code(x, y, z, t): t_1 = (y - z) * (t - z) tmp = 0 if (x / t_1) < 0.0: tmp = (x / (y - z)) / (t - z) else: tmp = x * (1.0 / t_1) return tmp
function code(x, y, z, t) t_1 = Float64(Float64(y - z) * Float64(t - z)) tmp = 0.0 if (Float64(x / t_1) < 0.0) tmp = Float64(Float64(x / Float64(y - z)) / Float64(t - z)); else tmp = Float64(x * Float64(1.0 / t_1)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (y - z) * (t - z); tmp = 0.0; if ((x / t_1) < 0.0) tmp = (x / (y - z)) / (t - z); else tmp = x * (1.0 / t_1); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(y - z), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision]}, If[Less[N[(x / t$95$1), $MachinePrecision], 0.0], N[(N[(x / N[(y - z), $MachinePrecision]), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], N[(x * N[(1.0 / t$95$1), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(y - z\right) \cdot \left(t - z\right)\\
\mathbf{if}\;\frac{x}{t\_1} < 0:\\
\;\;\;\;\frac{\frac{x}{y - z}}{t - z}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{1}{t\_1}\\
\end{array}
\end{array}
herbie shell --seed 2024139
(FPCore (x y z t)
:name "Data.Random.Distribution.Triangular:triangularCDF from random-fu-0.2.6.2, B"
:precision binary64
:alt
(! :herbie-platform default (if (< (/ x (* (- y z) (- t z))) 0) (/ (/ x (- y z)) (- t z)) (* x (/ 1 (* (- y z) (- t z))))))
(/ x (* (- y z) (- t z))))