
(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 12 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 (if (<= t 1e-251) (/ (/ x (- y z)) (- t z)) (/ (/ x (- t z)) (- y z))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (t <= 1e-251) {
tmp = (x / (y - z)) / (t - z);
} 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) :: tmp
if (t <= 1d-251) then
tmp = (x / (y - z)) / (t - z)
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 tmp;
if (t <= 1e-251) {
tmp = (x / (y - z)) / (t - z);
} else {
tmp = (x / (t - z)) / (y - z);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if t <= 1e-251: tmp = (x / (y - z)) / (t - z) else: tmp = (x / (t - z)) / (y - z) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (t <= 1e-251) tmp = Float64(Float64(x / Float64(y - z)) / Float64(t - z)); 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)
tmp = 0.0;
if (t <= 1e-251)
tmp = (x / (y - z)) / (t - z);
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_] := If[LessEqual[t, 1e-251], N[(N[(x / N[(y - z), $MachinePrecision]), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], 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}
\mathbf{if}\;t \leq 10^{-251}:\\
\;\;\;\;\frac{\frac{x}{y - z}}{t - z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{t - z}}{y - z}\\
\end{array}
\end{array}
if t < 1.00000000000000002e-251Initial program 90.1%
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f6498.5
Applied egg-rr98.5%
if 1.00000000000000002e-251 < t Initial program 85.1%
associate-/l/N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f6499.8
Applied egg-rr99.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 (* t y))) (t_2 (/ (- x) (* y z))))
(if (<= y -1.25e+254)
t_1
(if (<= y -1.4e+111)
t_2
(if (<= y -1.45e+61)
t_1
(if (<= y -85000.0)
t_2
(if (<= y 2.2e-9) (/ x (* z (- z t))) t_1)))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = x / (t * y);
double t_2 = -x / (y * z);
double tmp;
if (y <= -1.25e+254) {
tmp = t_1;
} else if (y <= -1.4e+111) {
tmp = t_2;
} else if (y <= -1.45e+61) {
tmp = t_1;
} else if (y <= -85000.0) {
tmp = t_2;
} else if (y <= 2.2e-9) {
tmp = x / (z * (z - t));
} 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 / (t * y)
t_2 = -x / (y * z)
if (y <= (-1.25d+254)) then
tmp = t_1
else if (y <= (-1.4d+111)) then
tmp = t_2
else if (y <= (-1.45d+61)) then
tmp = t_1
else if (y <= (-85000.0d0)) then
tmp = t_2
else if (y <= 2.2d-9) then
tmp = x / (z * (z - t))
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 / (t * y);
double t_2 = -x / (y * z);
double tmp;
if (y <= -1.25e+254) {
tmp = t_1;
} else if (y <= -1.4e+111) {
tmp = t_2;
} else if (y <= -1.45e+61) {
tmp = t_1;
} else if (y <= -85000.0) {
tmp = t_2;
} else if (y <= 2.2e-9) {
tmp = x / (z * (z - t));
} else {
tmp = t_1;
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = x / (t * y) t_2 = -x / (y * z) tmp = 0 if y <= -1.25e+254: tmp = t_1 elif y <= -1.4e+111: tmp = t_2 elif y <= -1.45e+61: tmp = t_1 elif y <= -85000.0: tmp = t_2 elif y <= 2.2e-9: tmp = x / (z * (z - t)) else: tmp = t_1 return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(x / Float64(t * y)) t_2 = Float64(Float64(-x) / Float64(y * z)) tmp = 0.0 if (y <= -1.25e+254) tmp = t_1; elseif (y <= -1.4e+111) tmp = t_2; elseif (y <= -1.45e+61) tmp = t_1; elseif (y <= -85000.0) tmp = t_2; elseif (y <= 2.2e-9) tmp = Float64(x / Float64(z * Float64(z - t))); 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 / (t * y);
t_2 = -x / (y * z);
tmp = 0.0;
if (y <= -1.25e+254)
tmp = t_1;
elseif (y <= -1.4e+111)
tmp = t_2;
elseif (y <= -1.45e+61)
tmp = t_1;
elseif (y <= -85000.0)
tmp = t_2;
elseif (y <= 2.2e-9)
tmp = x / (z * (z - t));
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[(x / N[(t * y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[((-x) / N[(y * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.25e+254], t$95$1, If[LessEqual[y, -1.4e+111], t$95$2, If[LessEqual[y, -1.45e+61], t$95$1, If[LessEqual[y, -85000.0], t$95$2, If[LessEqual[y, 2.2e-9], N[(x / N[(z * N[(z - t), $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{x}{t \cdot y}\\
t_2 := \frac{-x}{y \cdot z}\\
\mathbf{if}\;y \leq -1.25 \cdot 10^{+254}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -1.4 \cdot 10^{+111}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;y \leq -1.45 \cdot 10^{+61}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -85000:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;y \leq 2.2 \cdot 10^{-9}:\\
\;\;\;\;\frac{x}{z \cdot \left(z - t\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -1.24999999999999999e254 or -1.4e111 < y < -1.45e61 or 2.1999999999999998e-9 < y Initial program 82.3%
Taylor expanded in z around 0
/-lowering-/.f64N/A
*-lowering-*.f6465.3
Simplified65.3%
if -1.24999999999999999e254 < y < -1.4e111 or -1.45e61 < y < -85000Initial program 93.4%
Taylor expanded in y around inf
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
--lowering--.f6488.8
Simplified88.8%
Taylor expanded in t around 0
mul-1-negN/A
neg-lowering-neg.f6464.7
Simplified64.7%
if -85000 < y < 2.1999999999999998e-9Initial program 88.9%
Taylor expanded in y around 0
mul-1-negN/A
distribute-neg-frac2N/A
mul-1-negN/A
/-lowering-/.f64N/A
mul-1-negN/A
distribute-rgt-neg-inN/A
mul-1-negN/A
*-lowering-*.f64N/A
mul-1-negN/A
sub-negN/A
+-commutativeN/A
distribute-neg-inN/A
remove-double-negN/A
unsub-negN/A
--lowering--.f6471.2
Simplified71.2%
Final simplification68.5%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ (/ x z) (- z y))))
(if (<= z -1.55e+132)
t_1
(if (<= z 1.75e+81) (/ x (* (- y z) (- t z))) 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 - y);
double tmp;
if (z <= -1.55e+132) {
tmp = t_1;
} else if (z <= 1.75e+81) {
tmp = x / ((y - z) * (t - z));
} 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 - y)
if (z <= (-1.55d+132)) then
tmp = t_1
else if (z <= 1.75d+81) then
tmp = x / ((y - z) * (t - z))
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 - y);
double tmp;
if (z <= -1.55e+132) {
tmp = t_1;
} else if (z <= 1.75e+81) {
tmp = x / ((y - z) * (t - z));
} 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 - y) tmp = 0 if z <= -1.55e+132: tmp = t_1 elif z <= 1.75e+81: tmp = x / ((y - z) * (t - z)) else: tmp = t_1 return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(Float64(x / z) / Float64(z - y)) tmp = 0.0 if (z <= -1.55e+132) tmp = t_1; elseif (z <= 1.75e+81) tmp = Float64(x / Float64(Float64(y - z) * Float64(t - z))); 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 - y);
tmp = 0.0;
if (z <= -1.55e+132)
tmp = t_1;
elseif (z <= 1.75e+81)
tmp = x / ((y - z) * (t - z));
else
tmp = t_1;
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x / z), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.55e+132], t$95$1, If[LessEqual[z, 1.75e+81], N[(x / N[(N[(y - z), $MachinePrecision] * N[(t - z), $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 - y}\\
\mathbf{if}\;z \leq -1.55 \cdot 10^{+132}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.75 \cdot 10^{+81}:\\
\;\;\;\;\frac{x}{\left(y - z\right) \cdot \left(t - z\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.5499999999999999e132 or 1.75e81 < z Initial program 75.2%
associate-/l/N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f6499.9
Applied egg-rr99.9%
Taylor expanded in t around 0
mul-1-negN/A
distribute-neg-frac2N/A
/-lowering-/.f64N/A
neg-lowering-neg.f6490.0
Simplified90.0%
if -1.5499999999999999e132 < z < 1.75e81Initial program 94.7%
Final simplification93.0%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ x (* t y))))
(if (<= t -1.9e-43)
t_1
(if (<= t 4.4e-271)
(/ (- x) (* y z))
(if (<= t 400.0) (/ x (* z z)) t_1)))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = x / (t * y);
double tmp;
if (t <= -1.9e-43) {
tmp = t_1;
} else if (t <= 4.4e-271) {
tmp = -x / (y * z);
} else if (t <= 400.0) {
tmp = x / (z * z);
} 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 / (t * y)
if (t <= (-1.9d-43)) then
tmp = t_1
else if (t <= 4.4d-271) then
tmp = -x / (y * z)
else if (t <= 400.0d0) then
tmp = x / (z * z)
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 / (t * y);
double tmp;
if (t <= -1.9e-43) {
tmp = t_1;
} else if (t <= 4.4e-271) {
tmp = -x / (y * z);
} else if (t <= 400.0) {
tmp = x / (z * z);
} else {
tmp = t_1;
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = x / (t * y) tmp = 0 if t <= -1.9e-43: tmp = t_1 elif t <= 4.4e-271: tmp = -x / (y * z) elif t <= 400.0: tmp = x / (z * z) else: tmp = t_1 return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(x / Float64(t * y)) tmp = 0.0 if (t <= -1.9e-43) tmp = t_1; elseif (t <= 4.4e-271) tmp = Float64(Float64(-x) / Float64(y * z)); elseif (t <= 400.0) tmp = Float64(x / Float64(z * z)); 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 / (t * y);
tmp = 0.0;
if (t <= -1.9e-43)
tmp = t_1;
elseif (t <= 4.4e-271)
tmp = -x / (y * z);
elseif (t <= 400.0)
tmp = x / (z * z);
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[(x / N[(t * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -1.9e-43], t$95$1, If[LessEqual[t, 4.4e-271], N[((-x) / N[(y * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 400.0], N[(x / N[(z * z), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \frac{x}{t \cdot y}\\
\mathbf{if}\;t \leq -1.9 \cdot 10^{-43}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 4.4 \cdot 10^{-271}:\\
\;\;\;\;\frac{-x}{y \cdot z}\\
\mathbf{elif}\;t \leq 400:\\
\;\;\;\;\frac{x}{z \cdot z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -1.89999999999999985e-43 or 400 < t Initial program 86.6%
Taylor expanded in z around 0
/-lowering-/.f64N/A
*-lowering-*.f6452.2
Simplified52.2%
if -1.89999999999999985e-43 < t < 4.3999999999999999e-271Initial program 93.3%
Taylor expanded in y around inf
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
--lowering--.f6463.5
Simplified63.5%
Taylor expanded in t around 0
mul-1-negN/A
neg-lowering-neg.f6454.9
Simplified54.9%
if 4.3999999999999999e-271 < t < 400Initial program 85.7%
Taylor expanded in z around inf
/-lowering-/.f64N/A
unpow2N/A
*-lowering-*.f6461.9
Simplified61.9%
Final simplification54.8%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ (/ x z) z)))
(if (<= z -1.1e+185)
t_1
(if (<= z 5.8e+135) (/ x (* (- y z) (- t z))) 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 <= -1.1e+185) {
tmp = t_1;
} else if (z <= 5.8e+135) {
tmp = x / ((y - z) * (t - z));
} 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 <= (-1.1d+185)) then
tmp = t_1
else if (z <= 5.8d+135) then
tmp = x / ((y - z) * (t - z))
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 <= -1.1e+185) {
tmp = t_1;
} else if (z <= 5.8e+135) {
tmp = x / ((y - z) * (t - z));
} 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 <= -1.1e+185: tmp = t_1 elif z <= 5.8e+135: tmp = x / ((y - z) * (t - z)) 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 <= -1.1e+185) tmp = t_1; elseif (z <= 5.8e+135) tmp = Float64(x / Float64(Float64(y - z) * Float64(t - z))); 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 <= -1.1e+185)
tmp = t_1;
elseif (z <= 5.8e+135)
tmp = x / ((y - z) * (t - z));
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, -1.1e+185], t$95$1, If[LessEqual[z, 5.8e+135], N[(x / N[(N[(y - z), $MachinePrecision] * N[(t - z), $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 -1.1 \cdot 10^{+185}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 5.8 \cdot 10^{+135}:\\
\;\;\;\;\frac{x}{\left(y - z\right) \cdot \left(t - z\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.1e185 or 5.7999999999999997e135 < z Initial program 73.1%
Taylor expanded in z around inf
/-lowering-/.f64N/A
unpow2N/A
*-lowering-*.f6473.1
Simplified73.1%
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f6493.8
Applied egg-rr93.8%
if -1.1e185 < z < 5.7999999999999997e135Initial program 93.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 -2.05e-81) (/ x (* y (- t z))) (if (<= y 3.8e-83) (/ 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 <= -2.05e-81) {
tmp = x / (y * (t - z));
} else if (y <= 3.8e-83) {
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 <= (-2.05d-81)) then
tmp = x / (y * (t - z))
else if (y <= 3.8d-83) 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 <= -2.05e-81) {
tmp = x / (y * (t - z));
} else if (y <= 3.8e-83) {
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 <= -2.05e-81: tmp = x / (y * (t - z)) elif y <= 3.8e-83: 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 <= -2.05e-81) tmp = Float64(x / Float64(y * Float64(t - z))); elseif (y <= 3.8e-83) tmp = Float64(x / Float64(z * Float64(z - t))); else tmp = Float64(x / Float64(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 <= -2.05e-81)
tmp = x / (y * (t - z));
elseif (y <= 3.8e-83)
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, -2.05e-81], N[(x / N[(y * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.8e-83], N[(x / N[(z * N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x / N[(t * N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.05 \cdot 10^{-81}:\\
\;\;\;\;\frac{x}{y \cdot \left(t - z\right)}\\
\mathbf{elif}\;y \leq 3.8 \cdot 10^{-83}:\\
\;\;\;\;\frac{x}{z \cdot \left(z - t\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{t \cdot \left(y - z\right)}\\
\end{array}
\end{array}
if y < -2.04999999999999992e-81Initial program 94.2%
Taylor expanded in y around inf
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
--lowering--.f6481.3
Simplified81.3%
if -2.04999999999999992e-81 < y < 3.79999999999999977e-83Initial program 88.7%
Taylor expanded in y around 0
mul-1-negN/A
distribute-neg-frac2N/A
mul-1-negN/A
/-lowering-/.f64N/A
mul-1-negN/A
distribute-rgt-neg-inN/A
mul-1-negN/A
*-lowering-*.f64N/A
mul-1-negN/A
sub-negN/A
+-commutativeN/A
distribute-neg-inN/A
remove-double-negN/A
unsub-negN/A
--lowering--.f6478.1
Simplified78.1%
if 3.79999999999999977e-83 < y Initial program 79.9%
Taylor expanded in t around inf
Simplified61.5%
Final simplification74.3%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (let* ((t_1 (/ x (* y (- t z))))) (if (<= y -9e-86) t_1 (if (<= y 1.7e-83) (/ x (* z (- z t))) t_1))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = x / (y * (t - z));
double tmp;
if (y <= -9e-86) {
tmp = t_1;
} else if (y <= 1.7e-83) {
tmp = x / (z * (z - t));
} 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 / (y * (t - z))
if (y <= (-9d-86)) then
tmp = t_1
else if (y <= 1.7d-83) then
tmp = x / (z * (z - t))
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 / (y * (t - z));
double tmp;
if (y <= -9e-86) {
tmp = t_1;
} else if (y <= 1.7e-83) {
tmp = x / (z * (z - t));
} else {
tmp = t_1;
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = x / (y * (t - z)) tmp = 0 if y <= -9e-86: tmp = t_1 elif y <= 1.7e-83: tmp = x / (z * (z - t)) else: tmp = t_1 return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(x / Float64(y * Float64(t - z))) tmp = 0.0 if (y <= -9e-86) tmp = t_1; elseif (y <= 1.7e-83) tmp = Float64(x / Float64(z * Float64(z - t))); 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 / (y * (t - z));
tmp = 0.0;
if (y <= -9e-86)
tmp = t_1;
elseif (y <= 1.7e-83)
tmp = x / (z * (z - t));
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[(x / N[(y * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -9e-86], t$95$1, If[LessEqual[y, 1.7e-83], N[(x / N[(z * N[(z - t), $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{x}{y \cdot \left(t - z\right)}\\
\mathbf{if}\;y \leq -9 \cdot 10^{-86}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 1.7 \cdot 10^{-83}:\\
\;\;\;\;\frac{x}{z \cdot \left(z - t\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -8.9999999999999995e-86 or 1.6999999999999999e-83 < y Initial program 87.4%
Taylor expanded in y around inf
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
--lowering--.f6474.0
Simplified74.0%
if -8.9999999999999995e-86 < y < 1.6999999999999999e-83Initial program 88.6%
Taylor expanded in y around 0
mul-1-negN/A
distribute-neg-frac2N/A
mul-1-negN/A
/-lowering-/.f64N/A
mul-1-negN/A
distribute-rgt-neg-inN/A
mul-1-negN/A
*-lowering-*.f64N/A
mul-1-negN/A
sub-negN/A
+-commutativeN/A
distribute-neg-inN/A
remove-double-negN/A
unsub-negN/A
--lowering--.f6477.8
Simplified77.8%
Final simplification75.5%
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 -1.75e+37) t_1 (if (<= z 1.4e+14) (/ x (* t y)) t_1))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = x / (z * z);
double tmp;
if (z <= -1.75e+37) {
tmp = t_1;
} else if (z <= 1.4e+14) {
tmp = x / (t * y);
} else {
tmp = t_1;
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = x / (z * z)
if (z <= (-1.75d+37)) then
tmp = t_1
else if (z <= 1.4d+14) then
tmp = x / (t * y)
else
tmp = t_1
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = x / (z * z);
double tmp;
if (z <= -1.75e+37) {
tmp = t_1;
} else if (z <= 1.4e+14) {
tmp = x / (t * y);
} else {
tmp = t_1;
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = x / (z * z) tmp = 0 if z <= -1.75e+37: tmp = t_1 elif z <= 1.4e+14: tmp = x / (t * y) else: tmp = t_1 return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(x / Float64(z * z)) tmp = 0.0 if (z <= -1.75e+37) tmp = t_1; elseif (z <= 1.4e+14) tmp = Float64(x / Float64(t * y)); else tmp = t_1; end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = x / (z * z);
tmp = 0.0;
if (z <= -1.75e+37)
tmp = t_1;
elseif (z <= 1.4e+14)
tmp = x / (t * y);
else
tmp = t_1;
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x / N[(z * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.75e+37], t$95$1, If[LessEqual[z, 1.4e+14], N[(x / N[(t * y), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \frac{x}{z \cdot z}\\
\mathbf{if}\;z \leq -1.75 \cdot 10^{+37}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.4 \cdot 10^{+14}:\\
\;\;\;\;\frac{x}{t \cdot y}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.75e37 or 1.4e14 < z Initial program 79.9%
Taylor expanded in z around inf
/-lowering-/.f64N/A
unpow2N/A
*-lowering-*.f6467.0
Simplified67.0%
if -1.75e37 < z < 1.4e14Initial program 94.9%
Taylor expanded in z around 0
/-lowering-/.f64N/A
*-lowering-*.f6452.9
Simplified52.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 87.9%
associate-/l/N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f6497.3
Applied egg-rr97.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 116000.0) (/ x (* z (- 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 (t <= 116000.0) {
tmp = x / (z * (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 (t <= 116000.0d0) then
tmp = x / (z * (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 (t <= 116000.0) {
tmp = x / (z * (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 t <= 116000.0: tmp = x / (z * (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 (t <= 116000.0) tmp = Float64(x / Float64(z * 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 (t <= 116000.0)
tmp = x / (z * (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[LessEqual[t, 116000.0], N[(x / N[(z * N[(z - y), $MachinePrecision]), $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}\;t \leq 116000:\\
\;\;\;\;\frac{x}{z \cdot \left(z - y\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{t \cdot y}\\
\end{array}
\end{array}
if t < 116000Initial program 88.8%
Taylor expanded in t around 0
mul-1-negN/A
distribute-neg-frac2N/A
mul-1-negN/A
/-lowering-/.f64N/A
mul-1-negN/A
distribute-rgt-neg-inN/A
mul-1-negN/A
*-lowering-*.f64N/A
mul-1-negN/A
sub-negN/A
+-commutativeN/A
distribute-neg-inN/A
unsub-negN/A
remove-double-negN/A
--lowering--.f6458.9
Simplified58.9%
if 116000 < t Initial program 85.2%
Taylor expanded in z around 0
/-lowering-/.f64N/A
*-lowering-*.f6452.9
Simplified52.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 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(x / Float64(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[(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])\\
\\
\frac{x}{\left(y - z\right) \cdot \left(t - z\right)}
\end{array}
Initial program 87.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 y)))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
return x / (t * y);
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = x / (t * y)
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
return x / (t * y);
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): return x / (t * y)
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) return Float64(x / Float64(t * y)) end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
tmp = x / (t * y);
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := N[(x / N[(t * y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\frac{x}{t \cdot y}
\end{array}
Initial program 87.9%
Taylor expanded in z around 0
/-lowering-/.f64N/A
*-lowering-*.f6437.4
Simplified37.4%
(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 2024198
(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))))