
(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 15 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 (- y z)) (- t z)))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
return (x / (y - z)) / (t - 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 / (y - z)) / (t - z)
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
return (x / (y - z)) / (t - z);
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): return (x / (y - z)) / (t - z)
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) return Float64(Float64(x / Float64(y - z)) / Float64(t - z)) end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
tmp = (x / (y - z)) / (t - 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[(y - z), $MachinePrecision]), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\frac{\frac{x}{y - z}}{t - z}
\end{array}
Initial program 86.5%
Taylor expanded in x around 0 86.5%
associate-/l/95.7%
Simplified95.7%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(if (<= z -5.6e+141)
(/ (/ x z) z)
(if (or (<= z -3.3e-45) (not (<= z 1.2e-56)))
(/ x (* z (- z t)))
(/ x (* y (- t z))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -5.6e+141) {
tmp = (x / z) / z;
} else if ((z <= -3.3e-45) || !(z <= 1.2e-56)) {
tmp = x / (z * (z - t));
} else {
tmp = x / (y * (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 (z <= (-5.6d+141)) then
tmp = (x / z) / z
else if ((z <= (-3.3d-45)) .or. (.not. (z <= 1.2d-56))) then
tmp = x / (z * (z - t))
else
tmp = x / (y * (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 (z <= -5.6e+141) {
tmp = (x / z) / z;
} else if ((z <= -3.3e-45) || !(z <= 1.2e-56)) {
tmp = x / (z * (z - t));
} else {
tmp = x / (y * (t - z));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if z <= -5.6e+141: tmp = (x / z) / z elif (z <= -3.3e-45) or not (z <= 1.2e-56): tmp = x / (z * (z - t)) else: tmp = x / (y * (t - z)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (z <= -5.6e+141) tmp = Float64(Float64(x / z) / z); elseif ((z <= -3.3e-45) || !(z <= 1.2e-56)) tmp = Float64(x / Float64(z * Float64(z - t))); else tmp = Float64(x / Float64(y * 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 (z <= -5.6e+141)
tmp = (x / z) / z;
elseif ((z <= -3.3e-45) || ~((z <= 1.2e-56)))
tmp = x / (z * (z - t));
else
tmp = x / (y * (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[LessEqual[z, -5.6e+141], N[(N[(x / z), $MachinePrecision] / z), $MachinePrecision], If[Or[LessEqual[z, -3.3e-45], N[Not[LessEqual[z, 1.2e-56]], $MachinePrecision]], N[(x / N[(z * N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x / N[(y * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.6 \cdot 10^{+141}:\\
\;\;\;\;\frac{\frac{x}{z}}{z}\\
\mathbf{elif}\;z \leq -3.3 \cdot 10^{-45} \lor \neg \left(z \leq 1.2 \cdot 10^{-56}\right):\\
\;\;\;\;\frac{x}{z \cdot \left(z - t\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y \cdot \left(t - z\right)}\\
\end{array}
\end{array}
if z < -5.59999999999999982e141Initial program 72.2%
Taylor expanded in t around 0 72.2%
mul-1-neg72.2%
associate-/r*96.9%
distribute-neg-frac296.9%
neg-sub096.9%
sub-neg96.9%
+-commutative96.9%
associate--r+96.9%
neg-sub096.9%
remove-double-neg96.9%
Simplified96.9%
Taylor expanded in z around inf 93.9%
if -5.59999999999999982e141 < z < -3.3000000000000001e-45 or 1.2e-56 < z Initial program 82.2%
Taylor expanded in y around 0 69.6%
mul-1-neg69.6%
distribute-rgt-neg-in69.6%
sub-neg69.6%
+-commutative69.6%
distribute-neg-in69.6%
remove-double-neg69.6%
unsub-neg69.6%
Simplified69.6%
if -3.3000000000000001e-45 < z < 1.2e-56Initial program 94.6%
Taylor expanded in y around inf 79.6%
*-commutative79.6%
Simplified79.6%
Final simplification77.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 (<= z -8.5e+142)
(/ (/ x z) z)
(if (or (<= z -9.5e-46) (not (<= z 8.5e-55)))
(/ x (* z (- z t)))
(/ (/ x y) t))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -8.5e+142) {
tmp = (x / z) / z;
} else if ((z <= -9.5e-46) || !(z <= 8.5e-55)) {
tmp = x / (z * (z - t));
} else {
tmp = (x / y) / t;
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (z <= (-8.5d+142)) then
tmp = (x / z) / z
else if ((z <= (-9.5d-46)) .or. (.not. (z <= 8.5d-55))) then
tmp = x / (z * (z - t))
else
tmp = (x / y) / t
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -8.5e+142) {
tmp = (x / z) / z;
} else if ((z <= -9.5e-46) || !(z <= 8.5e-55)) {
tmp = x / (z * (z - t));
} else {
tmp = (x / y) / t;
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if z <= -8.5e+142: tmp = (x / z) / z elif (z <= -9.5e-46) or not (z <= 8.5e-55): tmp = x / (z * (z - t)) else: tmp = (x / y) / t return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (z <= -8.5e+142) tmp = Float64(Float64(x / z) / z); elseif ((z <= -9.5e-46) || !(z <= 8.5e-55)) tmp = Float64(x / Float64(z * Float64(z - t))); else tmp = Float64(Float64(x / y) / t); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (z <= -8.5e+142)
tmp = (x / z) / z;
elseif ((z <= -9.5e-46) || ~((z <= 8.5e-55)))
tmp = x / (z * (z - t));
else
tmp = (x / y) / t;
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[z, -8.5e+142], N[(N[(x / z), $MachinePrecision] / z), $MachinePrecision], If[Or[LessEqual[z, -9.5e-46], N[Not[LessEqual[z, 8.5e-55]], $MachinePrecision]], N[(x / N[(z * N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] / t), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -8.5 \cdot 10^{+142}:\\
\;\;\;\;\frac{\frac{x}{z}}{z}\\
\mathbf{elif}\;z \leq -9.5 \cdot 10^{-46} \lor \neg \left(z \leq 8.5 \cdot 10^{-55}\right):\\
\;\;\;\;\frac{x}{z \cdot \left(z - t\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{t}\\
\end{array}
\end{array}
if z < -8.49999999999999955e142Initial program 72.2%
Taylor expanded in t around 0 72.2%
mul-1-neg72.2%
associate-/r*96.9%
distribute-neg-frac296.9%
neg-sub096.9%
sub-neg96.9%
+-commutative96.9%
associate--r+96.9%
neg-sub096.9%
remove-double-neg96.9%
Simplified96.9%
Taylor expanded in z around inf 93.9%
if -8.49999999999999955e142 < z < -9.49999999999999993e-46 or 8.49999999999999968e-55 < z Initial program 82.2%
Taylor expanded in y around 0 69.6%
mul-1-neg69.6%
distribute-rgt-neg-in69.6%
sub-neg69.6%
+-commutative69.6%
distribute-neg-in69.6%
remove-double-neg69.6%
unsub-neg69.6%
Simplified69.6%
if -9.49999999999999993e-46 < z < 8.49999999999999968e-55Initial program 94.6%
Taylor expanded in x around 0 94.6%
associate-/l/91.5%
Simplified91.5%
clear-num91.3%
inv-pow91.3%
Applied egg-rr91.3%
unpow-191.3%
Simplified91.3%
Taylor expanded in z around 0 67.5%
*-commutative67.5%
associate-/r*67.0%
Simplified67.0%
Final simplification71.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 (<= z -2.2e+97) (/ (/ x z) (- z y)) (if (<= z 8e+78) (/ x (* (- y z) (- t z))) (/ (/ x z) (- z t)))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -2.2e+97) {
tmp = (x / z) / (z - y);
} else if (z <= 8e+78) {
tmp = x / ((y - z) * (t - z));
} else {
tmp = (x / z) / (z - t);
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (z <= (-2.2d+97)) then
tmp = (x / z) / (z - y)
else if (z <= 8d+78) then
tmp = x / ((y - z) * (t - z))
else
tmp = (x / z) / (z - t)
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -2.2e+97) {
tmp = (x / z) / (z - y);
} else if (z <= 8e+78) {
tmp = x / ((y - z) * (t - z));
} else {
tmp = (x / z) / (z - t);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if z <= -2.2e+97: tmp = (x / z) / (z - y) elif z <= 8e+78: tmp = x / ((y - z) * (t - z)) else: tmp = (x / z) / (z - t) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (z <= -2.2e+97) tmp = Float64(Float64(x / z) / Float64(z - y)); elseif (z <= 8e+78) tmp = Float64(x / Float64(Float64(y - z) * Float64(t - z))); else tmp = Float64(Float64(x / z) / Float64(z - t)); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (z <= -2.2e+97)
tmp = (x / z) / (z - y);
elseif (z <= 8e+78)
tmp = x / ((y - z) * (t - z));
else
tmp = (x / z) / (z - t);
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[z, -2.2e+97], N[(N[(x / z), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 8e+78], N[(x / N[(N[(y - z), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / z), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.2 \cdot 10^{+97}:\\
\;\;\;\;\frac{\frac{x}{z}}{z - y}\\
\mathbf{elif}\;z \leq 8 \cdot 10^{+78}:\\
\;\;\;\;\frac{x}{\left(y - z\right) \cdot \left(t - z\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{z}}{z - t}\\
\end{array}
\end{array}
if z < -2.2000000000000001e97Initial program 74.9%
Taylor expanded in t around 0 74.9%
mul-1-neg74.9%
associate-/r*97.5%
distribute-neg-frac297.5%
neg-sub097.5%
sub-neg97.5%
+-commutative97.5%
associate--r+97.5%
neg-sub097.5%
remove-double-neg97.5%
Simplified97.5%
if -2.2000000000000001e97 < z < 8.00000000000000007e78Initial program 93.0%
if 8.00000000000000007e78 < z Initial program 72.7%
Taylor expanded in y around 0 71.3%
mul-1-neg71.3%
associate-/r*94.5%
distribute-neg-frac294.5%
sub-neg94.5%
+-commutative94.5%
distribute-neg-in94.5%
remove-double-neg94.5%
unsub-neg94.5%
Simplified94.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 (<= y -1.52e-6) (/ (/ x y) (- t z)) (if (<= y 8e-290) (/ (/ x z) (- z t)) (/ (/ x t) (- y z)))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.52e-6) {
tmp = (x / y) / (t - z);
} else if (y <= 8e-290) {
tmp = (x / z) / (z - t);
} 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 (y <= (-1.52d-6)) then
tmp = (x / y) / (t - z)
else if (y <= 8d-290) then
tmp = (x / z) / (z - t)
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 (y <= -1.52e-6) {
tmp = (x / y) / (t - z);
} else if (y <= 8e-290) {
tmp = (x / z) / (z - t);
} 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 y <= -1.52e-6: tmp = (x / y) / (t - z) elif y <= 8e-290: tmp = (x / z) / (z - t) 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 (y <= -1.52e-6) tmp = Float64(Float64(x / y) / Float64(t - z)); elseif (y <= 8e-290) tmp = Float64(Float64(x / z) / Float64(z - t)); 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 (y <= -1.52e-6)
tmp = (x / y) / (t - z);
elseif (y <= 8e-290)
tmp = (x / z) / (z - t);
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[LessEqual[y, -1.52e-6], N[(N[(x / y), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 8e-290], N[(N[(x / z), $MachinePrecision] / N[(z - t), $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}\;y \leq -1.52 \cdot 10^{-6}:\\
\;\;\;\;\frac{\frac{x}{y}}{t - z}\\
\mathbf{elif}\;y \leq 8 \cdot 10^{-290}:\\
\;\;\;\;\frac{\frac{x}{z}}{z - t}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{t}}{y - z}\\
\end{array}
\end{array}
if y < -1.52000000000000006e-6Initial program 85.1%
Taylor expanded in y around inf 79.2%
associate-/r*84.9%
Simplified84.9%
if -1.52000000000000006e-6 < y < 8.0000000000000006e-290Initial program 83.4%
Taylor expanded in y around 0 63.3%
mul-1-neg63.3%
associate-/r*77.2%
distribute-neg-frac277.2%
sub-neg77.2%
+-commutative77.2%
distribute-neg-in77.2%
remove-double-neg77.2%
unsub-neg77.2%
Simplified77.2%
if 8.0000000000000006e-290 < y Initial program 89.6%
associate-/l/97.3%
Simplified97.3%
Taylor expanded in t around inf 63.9%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= y -1.65e-46) (/ (/ x y) (- t z)) (if (<= y 7e-290) (/ x (* z (- z t))) (/ (/ x t) (- y z)))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.65e-46) {
tmp = (x / y) / (t - z);
} else if (y <= 7e-290) {
tmp = x / (z * (z - t));
} 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 (y <= (-1.65d-46)) then
tmp = (x / y) / (t - z)
else if (y <= 7d-290) then
tmp = x / (z * (z - t))
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 (y <= -1.65e-46) {
tmp = (x / y) / (t - z);
} else if (y <= 7e-290) {
tmp = x / (z * (z - t));
} 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 y <= -1.65e-46: tmp = (x / y) / (t - z) elif y <= 7e-290: tmp = x / (z * (z - t)) 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 (y <= -1.65e-46) tmp = Float64(Float64(x / y) / Float64(t - z)); elseif (y <= 7e-290) tmp = Float64(x / Float64(z * Float64(z - t))); 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 (y <= -1.65e-46)
tmp = (x / y) / (t - z);
elseif (y <= 7e-290)
tmp = x / (z * (z - t));
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[LessEqual[y, -1.65e-46], N[(N[(x / y), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 7e-290], N[(x / N[(z * N[(z - t), $MachinePrecision]), $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}\;y \leq -1.65 \cdot 10^{-46}:\\
\;\;\;\;\frac{\frac{x}{y}}{t - z}\\
\mathbf{elif}\;y \leq 7 \cdot 10^{-290}:\\
\;\;\;\;\frac{x}{z \cdot \left(z - t\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{t}}{y - z}\\
\end{array}
\end{array}
if y < -1.65000000000000007e-46Initial program 84.0%
Taylor expanded in y around inf 72.9%
associate-/r*76.4%
Simplified76.4%
if -1.65000000000000007e-46 < y < 6.99999999999999963e-290Initial program 84.2%
Taylor expanded in y around 0 66.5%
mul-1-neg66.5%
distribute-rgt-neg-in66.5%
sub-neg66.5%
+-commutative66.5%
distribute-neg-in66.5%
remove-double-neg66.5%
unsub-neg66.5%
Simplified66.5%
if 6.99999999999999963e-290 < y Initial program 89.7%
associate-/l/97.3%
Simplified97.3%
Taylor expanded in t around inf 64.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 -6.4e-46) (/ x (* y (- t z))) (if (<= y 7.5e-290) (/ x (* z (- z t))) (/ (/ x t) (- y z)))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -6.4e-46) {
tmp = x / (y * (t - z));
} else if (y <= 7.5e-290) {
tmp = x / (z * (z - t));
} 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 (y <= (-6.4d-46)) then
tmp = x / (y * (t - z))
else if (y <= 7.5d-290) then
tmp = x / (z * (z - t))
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 (y <= -6.4e-46) {
tmp = x / (y * (t - z));
} else if (y <= 7.5e-290) {
tmp = x / (z * (z - t));
} 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 y <= -6.4e-46: tmp = x / (y * (t - z)) elif y <= 7.5e-290: tmp = x / (z * (z - t)) 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 (y <= -6.4e-46) tmp = Float64(x / Float64(y * Float64(t - z))); elseif (y <= 7.5e-290) tmp = Float64(x / Float64(z * Float64(z - t))); 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 (y <= -6.4e-46)
tmp = x / (y * (t - z));
elseif (y <= 7.5e-290)
tmp = x / (z * (z - t));
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[LessEqual[y, -6.4e-46], N[(x / N[(y * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 7.5e-290], N[(x / N[(z * N[(z - t), $MachinePrecision]), $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}\;y \leq -6.4 \cdot 10^{-46}:\\
\;\;\;\;\frac{x}{y \cdot \left(t - z\right)}\\
\mathbf{elif}\;y \leq 7.5 \cdot 10^{-290}:\\
\;\;\;\;\frac{x}{z \cdot \left(z - t\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{t}}{y - z}\\
\end{array}
\end{array}
if y < -6.3999999999999998e-46Initial program 84.0%
Taylor expanded in y around inf 72.9%
*-commutative72.9%
Simplified72.9%
if -6.3999999999999998e-46 < y < 7.4999999999999995e-290Initial program 84.2%
Taylor expanded in y around 0 66.5%
mul-1-neg66.5%
distribute-rgt-neg-in66.5%
sub-neg66.5%
+-commutative66.5%
distribute-neg-in66.5%
remove-double-neg66.5%
unsub-neg66.5%
Simplified66.5%
if 7.4999999999999995e-290 < y Initial program 89.7%
associate-/l/97.3%
Simplified97.3%
Taylor expanded in t around inf 64.2%
Final simplification67.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 -1.56e+52) (not (<= z 4.5e-53))) (/ (/ x z) z) (/ (/ x y) t)))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.56e+52) || !(z <= 4.5e-53)) {
tmp = (x / z) / z;
} else {
tmp = (x / y) / t;
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((z <= (-1.56d+52)) .or. (.not. (z <= 4.5d-53))) then
tmp = (x / z) / z
else
tmp = (x / y) / t
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.56e+52) || !(z <= 4.5e-53)) {
tmp = (x / z) / z;
} else {
tmp = (x / y) / t;
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if (z <= -1.56e+52) or not (z <= 4.5e-53): tmp = (x / z) / z else: tmp = (x / y) / t return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if ((z <= -1.56e+52) || !(z <= 4.5e-53)) tmp = Float64(Float64(x / z) / z); else tmp = Float64(Float64(x / y) / t); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if ((z <= -1.56e+52) || ~((z <= 4.5e-53)))
tmp = (x / z) / z;
else
tmp = (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[Or[LessEqual[z, -1.56e+52], N[Not[LessEqual[z, 4.5e-53]], $MachinePrecision]], N[(N[(x / z), $MachinePrecision] / z), $MachinePrecision], N[(N[(x / y), $MachinePrecision] / t), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.56 \cdot 10^{+52} \lor \neg \left(z \leq 4.5 \cdot 10^{-53}\right):\\
\;\;\;\;\frac{\frac{x}{z}}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{t}\\
\end{array}
\end{array}
if z < -1.55999999999999994e52 or 4.49999999999999985e-53 < z Initial program 77.0%
Taylor expanded in t around 0 69.8%
mul-1-neg69.8%
associate-/r*80.7%
distribute-neg-frac280.7%
neg-sub080.7%
sub-neg80.7%
+-commutative80.7%
associate--r+80.7%
neg-sub080.7%
remove-double-neg80.7%
Simplified80.7%
Taylor expanded in z around inf 71.5%
if -1.55999999999999994e52 < z < 4.49999999999999985e-53Initial program 94.8%
Taylor expanded in x around 0 94.8%
associate-/l/92.2%
Simplified92.2%
clear-num92.0%
inv-pow92.0%
Applied egg-rr92.0%
unpow-192.0%
Simplified92.0%
Taylor expanded in z around 0 61.5%
*-commutative61.5%
associate-/r*62.9%
Simplified62.9%
Final simplification66.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 (or (<= z -8.5e+97) (not (<= z 2e+135))) (/ x (* y z)) (/ (/ x y) t)))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -8.5e+97) || !(z <= 2e+135)) {
tmp = x / (y * z);
} else {
tmp = (x / y) / t;
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((z <= (-8.5d+97)) .or. (.not. (z <= 2d+135))) then
tmp = x / (y * z)
else
tmp = (x / y) / t
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -8.5e+97) || !(z <= 2e+135)) {
tmp = x / (y * z);
} else {
tmp = (x / y) / t;
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if (z <= -8.5e+97) or not (z <= 2e+135): tmp = x / (y * z) else: tmp = (x / y) / t return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if ((z <= -8.5e+97) || !(z <= 2e+135)) tmp = Float64(x / Float64(y * z)); else tmp = Float64(Float64(x / y) / t); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if ((z <= -8.5e+97) || ~((z <= 2e+135)))
tmp = x / (y * z);
else
tmp = (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[Or[LessEqual[z, -8.5e+97], N[Not[LessEqual[z, 2e+135]], $MachinePrecision]], N[(x / N[(y * z), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] / t), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -8.5 \cdot 10^{+97} \lor \neg \left(z \leq 2 \cdot 10^{+135}\right):\\
\;\;\;\;\frac{x}{y \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{t}\\
\end{array}
\end{array}
if z < -8.4999999999999993e97 or 1.99999999999999992e135 < z Initial program 74.0%
Taylor expanded in t around 0 74.0%
mul-1-neg74.0%
associate-/r*91.8%
distribute-neg-frac291.8%
neg-sub091.8%
sub-neg91.8%
+-commutative91.8%
associate--r+91.8%
neg-sub091.8%
remove-double-neg91.8%
Simplified91.8%
Taylor expanded in z around 0 38.7%
associate-*r/38.7%
neg-mul-138.7%
*-commutative38.7%
Simplified38.7%
frac-2neg38.7%
remove-double-neg38.7%
*-commutative38.7%
distribute-lft-neg-in38.7%
un-div-inv38.7%
associate-/l/38.7%
associate-/l/38.7%
add-sqr-sqrt23.2%
sqrt-unprod38.2%
sqr-neg38.2%
sqrt-unprod15.3%
add-sqr-sqrt38.8%
Applied egg-rr38.8%
associate-*r/38.8%
*-rgt-identity38.8%
*-commutative38.8%
Simplified38.8%
if -8.4999999999999993e97 < z < 1.99999999999999992e135Initial program 91.2%
Taylor expanded in x around 0 91.2%
associate-/l/94.2%
Simplified94.2%
clear-num94.1%
inv-pow94.1%
Applied egg-rr94.1%
unpow-194.1%
Simplified94.1%
Taylor expanded in z around 0 51.5%
*-commutative51.5%
associate-/r*54.9%
Simplified54.9%
Final simplification50.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 -2.75e+51) (not (<= z 7e+134))) (/ x (* y 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 <= -2.75e+51) || !(z <= 7e+134)) {
tmp = x / (y * 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 <= (-2.75d+51)) .or. (.not. (z <= 7d+134))) then
tmp = x / (y * 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 <= -2.75e+51) || !(z <= 7e+134)) {
tmp = x / (y * 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 <= -2.75e+51) or not (z <= 7e+134): tmp = x / (y * 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 <= -2.75e+51) || !(z <= 7e+134)) tmp = Float64(x / Float64(y * 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 <= -2.75e+51) || ~((z <= 7e+134)))
tmp = x / (y * 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, -2.75e+51], N[Not[LessEqual[z, 7e+134]], $MachinePrecision]], N[(x / N[(y * 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 -2.75 \cdot 10^{+51} \lor \neg \left(z \leq 7 \cdot 10^{+134}\right):\\
\;\;\;\;\frac{x}{y \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{t}}{y}\\
\end{array}
\end{array}
if z < -2.75e51 or 7.00000000000000006e134 < z Initial program 75.9%
Taylor expanded in t around 0 75.8%
mul-1-neg75.8%
associate-/r*91.5%
distribute-neg-frac291.5%
neg-sub091.5%
sub-neg91.5%
+-commutative91.5%
associate--r+91.5%
neg-sub091.5%
remove-double-neg91.5%
Simplified91.5%
Taylor expanded in z around 0 40.9%
associate-*r/40.9%
neg-mul-140.9%
*-commutative40.9%
Simplified40.9%
frac-2neg40.9%
remove-double-neg40.9%
*-commutative40.9%
distribute-lft-neg-in40.9%
un-div-inv40.9%
associate-/l/40.9%
associate-/l/40.9%
add-sqr-sqrt23.2%
sqrt-unprod39.2%
sqr-neg39.2%
sqrt-unprod16.3%
add-sqr-sqrt38.4%
Applied egg-rr38.4%
associate-*r/38.4%
*-rgt-identity38.4%
*-commutative38.4%
Simplified38.4%
if -2.75e51 < z < 7.00000000000000006e134Initial program 91.2%
associate-/l/95.5%
Simplified95.5%
Taylor expanded in t around inf 71.4%
Taylor expanded in y around inf 57.1%
Final simplification51.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 (<= z -1.9e+50) (not (<= z 1.75e+132))) (/ x (* y z)) (/ x (* y t))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.9e+50) || !(z <= 1.75e+132)) {
tmp = x / (y * z);
} else {
tmp = x / (y * t);
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((z <= (-1.9d+50)) .or. (.not. (z <= 1.75d+132))) then
tmp = x / (y * z)
else
tmp = x / (y * t)
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.9e+50) || !(z <= 1.75e+132)) {
tmp = x / (y * z);
} else {
tmp = x / (y * t);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if (z <= -1.9e+50) or not (z <= 1.75e+132): tmp = x / (y * z) else: tmp = x / (y * t) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if ((z <= -1.9e+50) || !(z <= 1.75e+132)) tmp = Float64(x / Float64(y * z)); else tmp = Float64(x / Float64(y * t)); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if ((z <= -1.9e+50) || ~((z <= 1.75e+132)))
tmp = x / (y * z);
else
tmp = 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[Or[LessEqual[z, -1.9e+50], N[Not[LessEqual[z, 1.75e+132]], $MachinePrecision]], N[(x / N[(y * z), $MachinePrecision]), $MachinePrecision], N[(x / N[(y * t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.9 \cdot 10^{+50} \lor \neg \left(z \leq 1.75 \cdot 10^{+132}\right):\\
\;\;\;\;\frac{x}{y \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y \cdot t}\\
\end{array}
\end{array}
if z < -1.89999999999999994e50 or 1.7500000000000001e132 < z Initial program 75.9%
Taylor expanded in t around 0 75.8%
mul-1-neg75.8%
associate-/r*91.5%
distribute-neg-frac291.5%
neg-sub091.5%
sub-neg91.5%
+-commutative91.5%
associate--r+91.5%
neg-sub091.5%
remove-double-neg91.5%
Simplified91.5%
Taylor expanded in z around 0 40.9%
associate-*r/40.9%
neg-mul-140.9%
*-commutative40.9%
Simplified40.9%
frac-2neg40.9%
remove-double-neg40.9%
*-commutative40.9%
distribute-lft-neg-in40.9%
un-div-inv40.9%
associate-/l/40.9%
associate-/l/40.9%
add-sqr-sqrt23.2%
sqrt-unprod39.2%
sqr-neg39.2%
sqrt-unprod16.3%
add-sqr-sqrt38.4%
Applied egg-rr38.4%
associate-*r/38.4%
*-rgt-identity38.4%
*-commutative38.4%
Simplified38.4%
if -1.89999999999999994e50 < z < 1.7500000000000001e132Initial program 91.2%
Taylor expanded in z around 0 52.8%
Final simplification48.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 (<= z -1.6e+29) (not (<= z 1e+52))) (/ x (* z t)) (/ x (* y t))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.6e+29) || !(z <= 1e+52)) {
tmp = x / (z * t);
} else {
tmp = x / (y * t);
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((z <= (-1.6d+29)) .or. (.not. (z <= 1d+52))) then
tmp = x / (z * t)
else
tmp = x / (y * t)
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.6e+29) || !(z <= 1e+52)) {
tmp = x / (z * t);
} else {
tmp = x / (y * t);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if (z <= -1.6e+29) or not (z <= 1e+52): tmp = x / (z * t) else: tmp = x / (y * t) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if ((z <= -1.6e+29) || !(z <= 1e+52)) tmp = Float64(x / Float64(z * t)); else tmp = Float64(x / Float64(y * t)); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if ((z <= -1.6e+29) || ~((z <= 1e+52)))
tmp = x / (z * t);
else
tmp = 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[Or[LessEqual[z, -1.6e+29], N[Not[LessEqual[z, 1e+52]], $MachinePrecision]], N[(x / N[(z * t), $MachinePrecision]), $MachinePrecision], N[(x / N[(y * t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.6 \cdot 10^{+29} \lor \neg \left(z \leq 10^{+52}\right):\\
\;\;\;\;\frac{x}{z \cdot t}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y \cdot t}\\
\end{array}
\end{array}
if z < -1.59999999999999993e29 or 9.9999999999999999e51 < z Initial program 77.3%
associate-/l/99.8%
Simplified99.8%
Taylor expanded in t around inf 45.8%
Taylor expanded in y around 0 41.3%
neg-mul-141.3%
Simplified41.3%
*-un-lft-identity41.3%
associate-/l/36.9%
associate-/r*44.0%
add-sqr-sqrt16.7%
sqrt-unprod51.7%
sqr-neg51.7%
sqrt-unprod18.5%
add-sqr-sqrt35.2%
Applied egg-rr35.2%
*-lft-identity35.2%
associate-/l/35.0%
*-commutative35.0%
Simplified35.0%
if -1.59999999999999993e29 < z < 9.9999999999999999e51Initial program 93.3%
Taylor expanded in z around 0 57.7%
Final simplification48.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 (<= z -1.1e+97) (/ x (* y z)) (if (<= z 6.2e+131) (/ (/ x y) t) (/ (/ x z) y))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.1e+97) {
tmp = x / (y * z);
} else if (z <= 6.2e+131) {
tmp = (x / y) / t;
} else {
tmp = (x / 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 <= (-1.1d+97)) then
tmp = x / (y * z)
else if (z <= 6.2d+131) then
tmp = (x / y) / t
else
tmp = (x / 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 <= -1.1e+97) {
tmp = x / (y * z);
} else if (z <= 6.2e+131) {
tmp = (x / y) / t;
} else {
tmp = (x / z) / y;
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if z <= -1.1e+97: tmp = x / (y * z) elif z <= 6.2e+131: tmp = (x / y) / t else: tmp = (x / z) / y return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (z <= -1.1e+97) tmp = Float64(x / Float64(y * z)); elseif (z <= 6.2e+131) tmp = Float64(Float64(x / y) / t); else tmp = Float64(Float64(x / 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 <= -1.1e+97)
tmp = x / (y * z);
elseif (z <= 6.2e+131)
tmp = (x / y) / t;
else
tmp = (x / 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, -1.1e+97], N[(x / N[(y * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 6.2e+131], N[(N[(x / y), $MachinePrecision] / t), $MachinePrecision], N[(N[(x / z), $MachinePrecision] / y), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.1 \cdot 10^{+97}:\\
\;\;\;\;\frac{x}{y \cdot z}\\
\mathbf{elif}\;z \leq 6.2 \cdot 10^{+131}:\\
\;\;\;\;\frac{\frac{x}{y}}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{z}}{y}\\
\end{array}
\end{array}
if z < -1.1e97Initial program 74.9%
Taylor expanded in t around 0 74.9%
mul-1-neg74.9%
associate-/r*97.5%
distribute-neg-frac297.5%
neg-sub097.5%
sub-neg97.5%
+-commutative97.5%
associate--r+97.5%
neg-sub097.5%
remove-double-neg97.5%
Simplified97.5%
Taylor expanded in z around 0 31.8%
associate-*r/31.8%
neg-mul-131.8%
*-commutative31.8%
Simplified31.8%
frac-2neg31.8%
remove-double-neg31.8%
*-commutative31.8%
distribute-lft-neg-in31.8%
un-div-inv31.8%
associate-/l/31.8%
associate-/l/31.8%
add-sqr-sqrt14.6%
sqrt-unprod31.1%
sqr-neg31.1%
sqrt-unprod16.9%
add-sqr-sqrt32.0%
Applied egg-rr32.0%
associate-*r/32.0%
*-rgt-identity32.0%
*-commutative32.0%
Simplified32.0%
if -1.1e97 < z < 6.20000000000000032e131Initial program 91.2%
Taylor expanded in x around 0 91.2%
associate-/l/94.2%
Simplified94.2%
clear-num94.1%
inv-pow94.1%
Applied egg-rr94.1%
unpow-194.1%
Simplified94.1%
Taylor expanded in z around 0 51.5%
*-commutative51.5%
associate-/r*54.9%
Simplified54.9%
if 6.20000000000000032e131 < z Initial program 72.9%
Taylor expanded in t around 0 72.9%
mul-1-neg72.9%
associate-/r*84.8%
distribute-neg-frac284.8%
neg-sub084.8%
sub-neg84.8%
+-commutative84.8%
associate--r+84.8%
neg-sub084.8%
remove-double-neg84.8%
Simplified84.8%
div-inv84.8%
associate-/l*72.9%
Applied egg-rr72.9%
Taylor expanded in z around 0 47.2%
neg-mul-147.2%
Simplified47.2%
associate-*r/49.5%
add-sqr-sqrt42.0%
div-inv42.0%
sqrt-unprod46.0%
sqr-neg46.0%
sqrt-unprod7.6%
add-sqr-sqrt49.5%
Applied egg-rr49.5%
Final simplification50.9%
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 86.5%
associate-/l/96.8%
Simplified96.8%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (/ x (* y t)))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
return 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 = 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 x / (y * t);
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): return x / (y * t)
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) return Float64(x / Float64(y * t)) end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
tmp = 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[(x / N[(y * t), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\frac{x}{y \cdot t}
\end{array}
Initial program 86.5%
Taylor expanded in z around 0 42.2%
Final simplification42.2%
(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 2024145
(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))))