
(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 13 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 88.0%
associate-/l/97.2%
Simplified97.2%
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)))
(if (<= z -4.4e+164)
t_1
(if (<= z -2.3e-49)
(/ x (* z (- z t)))
(if (<= z 5.8e-86)
(/ x (* (- t z) y))
(if (<= z 2.9e+238) (/ 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;
double tmp;
if (z <= -4.4e+164) {
tmp = t_1;
} else if (z <= -2.3e-49) {
tmp = x / (z * (z - t));
} else if (z <= 5.8e-86) {
tmp = x / ((t - z) * y);
} else if (z <= 2.9e+238) {
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
if (z <= (-4.4d+164)) then
tmp = t_1
else if (z <= (-2.3d-49)) then
tmp = x / (z * (z - t))
else if (z <= 5.8d-86) then
tmp = x / ((t - z) * y)
else if (z <= 2.9d+238) 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;
double tmp;
if (z <= -4.4e+164) {
tmp = t_1;
} else if (z <= -2.3e-49) {
tmp = x / (z * (z - t));
} else if (z <= 5.8e-86) {
tmp = x / ((t - z) * y);
} else if (z <= 2.9e+238) {
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 tmp = 0 if z <= -4.4e+164: tmp = t_1 elif z <= -2.3e-49: tmp = x / (z * (z - t)) elif z <= 5.8e-86: tmp = x / ((t - z) * y) elif z <= 2.9e+238: 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) / z) tmp = 0.0 if (z <= -4.4e+164) tmp = t_1; elseif (z <= -2.3e-49) tmp = Float64(x / Float64(z * Float64(z - t))); elseif (z <= 5.8e-86) tmp = Float64(x / Float64(Float64(t - z) * y)); elseif (z <= 2.9e+238) 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;
tmp = 0.0;
if (z <= -4.4e+164)
tmp = t_1;
elseif (z <= -2.3e-49)
tmp = x / (z * (z - t));
elseif (z <= 5.8e-86)
tmp = x / ((t - z) * y);
elseif (z <= 2.9e+238)
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] / z), $MachinePrecision]}, If[LessEqual[z, -4.4e+164], t$95$1, If[LessEqual[z, -2.3e-49], N[(x / N[(z * N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 5.8e-86], N[(x / N[(N[(t - z), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.9e+238], 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}\\
\mathbf{if}\;z \leq -4.4 \cdot 10^{+164}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -2.3 \cdot 10^{-49}:\\
\;\;\;\;\frac{x}{z \cdot \left(z - t\right)}\\
\mathbf{elif}\;z \leq 5.8 \cdot 10^{-86}:\\
\;\;\;\;\frac{x}{\left(t - z\right) \cdot y}\\
\mathbf{elif}\;z \leq 2.9 \cdot 10^{+238}:\\
\;\;\;\;\frac{x}{z \cdot \left(z - y\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -4.40000000000000011e164 or 2.9000000000000002e238 < z Initial program 72.8%
Taylor expanded in y around 0 72.8%
mul-1-neg72.8%
associate-/r*96.2%
distribute-neg-frac296.2%
sub-neg96.2%
+-commutative96.2%
distribute-neg-in96.2%
remove-double-neg96.2%
unsub-neg96.2%
Simplified96.2%
Taylor expanded in z around inf 96.2%
if -4.40000000000000011e164 < z < -2.2999999999999999e-49Initial program 88.3%
Taylor expanded in y around 0 56.1%
mul-1-neg56.1%
distribute-rgt-neg-in56.1%
sub-neg56.1%
+-commutative56.1%
distribute-neg-in56.1%
remove-double-neg56.1%
unsub-neg56.1%
Simplified56.1%
if -2.2999999999999999e-49 < z < 5.7999999999999998e-86Initial program 92.9%
Taylor expanded in y around inf 81.6%
*-commutative81.6%
Simplified81.6%
if 5.7999999999999998e-86 < z < 2.9000000000000002e238Initial program 91.9%
Taylor expanded in t around 0 76.2%
mul-1-neg76.2%
distribute-rgt-neg-in76.2%
neg-sub076.2%
sub-neg76.2%
+-commutative76.2%
associate--r+76.2%
neg-sub076.2%
remove-double-neg76.2%
Simplified76.2%
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)))
(if (<= z -4.6e+164)
t_1
(if (<= z -9.2e-45)
(/ x (* z (- z t)))
(if (<= z 1.75e-87)
(/ (/ x t) y)
(if (<= z 4.9e+238) (/ 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;
double tmp;
if (z <= -4.6e+164) {
tmp = t_1;
} else if (z <= -9.2e-45) {
tmp = x / (z * (z - t));
} else if (z <= 1.75e-87) {
tmp = (x / t) / y;
} else if (z <= 4.9e+238) {
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
if (z <= (-4.6d+164)) then
tmp = t_1
else if (z <= (-9.2d-45)) then
tmp = x / (z * (z - t))
else if (z <= 1.75d-87) then
tmp = (x / t) / y
else if (z <= 4.9d+238) 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;
double tmp;
if (z <= -4.6e+164) {
tmp = t_1;
} else if (z <= -9.2e-45) {
tmp = x / (z * (z - t));
} else if (z <= 1.75e-87) {
tmp = (x / t) / y;
} else if (z <= 4.9e+238) {
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 tmp = 0 if z <= -4.6e+164: tmp = t_1 elif z <= -9.2e-45: tmp = x / (z * (z - t)) elif z <= 1.75e-87: tmp = (x / t) / y elif z <= 4.9e+238: 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) / z) tmp = 0.0 if (z <= -4.6e+164) tmp = t_1; elseif (z <= -9.2e-45) tmp = Float64(x / Float64(z * Float64(z - t))); elseif (z <= 1.75e-87) tmp = Float64(Float64(x / t) / y); elseif (z <= 4.9e+238) 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;
tmp = 0.0;
if (z <= -4.6e+164)
tmp = t_1;
elseif (z <= -9.2e-45)
tmp = x / (z * (z - t));
elseif (z <= 1.75e-87)
tmp = (x / t) / y;
elseif (z <= 4.9e+238)
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] / z), $MachinePrecision]}, If[LessEqual[z, -4.6e+164], t$95$1, If[LessEqual[z, -9.2e-45], N[(x / N[(z * N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.75e-87], N[(N[(x / t), $MachinePrecision] / y), $MachinePrecision], If[LessEqual[z, 4.9e+238], 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}\\
\mathbf{if}\;z \leq -4.6 \cdot 10^{+164}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -9.2 \cdot 10^{-45}:\\
\;\;\;\;\frac{x}{z \cdot \left(z - t\right)}\\
\mathbf{elif}\;z \leq 1.75 \cdot 10^{-87}:\\
\;\;\;\;\frac{\frac{x}{t}}{y}\\
\mathbf{elif}\;z \leq 4.9 \cdot 10^{+238}:\\
\;\;\;\;\frac{x}{z \cdot \left(z - y\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -4.5999999999999999e164 or 4.90000000000000027e238 < z Initial program 72.8%
Taylor expanded in y around 0 72.8%
mul-1-neg72.8%
associate-/r*96.2%
distribute-neg-frac296.2%
sub-neg96.2%
+-commutative96.2%
distribute-neg-in96.2%
remove-double-neg96.2%
unsub-neg96.2%
Simplified96.2%
Taylor expanded in z around inf 96.2%
if -4.5999999999999999e164 < z < -9.19999999999999967e-45Initial program 90.1%
Taylor expanded in y around 0 56.4%
mul-1-neg56.4%
distribute-rgt-neg-in56.4%
sub-neg56.4%
+-commutative56.4%
distribute-neg-in56.4%
remove-double-neg56.4%
unsub-neg56.4%
Simplified56.4%
if -9.19999999999999967e-45 < z < 1.75000000000000006e-87Initial program 92.1%
associate-/l/94.1%
Simplified94.1%
clear-num93.9%
associate-/r/93.9%
Applied egg-rr93.9%
Taylor expanded in z around 0 65.2%
associate-/r*69.9%
Simplified69.9%
if 1.75000000000000006e-87 < z < 4.90000000000000027e238Initial program 91.9%
Taylor expanded in t around 0 76.2%
mul-1-neg76.2%
distribute-rgt-neg-in76.2%
neg-sub076.2%
sub-neg76.2%
+-commutative76.2%
associate--r+76.2%
neg-sub076.2%
remove-double-neg76.2%
Simplified76.2%
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 t)))))
(if (<= z -4.4e+164)
t_1
(if (<= z -1.15e-44)
t_2
(if (<= z 9.8e-88) (/ (/ x t) y) (if (<= z 2.9e+238) 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 - t));
double tmp;
if (z <= -4.4e+164) {
tmp = t_1;
} else if (z <= -1.15e-44) {
tmp = t_2;
} else if (z <= 9.8e-88) {
tmp = (x / t) / y;
} else if (z <= 2.9e+238) {
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 - t))
if (z <= (-4.4d+164)) then
tmp = t_1
else if (z <= (-1.15d-44)) then
tmp = t_2
else if (z <= 9.8d-88) then
tmp = (x / t) / y
else if (z <= 2.9d+238) 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 - t));
double tmp;
if (z <= -4.4e+164) {
tmp = t_1;
} else if (z <= -1.15e-44) {
tmp = t_2;
} else if (z <= 9.8e-88) {
tmp = (x / t) / y;
} else if (z <= 2.9e+238) {
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 - t)) tmp = 0 if z <= -4.4e+164: tmp = t_1 elif z <= -1.15e-44: tmp = t_2 elif z <= 9.8e-88: tmp = (x / t) / y elif z <= 2.9e+238: 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 - t))) tmp = 0.0 if (z <= -4.4e+164) tmp = t_1; elseif (z <= -1.15e-44) tmp = t_2; elseif (z <= 9.8e-88) tmp = Float64(Float64(x / t) / y); elseif (z <= 2.9e+238) 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 - t));
tmp = 0.0;
if (z <= -4.4e+164)
tmp = t_1;
elseif (z <= -1.15e-44)
tmp = t_2;
elseif (z <= 9.8e-88)
tmp = (x / t) / y;
elseif (z <= 2.9e+238)
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 - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -4.4e+164], t$95$1, If[LessEqual[z, -1.15e-44], t$95$2, If[LessEqual[z, 9.8e-88], N[(N[(x / t), $MachinePrecision] / y), $MachinePrecision], If[LessEqual[z, 2.9e+238], 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 - t\right)}\\
\mathbf{if}\;z \leq -4.4 \cdot 10^{+164}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -1.15 \cdot 10^{-44}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq 9.8 \cdot 10^{-88}:\\
\;\;\;\;\frac{\frac{x}{t}}{y}\\
\mathbf{elif}\;z \leq 2.9 \cdot 10^{+238}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -4.40000000000000011e164 or 2.9000000000000002e238 < z Initial program 72.8%
Taylor expanded in y around 0 72.8%
mul-1-neg72.8%
associate-/r*96.2%
distribute-neg-frac296.2%
sub-neg96.2%
+-commutative96.2%
distribute-neg-in96.2%
remove-double-neg96.2%
unsub-neg96.2%
Simplified96.2%
Taylor expanded in z around inf 96.2%
if -4.40000000000000011e164 < z < -1.14999999999999999e-44 or 9.80000000000000055e-88 < z < 2.9000000000000002e238Initial program 91.3%
Taylor expanded in y around 0 65.9%
mul-1-neg65.9%
distribute-rgt-neg-in65.9%
sub-neg65.9%
+-commutative65.9%
distribute-neg-in65.9%
remove-double-neg65.9%
unsub-neg65.9%
Simplified65.9%
if -1.14999999999999999e-44 < z < 9.80000000000000055e-88Initial program 92.1%
associate-/l/94.1%
Simplified94.1%
clear-num93.9%
associate-/r/93.9%
Applied egg-rr93.9%
Taylor expanded in z around 0 65.2%
associate-/r*69.9%
Simplified69.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 -5.2e+110)
(/ (/ x z) (- z t))
(if (<= z 5.4e+129)
(/ x (* (- t z) (- y z)))
(* (/ x (- y z)) (/ -1.0 z)))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -5.2e+110) {
tmp = (x / z) / (z - t);
} else if (z <= 5.4e+129) {
tmp = x / ((t - z) * (y - z));
} else {
tmp = (x / (y - z)) * (-1.0 / 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.2d+110)) then
tmp = (x / z) / (z - t)
else if (z <= 5.4d+129) then
tmp = x / ((t - z) * (y - z))
else
tmp = (x / (y - z)) * ((-1.0d0) / 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.2e+110) {
tmp = (x / z) / (z - t);
} else if (z <= 5.4e+129) {
tmp = x / ((t - z) * (y - z));
} else {
tmp = (x / (y - z)) * (-1.0 / z);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if z <= -5.2e+110: tmp = (x / z) / (z - t) elif z <= 5.4e+129: tmp = x / ((t - z) * (y - z)) else: tmp = (x / (y - z)) * (-1.0 / z) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (z <= -5.2e+110) tmp = Float64(Float64(x / z) / Float64(z - t)); elseif (z <= 5.4e+129) tmp = Float64(x / Float64(Float64(t - z) * Float64(y - z))); else tmp = Float64(Float64(x / Float64(y - z)) * Float64(-1.0 / 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.2e+110)
tmp = (x / z) / (z - t);
elseif (z <= 5.4e+129)
tmp = x / ((t - z) * (y - z));
else
tmp = (x / (y - z)) * (-1.0 / 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.2e+110], N[(N[(x / z), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 5.4e+129], N[(x / N[(N[(t - z), $MachinePrecision] * N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(y - z), $MachinePrecision]), $MachinePrecision] * N[(-1.0 / z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.2 \cdot 10^{+110}:\\
\;\;\;\;\frac{\frac{x}{z}}{z - t}\\
\mathbf{elif}\;z \leq 5.4 \cdot 10^{+129}:\\
\;\;\;\;\frac{x}{\left(t - z\right) \cdot \left(y - z\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y - z} \cdot \frac{-1}{z}\\
\end{array}
\end{array}
if z < -5.2e110Initial program 70.9%
Taylor expanded in y around 0 68.6%
mul-1-neg68.6%
associate-/r*92.6%
distribute-neg-frac292.6%
sub-neg92.6%
+-commutative92.6%
distribute-neg-in92.6%
remove-double-neg92.6%
unsub-neg92.6%
Simplified92.6%
if -5.2e110 < z < 5.4000000000000002e129Initial program 92.6%
if 5.4000000000000002e129 < z Initial program 85.0%
associate-/l/99.9%
Simplified99.9%
clear-num99.9%
associate-/r/99.9%
Applied egg-rr99.9%
Taylor expanded in t around 0 95.9%
associate-/l*95.9%
*-commutative95.9%
Applied egg-rr95.9%
Final simplification93.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 (or (<= z -35000000.0) (not (<= z 6.8e-87))) (/ (/ 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 ((z <= -35000000.0) || !(z <= 6.8e-87)) {
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 ((z <= (-35000000.0d0)) .or. (.not. (z <= 6.8d-87))) 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 ((z <= -35000000.0) || !(z <= 6.8e-87)) {
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 (z <= -35000000.0) or not (z <= 6.8e-87): 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 ((z <= -35000000.0) || !(z <= 6.8e-87)) 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 ((z <= -35000000.0) || ~((z <= 6.8e-87)))
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[Or[LessEqual[z, -35000000.0], N[Not[LessEqual[z, 6.8e-87]], $MachinePrecision]], 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}\;z \leq -35000000 \lor \neg \left(z \leq 6.8 \cdot 10^{-87}\right):\\
\;\;\;\;\frac{\frac{x}{z}}{z - t}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{t}}{y - z}\\
\end{array}
\end{array}
if z < -3.5e7 or 6.7999999999999997e-87 < z Initial program 85.0%
Taylor expanded in y around 0 69.4%
mul-1-neg69.4%
associate-/r*79.2%
distribute-neg-frac279.2%
sub-neg79.2%
+-commutative79.2%
distribute-neg-in79.2%
remove-double-neg79.2%
unsub-neg79.2%
Simplified79.2%
if -3.5e7 < z < 6.7999999999999997e-87Initial program 92.0%
associate-/l/93.8%
Simplified93.8%
Taylor expanded in t around inf 77.6%
Final simplification78.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 (<= z -150000.0) (/ (/ x z) (- z t)) (if (<= z 1.25e-19) (/ (/ x t) (- y z)) (/ (/ x (- z y)) z))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -150000.0) {
tmp = (x / z) / (z - t);
} else if (z <= 1.25e-19) {
tmp = (x / t) / (y - z);
} else {
tmp = (x / (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) :: tmp
if (z <= (-150000.0d0)) then
tmp = (x / z) / (z - t)
else if (z <= 1.25d-19) then
tmp = (x / t) / (y - z)
else
tmp = (x / (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 tmp;
if (z <= -150000.0) {
tmp = (x / z) / (z - t);
} else if (z <= 1.25e-19) {
tmp = (x / t) / (y - z);
} else {
tmp = (x / (z - y)) / z;
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if z <= -150000.0: tmp = (x / z) / (z - t) elif z <= 1.25e-19: tmp = (x / t) / (y - z) else: tmp = (x / (z - y)) / z return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (z <= -150000.0) tmp = Float64(Float64(x / z) / Float64(z - t)); elseif (z <= 1.25e-19) tmp = Float64(Float64(x / t) / Float64(y - z)); else tmp = Float64(Float64(x / Float64(z - 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 <= -150000.0)
tmp = (x / z) / (z - t);
elseif (z <= 1.25e-19)
tmp = (x / t) / (y - z);
else
tmp = (x / (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_] := If[LessEqual[z, -150000.0], N[(N[(x / z), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.25e-19], N[(N[(x / t), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(z - y), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -150000:\\
\;\;\;\;\frac{\frac{x}{z}}{z - t}\\
\mathbf{elif}\;z \leq 1.25 \cdot 10^{-19}:\\
\;\;\;\;\frac{\frac{x}{t}}{y - z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{z - y}}{z}\\
\end{array}
\end{array}
if z < -1.5e5Initial program 79.3%
Taylor expanded in y around 0 64.9%
mul-1-neg64.9%
associate-/r*80.7%
distribute-neg-frac280.7%
sub-neg80.7%
+-commutative80.7%
distribute-neg-in80.7%
remove-double-neg80.7%
unsub-neg80.7%
Simplified80.7%
if -1.5e5 < z < 1.2500000000000001e-19Initial program 92.8%
associate-/l/94.4%
Simplified94.4%
Taylor expanded in t around inf 73.0%
if 1.2500000000000001e-19 < z Initial program 86.9%
associate-/l/99.8%
Simplified99.8%
clear-num99.7%
associate-/r/99.8%
Applied egg-rr99.8%
Taylor expanded in t around 0 88.5%
associate-/l*88.5%
*-commutative88.5%
Applied egg-rr88.5%
*-un-lft-identity88.5%
associate-*l/88.4%
frac-2neg88.4%
metadata-eval88.4%
un-div-inv88.5%
associate-*l/88.5%
*-un-lft-identity88.5%
Applied egg-rr88.5%
Final simplification79.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 (<= t -7.5e-177) (/ x (* (- t z) y)) (if (<= t 4.9e-105) (/ 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 <= -7.5e-177) {
tmp = x / ((t - z) * y);
} else if (t <= 4.9e-105) {
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 <= (-7.5d-177)) then
tmp = x / ((t - z) * y)
else if (t <= 4.9d-105) 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 <= -7.5e-177) {
tmp = x / ((t - z) * y);
} else if (t <= 4.9e-105) {
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 <= -7.5e-177: tmp = x / ((t - z) * y) elif t <= 4.9e-105: 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 <= -7.5e-177) tmp = Float64(x / Float64(Float64(t - z) * y)); elseif (t <= 4.9e-105) tmp = Float64(x / Float64(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 <= -7.5e-177)
tmp = x / ((t - z) * y);
elseif (t <= 4.9e-105)
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, -7.5e-177], N[(x / N[(N[(t - z), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 4.9e-105], N[(x / N[(z * N[(z - y), $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}\;t \leq -7.5 \cdot 10^{-177}:\\
\;\;\;\;\frac{x}{\left(t - z\right) \cdot y}\\
\mathbf{elif}\;t \leq 4.9 \cdot 10^{-105}:\\
\;\;\;\;\frac{x}{z \cdot \left(z - y\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{t}}{y - z}\\
\end{array}
\end{array}
if t < -7.5e-177Initial program 91.2%
Taylor expanded in y around inf 58.2%
*-commutative58.2%
Simplified58.2%
if -7.5e-177 < t < 4.9e-105Initial program 87.0%
Taylor expanded in t around 0 76.1%
mul-1-neg76.1%
distribute-rgt-neg-in76.1%
neg-sub076.1%
sub-neg76.1%
+-commutative76.1%
associate--r+76.1%
neg-sub076.1%
remove-double-neg76.1%
Simplified76.1%
if 4.9e-105 < t Initial program 85.5%
associate-/l/99.8%
Simplified99.8%
Taylor expanded in t around inf 78.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 -5.8e+43) (not (<= z 4.2e+33))) (/ (/ 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 <= -5.8e+43) || !(z <= 4.2e+33)) {
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 <= (-5.8d+43)) .or. (.not. (z <= 4.2d+33))) 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 <= -5.8e+43) || !(z <= 4.2e+33)) {
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 <= -5.8e+43) or not (z <= 4.2e+33): 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 <= -5.8e+43) || !(z <= 4.2e+33)) 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 <= -5.8e+43) || ~((z <= 4.2e+33)))
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, -5.8e+43], N[Not[LessEqual[z, 4.2e+33]], $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 -5.8 \cdot 10^{+43} \lor \neg \left(z \leq 4.2 \cdot 10^{+33}\right):\\
\;\;\;\;\frac{\frac{x}{z}}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{t}}{y}\\
\end{array}
\end{array}
if z < -5.8000000000000004e43 or 4.2000000000000001e33 < z Initial program 82.2%
Taylor expanded in y around 0 73.2%
mul-1-neg73.2%
associate-/r*85.3%
distribute-neg-frac285.3%
sub-neg85.3%
+-commutative85.3%
distribute-neg-in85.3%
remove-double-neg85.3%
unsub-neg85.3%
Simplified85.3%
Taylor expanded in z around inf 78.2%
if -5.8000000000000004e43 < z < 4.2000000000000001e33Initial program 92.9%
associate-/l/95.0%
Simplified95.0%
clear-num94.8%
associate-/r/94.9%
Applied egg-rr94.9%
Taylor expanded in z around 0 56.1%
associate-/r*60.8%
Simplified60.8%
Final simplification68.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 -5.2e+43) (not (<= z 2.5e+34))) (/ 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 <= -5.2e+43) || !(z <= 2.5e+34)) {
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 <= (-5.2d+43)) .or. (.not. (z <= 2.5d+34))) 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 <= -5.2e+43) || !(z <= 2.5e+34)) {
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 <= -5.2e+43) or not (z <= 2.5e+34): 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 <= -5.2e+43) || !(z <= 2.5e+34)) 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 <= -5.2e+43) || ~((z <= 2.5e+34)))
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, -5.2e+43], N[Not[LessEqual[z, 2.5e+34]], $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 -5.2 \cdot 10^{+43} \lor \neg \left(z \leq 2.5 \cdot 10^{+34}\right):\\
\;\;\;\;\frac{x}{z \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{t}}{y}\\
\end{array}
\end{array}
if z < -5.20000000000000042e43 or 2.4999999999999999e34 < z Initial program 82.2%
Taylor expanded in t around 0 77.1%
mul-1-neg77.1%
distribute-rgt-neg-in77.1%
neg-sub077.1%
sub-neg77.1%
+-commutative77.1%
associate--r+77.1%
neg-sub077.1%
remove-double-neg77.1%
Simplified77.1%
Taylor expanded in z around inf 68.9%
if -5.20000000000000042e43 < z < 2.4999999999999999e34Initial program 92.9%
associate-/l/95.0%
Simplified95.0%
clear-num94.8%
associate-/r/94.9%
Applied egg-rr94.9%
Taylor expanded in z around 0 56.1%
associate-/r*60.8%
Simplified60.8%
Final simplification64.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 -5.5e+43) (not (<= z 5.2e-86))) (/ 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 <= -5.5e+43) || !(z <= 5.2e-86)) {
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 <= (-5.5d+43)) .or. (.not. (z <= 5.2d-86))) 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 <= -5.5e+43) || !(z <= 5.2e-86)) {
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 <= -5.5e+43) or not (z <= 5.2e-86): 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 <= -5.5e+43) || !(z <= 5.2e-86)) 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 <= -5.5e+43) || ~((z <= 5.2e-86)))
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, -5.5e+43], N[Not[LessEqual[z, 5.2e-86]], $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 -5.5 \cdot 10^{+43} \lor \neg \left(z \leq 5.2 \cdot 10^{-86}\right):\\
\;\;\;\;\frac{x}{z \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{t \cdot y}\\
\end{array}
\end{array}
if z < -5.49999999999999989e43 or 5.2000000000000002e-86 < z Initial program 84.4%
Taylor expanded in t around 0 73.5%
mul-1-neg73.5%
distribute-rgt-neg-in73.5%
neg-sub073.5%
sub-neg73.5%
+-commutative73.5%
associate--r+73.5%
neg-sub073.5%
remove-double-neg73.5%
Simplified73.5%
Taylor expanded in z around inf 61.8%
if -5.49999999999999989e43 < z < 5.2000000000000002e-86Initial program 92.4%
Taylor expanded in z around 0 62.2%
Final simplification62.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 -3.6e+104) (not (<= z 2.8e+129))) (/ x (* z y)) (/ 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.6e+104) || !(z <= 2.8e+129)) {
tmp = x / (z * y);
} 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.6d+104)) .or. (.not. (z <= 2.8d+129))) then
tmp = x / (z * y)
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.6e+104) || !(z <= 2.8e+129)) {
tmp = x / (z * y);
} 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.6e+104) or not (z <= 2.8e+129): tmp = x / (z * y) 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.6e+104) || !(z <= 2.8e+129)) tmp = Float64(x / Float64(z * y)); 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.6e+104) || ~((z <= 2.8e+129)))
tmp = x / (z * y);
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.6e+104], N[Not[LessEqual[z, 2.8e+129]], $MachinePrecision]], N[(x / N[(z * y), $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.6 \cdot 10^{+104} \lor \neg \left(z \leq 2.8 \cdot 10^{+129}\right):\\
\;\;\;\;\frac{x}{z \cdot y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{t \cdot y}\\
\end{array}
\end{array}
if z < -3.60000000000000001e104 or 2.79999999999999975e129 < z Initial program 78.6%
associate-/l/99.9%
Simplified99.9%
Taylor expanded in y around inf 50.7%
Taylor expanded in t around 0 46.1%
associate-*r/46.1%
neg-mul-146.1%
Simplified46.1%
*-un-lft-identity46.1%
associate-/l/43.2%
add-sqr-sqrt27.5%
sqrt-unprod37.6%
sqr-neg37.6%
sqrt-unprod15.7%
add-sqr-sqrt42.2%
Applied egg-rr42.2%
*-lft-identity42.2%
*-commutative42.2%
Simplified42.2%
if -3.60000000000000001e104 < z < 2.79999999999999975e129Initial program 92.6%
Taylor expanded in z around 0 50.9%
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 (/ 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 88.0%
Taylor expanded in z around 0 40.5%
(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 2024163
(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))))