
(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 (/ (* (/ 1.0 (- y z)) x) (- t z)))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
return ((1.0 / (y - z)) * x) / (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 = ((1.0d0 / (y - z)) * x) / (t - z)
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
return ((1.0 / (y - z)) * x) / (t - z);
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): return ((1.0 / (y - z)) * x) / (t - z)
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) return Float64(Float64(Float64(1.0 / Float64(y - z)) * x) / Float64(t - z)) end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
tmp = ((1.0 / (y - z)) * x) / (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[(N[(1.0 / N[(y - z), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\frac{\frac{1}{y - z} \cdot x}{t - z}
\end{array}
Initial program 90.6%
associate-/l/98.3%
clear-num97.9%
inv-pow97.9%
div-inv97.8%
clear-num98.2%
Applied egg-rr98.2%
unpow-198.2%
Simplified98.2%
clear-num97.8%
associate-/r/98.1%
Applied egg-rr98.1%
*-un-lft-identity98.1%
associate-/r*98.5%
associate-*l/98.5%
*-un-lft-identity98.5%
associate-/r/90.8%
Applied egg-rr90.8%
*-lft-identity90.8%
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 (let* ((t_1 (/ x (* (- y z) (- t z))))) (if (<= t_1 -1e-210) t_1 (/ (/ x (- t z)) (- y z)))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = x / ((y - z) * (t - z));
double tmp;
if (t_1 <= -1e-210) {
tmp = t_1;
} else {
tmp = (x / (t - z)) / (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) :: t_1
real(8) :: tmp
t_1 = x / ((y - z) * (t - z))
if (t_1 <= (-1d-210)) then
tmp = t_1
else
tmp = (x / (t - z)) / (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 t_1 = x / ((y - z) * (t - z));
double tmp;
if (t_1 <= -1e-210) {
tmp = t_1;
} else {
tmp = (x / (t - z)) / (y - z);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = x / ((y - z) * (t - z)) tmp = 0 if t_1 <= -1e-210: tmp = t_1 else: tmp = (x / (t - z)) / (y - z) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(x / Float64(Float64(y - z) * Float64(t - z))) tmp = 0.0 if (t_1 <= -1e-210) tmp = t_1; else tmp = Float64(Float64(x / Float64(t - z)) / 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)
t_1 = x / ((y - z) * (t - z));
tmp = 0.0;
if (t_1 <= -1e-210)
tmp = t_1;
else
tmp = (x / (t - z)) / (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_] := Block[{t$95$1 = N[(x / N[(N[(y - z), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -1e-210], t$95$1, 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])\\
\\
\begin{array}{l}
t_1 := \frac{x}{\left(y - z\right) \cdot \left(t - z\right)}\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{-210}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{t - z}}{y - z}\\
\end{array}
\end{array}
if (/.f64 x (*.f64 (-.f64 y z) (-.f64 t z))) < -1e-210Initial program 97.3%
if -1e-210 < (/.f64 x (*.f64 (-.f64 y z) (-.f64 t z))) Initial program 88.7%
associate-/l/98.4%
Simplified98.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.65e-110) (not (<= z 5.1e-70))) (/ 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 <= -1.65e-110) || !(z <= 5.1e-70)) {
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 <= (-1.65d-110)) .or. (.not. (z <= 5.1d-70))) 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 <= -1.65e-110) || !(z <= 5.1e-70)) {
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 <= -1.65e-110) or not (z <= 5.1e-70): 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 <= -1.65e-110) || !(z <= 5.1e-70)) 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 <= -1.65e-110) || ~((z <= 5.1e-70)))
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[Or[LessEqual[z, -1.65e-110], N[Not[LessEqual[z, 5.1e-70]], $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 -1.65 \cdot 10^{-110} \lor \neg \left(z \leq 5.1 \cdot 10^{-70}\right):\\
\;\;\;\;\frac{x}{z \cdot \left(z - t\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{t}\\
\end{array}
\end{array}
if z < -1.65e-110 or 5.10000000000000025e-70 < z Initial program 89.5%
Taylor expanded in y around 0 72.3%
mul-1-neg72.3%
distribute-rgt-neg-in72.3%
sub-neg72.3%
+-commutative72.3%
distribute-neg-in72.3%
remove-double-neg72.3%
unsub-neg72.3%
Simplified72.3%
if -1.65e-110 < z < 5.10000000000000025e-70Initial program 92.4%
Taylor expanded in y around inf 83.1%
associate-/r*85.0%
Simplified85.0%
Taylor expanded in t around inf 74.6%
Final simplification73.1%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= t -2.7e-132) (/ (/ x y) (- t z)) (if (<= t 1.45e-64) (/ (/ 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 (t <= -2.7e-132) {
tmp = (x / y) / (t - z);
} else if (t <= 1.45e-64) {
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 (t <= (-2.7d-132)) then
tmp = (x / y) / (t - z)
else if (t <= 1.45d-64) 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 (t <= -2.7e-132) {
tmp = (x / y) / (t - z);
} else if (t <= 1.45e-64) {
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 t <= -2.7e-132: tmp = (x / y) / (t - z) elif t <= 1.45e-64: 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 (t <= -2.7e-132) tmp = Float64(Float64(x / y) / Float64(t - z)); elseif (t <= 1.45e-64) 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 (t <= -2.7e-132)
tmp = (x / y) / (t - z);
elseif (t <= 1.45e-64)
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[LessEqual[t, -2.7e-132], N[(N[(x / y), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.45e-64], 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}\;t \leq -2.7 \cdot 10^{-132}:\\
\;\;\;\;\frac{\frac{x}{y}}{t - z}\\
\mathbf{elif}\;t \leq 1.45 \cdot 10^{-64}:\\
\;\;\;\;\frac{\frac{x}{z}}{z - y}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{t}}{y - z}\\
\end{array}
\end{array}
if t < -2.6999999999999999e-132Initial program 86.0%
Taylor expanded in y around inf 64.8%
associate-/r*68.8%
Simplified68.8%
if -2.6999999999999999e-132 < t < 1.4499999999999999e-64Initial program 91.9%
Taylor expanded in t around 0 78.3%
mul-1-neg78.3%
associate-/r*84.3%
distribute-neg-frac284.3%
neg-sub084.3%
sub-neg84.3%
+-commutative84.3%
associate--r+84.3%
neg-sub084.3%
remove-double-neg84.3%
Simplified84.3%
if 1.4499999999999999e-64 < t Initial program 92.6%
associate-/l/98.7%
Simplified98.7%
Taylor expanded in t around inf 87.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 (<= y -6.2e-129) (/ (/ x y) (- t z)) (if (<= y 7.8e-186) (/ 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.2e-129) {
tmp = (x / y) / (t - z);
} else if (y <= 7.8e-186) {
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.2d-129)) then
tmp = (x / y) / (t - z)
else if (y <= 7.8d-186) 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.2e-129) {
tmp = (x / y) / (t - z);
} else if (y <= 7.8e-186) {
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.2e-129: tmp = (x / y) / (t - z) elif y <= 7.8e-186: 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.2e-129) tmp = Float64(Float64(x / y) / Float64(t - z)); elseif (y <= 7.8e-186) 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.2e-129)
tmp = (x / y) / (t - z);
elseif (y <= 7.8e-186)
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.2e-129], N[(N[(x / y), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 7.8e-186], 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.2 \cdot 10^{-129}:\\
\;\;\;\;\frac{\frac{x}{y}}{t - z}\\
\mathbf{elif}\;y \leq 7.8 \cdot 10^{-186}:\\
\;\;\;\;\frac{x}{z \cdot \left(z - t\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{t}}{y - z}\\
\end{array}
\end{array}
if y < -6.2000000000000001e-129Initial program 85.6%
Taylor expanded in y around inf 72.2%
associate-/r*74.2%
Simplified74.2%
if -6.2000000000000001e-129 < y < 7.8000000000000002e-186Initial program 91.2%
Taylor expanded in y around 0 80.5%
mul-1-neg80.5%
distribute-rgt-neg-in80.5%
sub-neg80.5%
+-commutative80.5%
distribute-neg-in80.5%
remove-double-neg80.5%
unsub-neg80.5%
Simplified80.5%
if 7.8000000000000002e-186 < y Initial program 94.8%
associate-/l/98.9%
Simplified98.9%
Taylor expanded in t around inf 66.0%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= y -9.5e-130) (/ x (* y (- t z))) (if (<= y 8e-186) (/ 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 <= -9.5e-130) {
tmp = x / (y * (t - z));
} else if (y <= 8e-186) {
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 <= (-9.5d-130)) then
tmp = x / (y * (t - z))
else if (y <= 8d-186) 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 <= -9.5e-130) {
tmp = x / (y * (t - z));
} else if (y <= 8e-186) {
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 <= -9.5e-130: tmp = x / (y * (t - z)) elif y <= 8e-186: 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 <= -9.5e-130) tmp = Float64(x / Float64(y * Float64(t - z))); elseif (y <= 8e-186) 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 <= -9.5e-130)
tmp = x / (y * (t - z));
elseif (y <= 8e-186)
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, -9.5e-130], N[(x / N[(y * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 8e-186], 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 -9.5 \cdot 10^{-130}:\\
\;\;\;\;\frac{x}{y \cdot \left(t - z\right)}\\
\mathbf{elif}\;y \leq 8 \cdot 10^{-186}:\\
\;\;\;\;\frac{x}{z \cdot \left(z - t\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{t}}{y - z}\\
\end{array}
\end{array}
if y < -9.49999999999999962e-130Initial program 85.6%
Taylor expanded in y around inf 72.2%
*-commutative72.2%
Simplified72.2%
if -9.49999999999999962e-130 < y < 7.9999999999999993e-186Initial program 91.2%
Taylor expanded in y around 0 80.5%
mul-1-neg80.5%
distribute-rgt-neg-in80.5%
sub-neg80.5%
+-commutative80.5%
distribute-neg-in80.5%
remove-double-neg80.5%
unsub-neg80.5%
Simplified80.5%
if 7.9999999999999993e-186 < y Initial program 94.8%
associate-/l/98.9%
Simplified98.9%
Taylor expanded in t around inf 66.0%
Final simplification71.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 -6.2e-129) (/ x (* y (- t z))) (if (<= y 2.9e-41) (/ x (* z (- z t))) (/ (/ 1.0 t) (/ y x)))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -6.2e-129) {
tmp = x / (y * (t - z));
} else if (y <= 2.9e-41) {
tmp = x / (z * (z - t));
} else {
tmp = (1.0 / t) / (y / x);
}
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.2d-129)) then
tmp = x / (y * (t - z))
else if (y <= 2.9d-41) then
tmp = x / (z * (z - t))
else
tmp = (1.0d0 / t) / (y / x)
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.2e-129) {
tmp = x / (y * (t - z));
} else if (y <= 2.9e-41) {
tmp = x / (z * (z - t));
} else {
tmp = (1.0 / t) / (y / x);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if y <= -6.2e-129: tmp = x / (y * (t - z)) elif y <= 2.9e-41: tmp = x / (z * (z - t)) else: tmp = (1.0 / t) / (y / x) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (y <= -6.2e-129) tmp = Float64(x / Float64(y * Float64(t - z))); elseif (y <= 2.9e-41) tmp = Float64(x / Float64(z * Float64(z - t))); else tmp = Float64(Float64(1.0 / t) / Float64(y / x)); 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.2e-129)
tmp = x / (y * (t - z));
elseif (y <= 2.9e-41)
tmp = x / (z * (z - t));
else
tmp = (1.0 / t) / (y / x);
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.2e-129], N[(x / N[(y * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.9e-41], N[(x / N[(z * N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / t), $MachinePrecision] / N[(y / x), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -6.2 \cdot 10^{-129}:\\
\;\;\;\;\frac{x}{y \cdot \left(t - z\right)}\\
\mathbf{elif}\;y \leq 2.9 \cdot 10^{-41}:\\
\;\;\;\;\frac{x}{z \cdot \left(z - t\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1}{t}}{\frac{y}{x}}\\
\end{array}
\end{array}
if y < -6.2000000000000001e-129Initial program 85.6%
Taylor expanded in y around inf 72.2%
*-commutative72.2%
Simplified72.2%
if -6.2000000000000001e-129 < y < 2.89999999999999977e-41Initial program 93.6%
Taylor expanded in y around 0 80.2%
mul-1-neg80.2%
distribute-rgt-neg-in80.2%
sub-neg80.2%
+-commutative80.2%
distribute-neg-in80.2%
remove-double-neg80.2%
unsub-neg80.2%
Simplified80.2%
if 2.89999999999999977e-41 < y Initial program 93.1%
Taylor expanded in z around 0 56.2%
associate-/r*58.7%
div-inv58.6%
Applied egg-rr58.6%
associate-*l/60.6%
div-inv60.7%
div-inv60.6%
clear-num60.6%
associate-*l/60.6%
*-un-lft-identity60.6%
Applied egg-rr60.6%
Final simplification71.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 (<= y -5e-129) (/ x (* y (- t z))) (if (<= y 6.5e-47) (/ x (* z (- z t))) (/ (/ x t) y))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -5e-129) {
tmp = x / (y * (t - z));
} else if (y <= 6.5e-47) {
tmp = x / (z * (z - t));
} 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 (y <= (-5d-129)) then
tmp = x / (y * (t - z))
else if (y <= 6.5d-47) then
tmp = x / (z * (z - t))
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 (y <= -5e-129) {
tmp = x / (y * (t - z));
} else if (y <= 6.5e-47) {
tmp = x / (z * (z - t));
} 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 y <= -5e-129: tmp = x / (y * (t - z)) elif y <= 6.5e-47: tmp = x / (z * (z - t)) 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 (y <= -5e-129) tmp = Float64(x / Float64(y * Float64(t - z))); elseif (y <= 6.5e-47) tmp = Float64(x / Float64(z * Float64(z - t))); 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 (y <= -5e-129)
tmp = x / (y * (t - z));
elseif (y <= 6.5e-47)
tmp = x / (z * (z - t));
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[LessEqual[y, -5e-129], N[(x / N[(y * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 6.5e-47], N[(x / N[(z * N[(z - t), $MachinePrecision]), $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}\;y \leq -5 \cdot 10^{-129}:\\
\;\;\;\;\frac{x}{y \cdot \left(t - z\right)}\\
\mathbf{elif}\;y \leq 6.5 \cdot 10^{-47}:\\
\;\;\;\;\frac{x}{z \cdot \left(z - t\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{t}}{y}\\
\end{array}
\end{array}
if y < -5.00000000000000027e-129Initial program 85.6%
Taylor expanded in y around inf 72.2%
*-commutative72.2%
Simplified72.2%
if -5.00000000000000027e-129 < y < 6.5000000000000004e-47Initial program 93.6%
Taylor expanded in y around 0 80.2%
mul-1-neg80.2%
distribute-rgt-neg-in80.2%
sub-neg80.2%
+-commutative80.2%
distribute-neg-in80.2%
remove-double-neg80.2%
unsub-neg80.2%
Simplified80.2%
if 6.5000000000000004e-47 < y Initial program 93.1%
Taylor expanded in z around 0 56.2%
associate-/r*58.7%
div-inv58.6%
Applied egg-rr58.6%
un-div-inv58.7%
Applied egg-rr58.7%
Final simplification71.0%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= y -2.15e-157) (/ (/ x y) t) (if (<= y 9e-75) (/ x (* z (- t))) (/ (/ x t) y))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -2.15e-157) {
tmp = (x / y) / t;
} else if (y <= 9e-75) {
tmp = x / (z * -t);
} 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 (y <= (-2.15d-157)) then
tmp = (x / y) / t
else if (y <= 9d-75) then
tmp = x / (z * -t)
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 (y <= -2.15e-157) {
tmp = (x / y) / t;
} else if (y <= 9e-75) {
tmp = x / (z * -t);
} 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 y <= -2.15e-157: tmp = (x / y) / t elif y <= 9e-75: tmp = x / (z * -t) 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 (y <= -2.15e-157) tmp = Float64(Float64(x / y) / t); elseif (y <= 9e-75) tmp = Float64(x / Float64(z * Float64(-t))); 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 (y <= -2.15e-157)
tmp = (x / y) / t;
elseif (y <= 9e-75)
tmp = x / (z * -t);
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[LessEqual[y, -2.15e-157], N[(N[(x / y), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[y, 9e-75], N[(x / N[(z * (-t)), $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}\;y \leq -2.15 \cdot 10^{-157}:\\
\;\;\;\;\frac{\frac{x}{y}}{t}\\
\mathbf{elif}\;y \leq 9 \cdot 10^{-75}:\\
\;\;\;\;\frac{x}{z \cdot \left(-t\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{t}}{y}\\
\end{array}
\end{array}
if y < -2.1499999999999999e-157Initial program 85.0%
Taylor expanded in y around inf 68.0%
associate-/r*70.7%
Simplified70.7%
Taylor expanded in t around inf 54.8%
if -2.1499999999999999e-157 < y < 9.0000000000000006e-75Initial program 95.1%
associate-/l/98.5%
Simplified98.5%
Taylor expanded in t around inf 52.0%
Taylor expanded in y around 0 41.1%
associate-*r/41.1%
neg-mul-141.1%
*-commutative41.1%
Simplified41.1%
if 9.0000000000000006e-75 < y Initial program 93.4%
Taylor expanded in z around 0 54.2%
associate-/r*56.6%
div-inv56.5%
Applied egg-rr56.5%
un-div-inv56.6%
Applied egg-rr56.6%
Final simplification51.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 (or (<= z -2.2e+97) (not (<= z 35000.0))) (/ 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 <= -2.2e+97) || !(z <= 35000.0)) {
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 <= (-2.2d+97)) .or. (.not. (z <= 35000.0d0))) 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 <= -2.2e+97) || !(z <= 35000.0)) {
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 <= -2.2e+97) or not (z <= 35000.0): 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 <= -2.2e+97) || !(z <= 35000.0)) tmp = Float64(x / 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 <= -2.2e+97) || ~((z <= 35000.0)))
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, -2.2e+97], N[Not[LessEqual[z, 35000.0]], $MachinePrecision]], N[(x / N[(z * t), $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 -2.2 \cdot 10^{+97} \lor \neg \left(z \leq 35000\right):\\
\;\;\;\;\frac{x}{z \cdot t}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{t}\\
\end{array}
\end{array}
if z < -2.2000000000000001e97 or 35000 < z Initial program 85.1%
associate-/l/99.8%
Simplified99.8%
Taylor expanded in t around inf 39.2%
Taylor expanded in y around 0 37.3%
mul-1-neg37.3%
associate-/r*36.7%
distribute-neg-frac236.7%
Simplified36.7%
add-sqr-sqrt9.1%
sqrt-unprod50.9%
sqr-neg50.9%
sqrt-unprod25.6%
add-sqr-sqrt34.2%
*-un-lft-identity34.2%
associate-/l/35.2%
*-commutative35.2%
Applied egg-rr35.2%
*-lft-identity35.2%
*-commutative35.2%
Simplified35.2%
if -2.2000000000000001e97 < z < 35000Initial program 94.0%
Taylor expanded in y around inf 72.6%
associate-/r*74.5%
Simplified74.5%
Taylor expanded in t around inf 61.3%
Final simplification51.1%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (or (<= z -1.8e+98) (not (<= z 3.8e+85))) (/ x (* z t)) (/ (/ x t) y)))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.8e+98) || !(z <= 3.8e+85)) {
tmp = x / (z * t);
} 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 <= (-1.8d+98)) .or. (.not. (z <= 3.8d+85))) then
tmp = x / (z * t)
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 <= -1.8e+98) || !(z <= 3.8e+85)) {
tmp = x / (z * t);
} 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 <= -1.8e+98) or not (z <= 3.8e+85): tmp = x / (z * t) 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 <= -1.8e+98) || !(z <= 3.8e+85)) tmp = Float64(x / Float64(z * t)); 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 <= -1.8e+98) || ~((z <= 3.8e+85)))
tmp = x / (z * t);
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, -1.8e+98], N[Not[LessEqual[z, 3.8e+85]], $MachinePrecision]], N[(x / N[(z * t), $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 -1.8 \cdot 10^{+98} \lor \neg \left(z \leq 3.8 \cdot 10^{+85}\right):\\
\;\;\;\;\frac{x}{z \cdot t}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{t}}{y}\\
\end{array}
\end{array}
if z < -1.7999999999999999e98 or 3.79999999999999992e85 < z Initial program 81.9%
associate-/l/99.8%
Simplified99.8%
Taylor expanded in t around inf 38.5%
Taylor expanded in y around 0 37.4%
mul-1-neg37.4%
associate-/r*36.7%
distribute-neg-frac236.7%
Simplified36.7%
add-sqr-sqrt11.1%
sqrt-unprod56.5%
sqr-neg56.5%
sqrt-unprod25.6%
add-sqr-sqrt36.2%
*-un-lft-identity36.2%
associate-/l/37.3%
*-commutative37.3%
Applied egg-rr37.3%
*-lft-identity37.3%
*-commutative37.3%
Simplified37.3%
if -1.7999999999999999e98 < z < 3.79999999999999992e85Initial program 94.6%
Taylor expanded in z around 0 51.5%
associate-/r*57.8%
div-inv57.8%
Applied egg-rr57.8%
un-div-inv57.8%
Applied egg-rr57.8%
Final simplification51.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 (or (<= z -2.4e+97) (not (<= z 1.96e-66))) (/ 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 <= -2.4e+97) || !(z <= 1.96e-66)) {
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 <= (-2.4d+97)) .or. (.not. (z <= 1.96d-66))) 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 <= -2.4e+97) || !(z <= 1.96e-66)) {
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 <= -2.4e+97) or not (z <= 1.96e-66): 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 <= -2.4e+97) || !(z <= 1.96e-66)) 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 <= -2.4e+97) || ~((z <= 1.96e-66)))
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, -2.4e+97], N[Not[LessEqual[z, 1.96e-66]], $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 -2.4 \cdot 10^{+97} \lor \neg \left(z \leq 1.96 \cdot 10^{-66}\right):\\
\;\;\;\;\frac{x}{z \cdot t}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y \cdot t}\\
\end{array}
\end{array}
if z < -2.4e97 or 1.95999999999999997e-66 < z Initial program 86.7%
associate-/l/99.9%
Simplified99.9%
Taylor expanded in t around inf 41.6%
Taylor expanded in y around 0 39.2%
mul-1-neg39.2%
associate-/r*38.7%
distribute-neg-frac238.7%
Simplified38.7%
add-sqr-sqrt7.6%
sqrt-unprod48.1%
sqr-neg48.1%
sqrt-unprod26.8%
add-sqr-sqrt34.1%
*-un-lft-identity34.1%
associate-/l/34.9%
*-commutative34.9%
Applied egg-rr34.9%
*-lft-identity34.9%
*-commutative34.9%
Simplified34.9%
if -2.4e97 < z < 1.95999999999999997e-66Initial program 93.9%
Taylor expanded in z around 0 59.6%
Final simplification48.1%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= z -7.4e+105) (/ (* x (/ -1.0 z)) (- t z)) (/ x (* (- y z) (- t z)))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -7.4e+105) {
tmp = (x * (-1.0 / z)) / (t - z);
} else {
tmp = x / ((y - z) * (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 <= (-7.4d+105)) then
tmp = (x * ((-1.0d0) / z)) / (t - z)
else
tmp = x / ((y - z) * (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 <= -7.4e+105) {
tmp = (x * (-1.0 / z)) / (t - z);
} else {
tmp = x / ((y - z) * (t - z));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if z <= -7.4e+105: tmp = (x * (-1.0 / z)) / (t - z) else: tmp = x / ((y - z) * (t - z)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (z <= -7.4e+105) tmp = Float64(Float64(x * Float64(-1.0 / z)) / Float64(t - z)); else tmp = Float64(x / Float64(Float64(y - z) * 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 <= -7.4e+105)
tmp = (x * (-1.0 / z)) / (t - z);
else
tmp = x / ((y - z) * (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, -7.4e+105], N[(N[(x * N[(-1.0 / z), $MachinePrecision]), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], N[(x / N[(N[(y - z), $MachinePrecision] * 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 -7.4 \cdot 10^{+105}:\\
\;\;\;\;\frac{x \cdot \frac{-1}{z}}{t - z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\left(y - z\right) \cdot \left(t - z\right)}\\
\end{array}
\end{array}
if z < -7.3999999999999997e105Initial program 67.4%
associate-/l/99.8%
clear-num97.7%
inv-pow97.7%
div-inv97.6%
clear-num97.7%
Applied egg-rr97.7%
unpow-197.7%
Simplified97.7%
clear-num97.6%
associate-/r/97.6%
Applied egg-rr97.6%
*-un-lft-identity97.6%
associate-/r*99.7%
associate-*l/99.7%
*-un-lft-identity99.7%
associate-/r/69.8%
Applied egg-rr69.8%
*-lft-identity69.8%
associate-*l/99.7%
Simplified99.7%
Taylor expanded in y around 0 87.1%
if -7.3999999999999997e105 < z Initial program 94.5%
Final simplification93.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 -5e+143) (/ (/ x z) (- z y)) (/ x (* (- y z) (- t z)))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -5e+143) {
tmp = (x / z) / (z - y);
} else {
tmp = x / ((y - z) * (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 <= (-5d+143)) then
tmp = (x / z) / (z - y)
else
tmp = x / ((y - z) * (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 <= -5e+143) {
tmp = (x / z) / (z - y);
} else {
tmp = x / ((y - z) * (t - z));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if z <= -5e+143: tmp = (x / z) / (z - y) else: tmp = x / ((y - z) * (t - z)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (z <= -5e+143) tmp = Float64(Float64(x / z) / Float64(z - y)); else tmp = Float64(x / Float64(Float64(y - z) * 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 <= -5e+143)
tmp = (x / z) / (z - y);
else
tmp = x / ((y - z) * (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, -5e+143], N[(N[(x / z), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision], N[(x / N[(N[(y - z), $MachinePrecision] * 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 \cdot 10^{+143}:\\
\;\;\;\;\frac{\frac{x}{z}}{z - y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\left(y - z\right) \cdot \left(t - z\right)}\\
\end{array}
\end{array}
if z < -5.00000000000000012e143Initial program 65.5%
Taylor expanded in t around 0 65.5%
mul-1-neg65.5%
associate-/r*95.3%
distribute-neg-frac295.3%
neg-sub095.3%
sub-neg95.3%
+-commutative95.3%
associate--r+95.3%
neg-sub095.3%
remove-double-neg95.3%
Simplified95.3%
if -5.00000000000000012e143 < z Initial program 93.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 (* 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 90.6%
Taylor expanded in z around 0 41.6%
Final simplification41.6%
(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 2024181
(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))))