
(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: y and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= (* (- y z) (- t z)) -2e-81) (* (/ 1.0 (- y z)) (/ x (- t z))) (/ (/ x (- y z)) (- t z))))
assert(y < t);
double code(double x, double y, double z, double t) {
double tmp;
if (((y - z) * (t - z)) <= -2e-81) {
tmp = (1.0 / (y - z)) * (x / (t - z));
} else {
tmp = (x / (y - z)) / (t - z);
}
return tmp;
}
NOTE: y 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 - z) * (t - z)) <= (-2d-81)) then
tmp = (1.0d0 / (y - z)) * (x / (t - z))
else
tmp = (x / (y - z)) / (t - z)
end if
code = tmp
end function
assert y < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (((y - z) * (t - z)) <= -2e-81) {
tmp = (1.0 / (y - z)) * (x / (t - z));
} else {
tmp = (x / (y - z)) / (t - z);
}
return tmp;
}
[y, t] = sort([y, t]) def code(x, y, z, t): tmp = 0 if ((y - z) * (t - z)) <= -2e-81: tmp = (1.0 / (y - z)) * (x / (t - z)) else: tmp = (x / (y - z)) / (t - z) return tmp
y, t = sort([y, t]) function code(x, y, z, t) tmp = 0.0 if (Float64(Float64(y - z) * Float64(t - z)) <= -2e-81) tmp = Float64(Float64(1.0 / Float64(y - z)) * Float64(x / Float64(t - z))); else tmp = Float64(Float64(x / Float64(y - z)) / Float64(t - z)); end return tmp end
y, t = num2cell(sort([y, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (((y - z) * (t - z)) <= -2e-81)
tmp = (1.0 / (y - z)) * (x / (t - z));
else
tmp = (x / (y - z)) / (t - z);
end
tmp_2 = tmp;
end
NOTE: y and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[N[(N[(y - z), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision], -2e-81], N[(N[(1.0 / N[(y - z), $MachinePrecision]), $MachinePrecision] * N[(x / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(y - z), $MachinePrecision]), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[y, t] = \mathsf{sort}([y, t])\\
\\
\begin{array}{l}
\mathbf{if}\;\left(y - z\right) \cdot \left(t - z\right) \leq -2 \cdot 10^{-81}:\\
\;\;\;\;\frac{1}{y - z} \cdot \frac{x}{t - z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y - z}}{t - z}\\
\end{array}
\end{array}
if (*.f64 (-.f64 y z) (-.f64 t z)) < -1.9999999999999999e-81Initial program 88.2%
*-un-lft-identity88.2%
times-frac91.8%
Applied egg-rr91.8%
if -1.9999999999999999e-81 < (*.f64 (-.f64 y z) (-.f64 t z)) Initial program 88.8%
associate-/r*97.9%
Simplified97.9%
Final simplification96.2%
NOTE: y and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(if (<= t -2.1e-91)
(/ (/ x y) (- t z))
(if (<= t 9.5e-153)
(/ (- x) (* z (- y z)))
(if (<= t 2.1e-67)
(/ (/ x (- t z)) y)
(if (<= t 1.9e+36) (/ (/ (- x) z) (- t z)) (/ (/ x t) (- y z)))))))assert(y < t);
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -2.1e-91) {
tmp = (x / y) / (t - z);
} else if (t <= 9.5e-153) {
tmp = -x / (z * (y - z));
} else if (t <= 2.1e-67) {
tmp = (x / (t - z)) / y;
} else if (t <= 1.9e+36) {
tmp = (-x / z) / (t - z);
} else {
tmp = (x / t) / (y - z);
}
return tmp;
}
NOTE: y 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.1d-91)) then
tmp = (x / y) / (t - z)
else if (t <= 9.5d-153) then
tmp = -x / (z * (y - z))
else if (t <= 2.1d-67) then
tmp = (x / (t - z)) / y
else if (t <= 1.9d+36) then
tmp = (-x / z) / (t - z)
else
tmp = (x / t) / (y - z)
end if
code = tmp
end function
assert y < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= -2.1e-91) {
tmp = (x / y) / (t - z);
} else if (t <= 9.5e-153) {
tmp = -x / (z * (y - z));
} else if (t <= 2.1e-67) {
tmp = (x / (t - z)) / y;
} else if (t <= 1.9e+36) {
tmp = (-x / z) / (t - z);
} else {
tmp = (x / t) / (y - z);
}
return tmp;
}
[y, t] = sort([y, t]) def code(x, y, z, t): tmp = 0 if t <= -2.1e-91: tmp = (x / y) / (t - z) elif t <= 9.5e-153: tmp = -x / (z * (y - z)) elif t <= 2.1e-67: tmp = (x / (t - z)) / y elif t <= 1.9e+36: tmp = (-x / z) / (t - z) else: tmp = (x / t) / (y - z) return tmp
y, t = sort([y, t]) function code(x, y, z, t) tmp = 0.0 if (t <= -2.1e-91) tmp = Float64(Float64(x / y) / Float64(t - z)); elseif (t <= 9.5e-153) tmp = Float64(Float64(-x) / Float64(z * Float64(y - z))); elseif (t <= 2.1e-67) tmp = Float64(Float64(x / Float64(t - z)) / y); elseif (t <= 1.9e+36) tmp = Float64(Float64(Float64(-x) / z) / Float64(t - z)); else tmp = Float64(Float64(x / t) / Float64(y - z)); end return tmp end
y, t = num2cell(sort([y, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (t <= -2.1e-91)
tmp = (x / y) / (t - z);
elseif (t <= 9.5e-153)
tmp = -x / (z * (y - z));
elseif (t <= 2.1e-67)
tmp = (x / (t - z)) / y;
elseif (t <= 1.9e+36)
tmp = (-x / z) / (t - z);
else
tmp = (x / t) / (y - z);
end
tmp_2 = tmp;
end
NOTE: y and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[t, -2.1e-91], N[(N[(x / y), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 9.5e-153], N[((-x) / N[(z * N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.1e-67], N[(N[(x / N[(t - z), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision], If[LessEqual[t, 1.9e+36], N[(N[((-x) / z), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], N[(N[(x / t), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[y, t] = \mathsf{sort}([y, t])\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.1 \cdot 10^{-91}:\\
\;\;\;\;\frac{\frac{x}{y}}{t - z}\\
\mathbf{elif}\;t \leq 9.5 \cdot 10^{-153}:\\
\;\;\;\;\frac{-x}{z \cdot \left(y - z\right)}\\
\mathbf{elif}\;t \leq 2.1 \cdot 10^{-67}:\\
\;\;\;\;\frac{\frac{x}{t - z}}{y}\\
\mathbf{elif}\;t \leq 1.9 \cdot 10^{+36}:\\
\;\;\;\;\frac{\frac{-x}{z}}{t - z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{t}}{y - z}\\
\end{array}
\end{array}
if t < -2.0999999999999999e-91Initial program 90.9%
associate-/r*98.5%
Simplified98.5%
Taylor expanded in y around inf 54.6%
if -2.0999999999999999e-91 < t < 9.50000000000000031e-153Initial program 93.9%
Taylor expanded in t around 0 84.4%
associate-*r/84.4%
neg-mul-184.4%
*-commutative84.4%
Simplified84.4%
if 9.50000000000000031e-153 < t < 2.1000000000000002e-67Initial program 92.2%
*-un-lft-identity92.2%
times-frac99.5%
Applied egg-rr99.5%
Taylor expanded in y around inf 67.4%
*-rgt-identity67.4%
times-frac67.4%
associate-*l/71.1%
associate-*r/71.3%
*-rgt-identity71.3%
Simplified71.3%
if 2.1000000000000002e-67 < t < 1.90000000000000012e36Initial program 88.1%
Taylor expanded in y around 0 63.6%
mul-1-neg63.6%
distribute-frac-neg63.6%
associate-/r*69.4%
Simplified69.4%
if 1.90000000000000012e36 < t Initial program 76.6%
Taylor expanded in t around inf 75.2%
associate-/r*82.8%
Simplified82.8%
Final simplification73.3%
NOTE: y 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.12e+17)
t_1
(if (<= z -4e-40)
(/ x (* y (- t z)))
(if (<= z -1.55e-41)
(/ x (* z z))
(if (<= z 7.2e-38) (/ x (* (- y z) t)) t_1))))))assert(y < t);
double code(double x, double y, double z, double t) {
double t_1 = (x / z) / z;
double tmp;
if (z <= -1.12e+17) {
tmp = t_1;
} else if (z <= -4e-40) {
tmp = x / (y * (t - z));
} else if (z <= -1.55e-41) {
tmp = x / (z * z);
} else if (z <= 7.2e-38) {
tmp = x / ((y - z) * t);
} else {
tmp = t_1;
}
return tmp;
}
NOTE: y 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.12d+17)) then
tmp = t_1
else if (z <= (-4d-40)) then
tmp = x / (y * (t - z))
else if (z <= (-1.55d-41)) then
tmp = x / (z * z)
else if (z <= 7.2d-38) then
tmp = x / ((y - z) * t)
else
tmp = t_1
end if
code = tmp
end function
assert y < t;
public static double code(double x, double y, double z, double t) {
double t_1 = (x / z) / z;
double tmp;
if (z <= -1.12e+17) {
tmp = t_1;
} else if (z <= -4e-40) {
tmp = x / (y * (t - z));
} else if (z <= -1.55e-41) {
tmp = x / (z * z);
} else if (z <= 7.2e-38) {
tmp = x / ((y - z) * t);
} else {
tmp = t_1;
}
return tmp;
}
[y, t] = sort([y, t]) def code(x, y, z, t): t_1 = (x / z) / z tmp = 0 if z <= -1.12e+17: tmp = t_1 elif z <= -4e-40: tmp = x / (y * (t - z)) elif z <= -1.55e-41: tmp = x / (z * z) elif z <= 7.2e-38: tmp = x / ((y - z) * t) else: tmp = t_1 return tmp
y, t = sort([y, t]) function code(x, y, z, t) t_1 = Float64(Float64(x / z) / z) tmp = 0.0 if (z <= -1.12e+17) tmp = t_1; elseif (z <= -4e-40) tmp = Float64(x / Float64(y * Float64(t - z))); elseif (z <= -1.55e-41) tmp = Float64(x / Float64(z * z)); elseif (z <= 7.2e-38) tmp = Float64(x / Float64(Float64(y - z) * t)); else tmp = t_1; end return tmp end
y, t = num2cell(sort([y, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = (x / z) / z;
tmp = 0.0;
if (z <= -1.12e+17)
tmp = t_1;
elseif (z <= -4e-40)
tmp = x / (y * (t - z));
elseif (z <= -1.55e-41)
tmp = x / (z * z);
elseif (z <= 7.2e-38)
tmp = x / ((y - z) * t);
else
tmp = t_1;
end
tmp_2 = tmp;
end
NOTE: y 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.12e+17], t$95$1, If[LessEqual[z, -4e-40], N[(x / N[(y * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -1.55e-41], N[(x / N[(z * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 7.2e-38], N[(x / N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
[y, t] = \mathsf{sort}([y, t])\\
\\
\begin{array}{l}
t_1 := \frac{\frac{x}{z}}{z}\\
\mathbf{if}\;z \leq -1.12 \cdot 10^{+17}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -4 \cdot 10^{-40}:\\
\;\;\;\;\frac{x}{y \cdot \left(t - z\right)}\\
\mathbf{elif}\;z \leq -1.55 \cdot 10^{-41}:\\
\;\;\;\;\frac{x}{z \cdot z}\\
\mathbf{elif}\;z \leq 7.2 \cdot 10^{-38}:\\
\;\;\;\;\frac{x}{\left(y - z\right) \cdot t}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -1.12e17 or 7.2000000000000001e-38 < z Initial program 83.4%
Taylor expanded in z around inf 69.6%
unpow269.6%
associate-/r*76.6%
Simplified76.6%
if -1.12e17 < z < -3.9999999999999997e-40Initial program 99.8%
Taylor expanded in y around inf 44.6%
*-commutative44.6%
Simplified44.6%
if -3.9999999999999997e-40 < z < -1.55e-41Initial program 100.0%
Taylor expanded in z around inf 100.0%
unpow2100.0%
Simplified100.0%
if -1.55e-41 < z < 7.2000000000000001e-38Initial program 93.0%
Taylor expanded in t around inf 77.7%
Final simplification75.5%
NOTE: y 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 (* y (- t z)))))
(if (<= t -2.25e-250)
t_2
(if (<= t 4.8e-187)
t_1
(if (<= t 9e-67) t_2 (if (<= t 7.5e+35) t_1 (/ (/ x t) (- y z))))))))assert(y < t);
double code(double x, double y, double z, double t) {
double t_1 = (x / z) / z;
double t_2 = x / (y * (t - z));
double tmp;
if (t <= -2.25e-250) {
tmp = t_2;
} else if (t <= 4.8e-187) {
tmp = t_1;
} else if (t <= 9e-67) {
tmp = t_2;
} else if (t <= 7.5e+35) {
tmp = t_1;
} else {
tmp = (x / t) / (y - z);
}
return tmp;
}
NOTE: y 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 / (y * (t - z))
if (t <= (-2.25d-250)) then
tmp = t_2
else if (t <= 4.8d-187) then
tmp = t_1
else if (t <= 9d-67) then
tmp = t_2
else if (t <= 7.5d+35) then
tmp = t_1
else
tmp = (x / t) / (y - z)
end if
code = tmp
end function
assert y < t;
public static double code(double x, double y, double z, double t) {
double t_1 = (x / z) / z;
double t_2 = x / (y * (t - z));
double tmp;
if (t <= -2.25e-250) {
tmp = t_2;
} else if (t <= 4.8e-187) {
tmp = t_1;
} else if (t <= 9e-67) {
tmp = t_2;
} else if (t <= 7.5e+35) {
tmp = t_1;
} else {
tmp = (x / t) / (y - z);
}
return tmp;
}
[y, t] = sort([y, t]) def code(x, y, z, t): t_1 = (x / z) / z t_2 = x / (y * (t - z)) tmp = 0 if t <= -2.25e-250: tmp = t_2 elif t <= 4.8e-187: tmp = t_1 elif t <= 9e-67: tmp = t_2 elif t <= 7.5e+35: tmp = t_1 else: tmp = (x / t) / (y - z) return tmp
y, t = sort([y, t]) function code(x, y, z, t) t_1 = Float64(Float64(x / z) / z) t_2 = Float64(x / Float64(y * Float64(t - z))) tmp = 0.0 if (t <= -2.25e-250) tmp = t_2; elseif (t <= 4.8e-187) tmp = t_1; elseif (t <= 9e-67) tmp = t_2; elseif (t <= 7.5e+35) tmp = t_1; else tmp = Float64(Float64(x / t) / Float64(y - z)); end return tmp end
y, t = num2cell(sort([y, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = (x / z) / z;
t_2 = x / (y * (t - z));
tmp = 0.0;
if (t <= -2.25e-250)
tmp = t_2;
elseif (t <= 4.8e-187)
tmp = t_1;
elseif (t <= 9e-67)
tmp = t_2;
elseif (t <= 7.5e+35)
tmp = t_1;
else
tmp = (x / t) / (y - z);
end
tmp_2 = tmp;
end
NOTE: y 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[(y * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -2.25e-250], t$95$2, If[LessEqual[t, 4.8e-187], t$95$1, If[LessEqual[t, 9e-67], t$95$2, If[LessEqual[t, 7.5e+35], t$95$1, N[(N[(x / t), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
[y, t] = \mathsf{sort}([y, t])\\
\\
\begin{array}{l}
t_1 := \frac{\frac{x}{z}}{z}\\
t_2 := \frac{x}{y \cdot \left(t - z\right)}\\
\mathbf{if}\;t \leq -2.25 \cdot 10^{-250}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t \leq 4.8 \cdot 10^{-187}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 9 \cdot 10^{-67}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t \leq 7.5 \cdot 10^{+35}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{t}}{y - z}\\
\end{array}
\end{array}
if t < -2.24999999999999997e-250 or 4.80000000000000027e-187 < t < 9.00000000000000031e-67Initial program 90.5%
Taylor expanded in y around inf 55.9%
*-commutative55.9%
Simplified55.9%
if -2.24999999999999997e-250 < t < 4.80000000000000027e-187 or 9.00000000000000031e-67 < t < 7.4999999999999999e35Initial program 96.4%
Taylor expanded in z around inf 67.6%
unpow267.6%
associate-/r*69.3%
Simplified69.3%
if 7.4999999999999999e35 < t Initial program 76.6%
Taylor expanded in t around inf 75.2%
associate-/r*82.8%
Simplified82.8%
Final simplification64.7%
NOTE: y 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 (<= t -1.7e-208)
(/ (/ x y) (- t z))
(if (<= t 6.2e-182)
t_1
(if (<= t 7.8e-67)
(/ x (* y (- t z)))
(if (<= t 7.5e+35) t_1 (/ (/ x t) (- y z))))))))assert(y < t);
double code(double x, double y, double z, double t) {
double t_1 = (x / z) / z;
double tmp;
if (t <= -1.7e-208) {
tmp = (x / y) / (t - z);
} else if (t <= 6.2e-182) {
tmp = t_1;
} else if (t <= 7.8e-67) {
tmp = x / (y * (t - z));
} else if (t <= 7.5e+35) {
tmp = t_1;
} else {
tmp = (x / t) / (y - z);
}
return tmp;
}
NOTE: y 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 (t <= (-1.7d-208)) then
tmp = (x / y) / (t - z)
else if (t <= 6.2d-182) then
tmp = t_1
else if (t <= 7.8d-67) then
tmp = x / (y * (t - z))
else if (t <= 7.5d+35) then
tmp = t_1
else
tmp = (x / t) / (y - z)
end if
code = tmp
end function
assert y < t;
public static double code(double x, double y, double z, double t) {
double t_1 = (x / z) / z;
double tmp;
if (t <= -1.7e-208) {
tmp = (x / y) / (t - z);
} else if (t <= 6.2e-182) {
tmp = t_1;
} else if (t <= 7.8e-67) {
tmp = x / (y * (t - z));
} else if (t <= 7.5e+35) {
tmp = t_1;
} else {
tmp = (x / t) / (y - z);
}
return tmp;
}
[y, t] = sort([y, t]) def code(x, y, z, t): t_1 = (x / z) / z tmp = 0 if t <= -1.7e-208: tmp = (x / y) / (t - z) elif t <= 6.2e-182: tmp = t_1 elif t <= 7.8e-67: tmp = x / (y * (t - z)) elif t <= 7.5e+35: tmp = t_1 else: tmp = (x / t) / (y - z) return tmp
y, t = sort([y, t]) function code(x, y, z, t) t_1 = Float64(Float64(x / z) / z) tmp = 0.0 if (t <= -1.7e-208) tmp = Float64(Float64(x / y) / Float64(t - z)); elseif (t <= 6.2e-182) tmp = t_1; elseif (t <= 7.8e-67) tmp = Float64(x / Float64(y * Float64(t - z))); elseif (t <= 7.5e+35) tmp = t_1; else tmp = Float64(Float64(x / t) / Float64(y - z)); end return tmp end
y, t = num2cell(sort([y, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = (x / z) / z;
tmp = 0.0;
if (t <= -1.7e-208)
tmp = (x / y) / (t - z);
elseif (t <= 6.2e-182)
tmp = t_1;
elseif (t <= 7.8e-67)
tmp = x / (y * (t - z));
elseif (t <= 7.5e+35)
tmp = t_1;
else
tmp = (x / t) / (y - z);
end
tmp_2 = tmp;
end
NOTE: y 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[t, -1.7e-208], N[(N[(x / y), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 6.2e-182], t$95$1, If[LessEqual[t, 7.8e-67], N[(x / N[(y * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 7.5e+35], t$95$1, N[(N[(x / t), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
[y, t] = \mathsf{sort}([y, t])\\
\\
\begin{array}{l}
t_1 := \frac{\frac{x}{z}}{z}\\
\mathbf{if}\;t \leq -1.7 \cdot 10^{-208}:\\
\;\;\;\;\frac{\frac{x}{y}}{t - z}\\
\mathbf{elif}\;t \leq 6.2 \cdot 10^{-182}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 7.8 \cdot 10^{-67}:\\
\;\;\;\;\frac{x}{y \cdot \left(t - z\right)}\\
\mathbf{elif}\;t \leq 7.5 \cdot 10^{+35}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{t}}{y - z}\\
\end{array}
\end{array}
if t < -1.7e-208Initial program 89.4%
associate-/r*98.9%
Simplified98.9%
Taylor expanded in y around inf 59.3%
if -1.7e-208 < t < 6.20000000000000016e-182 or 7.7999999999999997e-67 < t < 7.4999999999999999e35Initial program 95.5%
Taylor expanded in z around inf 68.3%
unpow268.3%
associate-/r*71.2%
Simplified71.2%
if 6.20000000000000016e-182 < t < 7.7999999999999997e-67Initial program 94.0%
Taylor expanded in y around inf 68.8%
*-commutative68.8%
Simplified68.8%
if 7.4999999999999999e35 < t Initial program 76.6%
Taylor expanded in t around inf 75.2%
associate-/r*82.8%
Simplified82.8%
Final simplification68.6%
NOTE: y 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 (<= t -1.1e-208)
(/ (/ x y) (- t z))
(if (<= t 2.9e-258)
t_1
(if (<= t 4.1e-67)
(/ (/ x (- t z)) y)
(if (<= t 7.5e+35) t_1 (/ (/ x t) (- y z))))))))assert(y < t);
double code(double x, double y, double z, double t) {
double t_1 = (x / z) / z;
double tmp;
if (t <= -1.1e-208) {
tmp = (x / y) / (t - z);
} else if (t <= 2.9e-258) {
tmp = t_1;
} else if (t <= 4.1e-67) {
tmp = (x / (t - z)) / y;
} else if (t <= 7.5e+35) {
tmp = t_1;
} else {
tmp = (x / t) / (y - z);
}
return tmp;
}
NOTE: y 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 (t <= (-1.1d-208)) then
tmp = (x / y) / (t - z)
else if (t <= 2.9d-258) then
tmp = t_1
else if (t <= 4.1d-67) then
tmp = (x / (t - z)) / y
else if (t <= 7.5d+35) then
tmp = t_1
else
tmp = (x / t) / (y - z)
end if
code = tmp
end function
assert y < t;
public static double code(double x, double y, double z, double t) {
double t_1 = (x / z) / z;
double tmp;
if (t <= -1.1e-208) {
tmp = (x / y) / (t - z);
} else if (t <= 2.9e-258) {
tmp = t_1;
} else if (t <= 4.1e-67) {
tmp = (x / (t - z)) / y;
} else if (t <= 7.5e+35) {
tmp = t_1;
} else {
tmp = (x / t) / (y - z);
}
return tmp;
}
[y, t] = sort([y, t]) def code(x, y, z, t): t_1 = (x / z) / z tmp = 0 if t <= -1.1e-208: tmp = (x / y) / (t - z) elif t <= 2.9e-258: tmp = t_1 elif t <= 4.1e-67: tmp = (x / (t - z)) / y elif t <= 7.5e+35: tmp = t_1 else: tmp = (x / t) / (y - z) return tmp
y, t = sort([y, t]) function code(x, y, z, t) t_1 = Float64(Float64(x / z) / z) tmp = 0.0 if (t <= -1.1e-208) tmp = Float64(Float64(x / y) / Float64(t - z)); elseif (t <= 2.9e-258) tmp = t_1; elseif (t <= 4.1e-67) tmp = Float64(Float64(x / Float64(t - z)) / y); elseif (t <= 7.5e+35) tmp = t_1; else tmp = Float64(Float64(x / t) / Float64(y - z)); end return tmp end
y, t = num2cell(sort([y, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = (x / z) / z;
tmp = 0.0;
if (t <= -1.1e-208)
tmp = (x / y) / (t - z);
elseif (t <= 2.9e-258)
tmp = t_1;
elseif (t <= 4.1e-67)
tmp = (x / (t - z)) / y;
elseif (t <= 7.5e+35)
tmp = t_1;
else
tmp = (x / t) / (y - z);
end
tmp_2 = tmp;
end
NOTE: y 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[t, -1.1e-208], N[(N[(x / y), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.9e-258], t$95$1, If[LessEqual[t, 4.1e-67], N[(N[(x / N[(t - z), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision], If[LessEqual[t, 7.5e+35], t$95$1, N[(N[(x / t), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
[y, t] = \mathsf{sort}([y, t])\\
\\
\begin{array}{l}
t_1 := \frac{\frac{x}{z}}{z}\\
\mathbf{if}\;t \leq -1.1 \cdot 10^{-208}:\\
\;\;\;\;\frac{\frac{x}{y}}{t - z}\\
\mathbf{elif}\;t \leq 2.9 \cdot 10^{-258}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 4.1 \cdot 10^{-67}:\\
\;\;\;\;\frac{\frac{x}{t - z}}{y}\\
\mathbf{elif}\;t \leq 7.5 \cdot 10^{+35}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{t}}{y - z}\\
\end{array}
\end{array}
if t < -1.1e-208Initial program 89.4%
associate-/r*98.9%
Simplified98.9%
Taylor expanded in y around inf 59.3%
if -1.1e-208 < t < 2.9e-258 or 4.0999999999999997e-67 < t < 7.4999999999999999e35Initial program 94.2%
Taylor expanded in z around inf 68.4%
unpow268.4%
associate-/r*72.1%
Simplified72.1%
if 2.9e-258 < t < 4.0999999999999997e-67Initial program 95.9%
*-un-lft-identity95.9%
times-frac97.6%
Applied egg-rr97.6%
Taylor expanded in y around inf 72.6%
*-rgt-identity72.6%
times-frac70.6%
associate-*l/72.5%
associate-*r/72.6%
*-rgt-identity72.6%
Simplified72.6%
if 7.4999999999999999e35 < t Initial program 76.6%
Taylor expanded in t around inf 75.2%
associate-/r*82.8%
Simplified82.8%
Final simplification69.4%
NOTE: y and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(if (<= t -4.5e-97)
(/ (/ x y) (- t z))
(if (<= t 3.5e-152)
(/ (- x) (* z (- y z)))
(if (<= t 1.6e-67)
(/ (/ x (- t z)) y)
(if (<= t 7.5e+35) (/ (/ x z) z) (/ (/ x t) (- y z)))))))assert(y < t);
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -4.5e-97) {
tmp = (x / y) / (t - z);
} else if (t <= 3.5e-152) {
tmp = -x / (z * (y - z));
} else if (t <= 1.6e-67) {
tmp = (x / (t - z)) / y;
} else if (t <= 7.5e+35) {
tmp = (x / z) / z;
} else {
tmp = (x / t) / (y - z);
}
return tmp;
}
NOTE: y 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 <= (-4.5d-97)) then
tmp = (x / y) / (t - z)
else if (t <= 3.5d-152) then
tmp = -x / (z * (y - z))
else if (t <= 1.6d-67) then
tmp = (x / (t - z)) / y
else if (t <= 7.5d+35) then
tmp = (x / z) / z
else
tmp = (x / t) / (y - z)
end if
code = tmp
end function
assert y < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= -4.5e-97) {
tmp = (x / y) / (t - z);
} else if (t <= 3.5e-152) {
tmp = -x / (z * (y - z));
} else if (t <= 1.6e-67) {
tmp = (x / (t - z)) / y;
} else if (t <= 7.5e+35) {
tmp = (x / z) / z;
} else {
tmp = (x / t) / (y - z);
}
return tmp;
}
[y, t] = sort([y, t]) def code(x, y, z, t): tmp = 0 if t <= -4.5e-97: tmp = (x / y) / (t - z) elif t <= 3.5e-152: tmp = -x / (z * (y - z)) elif t <= 1.6e-67: tmp = (x / (t - z)) / y elif t <= 7.5e+35: tmp = (x / z) / z else: tmp = (x / t) / (y - z) return tmp
y, t = sort([y, t]) function code(x, y, z, t) tmp = 0.0 if (t <= -4.5e-97) tmp = Float64(Float64(x / y) / Float64(t - z)); elseif (t <= 3.5e-152) tmp = Float64(Float64(-x) / Float64(z * Float64(y - z))); elseif (t <= 1.6e-67) tmp = Float64(Float64(x / Float64(t - z)) / y); elseif (t <= 7.5e+35) tmp = Float64(Float64(x / z) / z); else tmp = Float64(Float64(x / t) / Float64(y - z)); end return tmp end
y, t = num2cell(sort([y, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (t <= -4.5e-97)
tmp = (x / y) / (t - z);
elseif (t <= 3.5e-152)
tmp = -x / (z * (y - z));
elseif (t <= 1.6e-67)
tmp = (x / (t - z)) / y;
elseif (t <= 7.5e+35)
tmp = (x / z) / z;
else
tmp = (x / t) / (y - z);
end
tmp_2 = tmp;
end
NOTE: y and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[t, -4.5e-97], N[(N[(x / y), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3.5e-152], N[((-x) / N[(z * N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.6e-67], N[(N[(x / N[(t - z), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision], If[LessEqual[t, 7.5e+35], N[(N[(x / z), $MachinePrecision] / z), $MachinePrecision], N[(N[(x / t), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[y, t] = \mathsf{sort}([y, t])\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4.5 \cdot 10^{-97}:\\
\;\;\;\;\frac{\frac{x}{y}}{t - z}\\
\mathbf{elif}\;t \leq 3.5 \cdot 10^{-152}:\\
\;\;\;\;\frac{-x}{z \cdot \left(y - z\right)}\\
\mathbf{elif}\;t \leq 1.6 \cdot 10^{-67}:\\
\;\;\;\;\frac{\frac{x}{t - z}}{y}\\
\mathbf{elif}\;t \leq 7.5 \cdot 10^{+35}:\\
\;\;\;\;\frac{\frac{x}{z}}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{t}}{y - z}\\
\end{array}
\end{array}
if t < -4.5000000000000001e-97Initial program 90.9%
associate-/r*98.5%
Simplified98.5%
Taylor expanded in y around inf 54.6%
if -4.5000000000000001e-97 < t < 3.5000000000000001e-152Initial program 93.9%
Taylor expanded in t around 0 84.4%
associate-*r/84.4%
neg-mul-184.4%
*-commutative84.4%
Simplified84.4%
if 3.5000000000000001e-152 < t < 1.60000000000000011e-67Initial program 92.2%
*-un-lft-identity92.2%
times-frac99.5%
Applied egg-rr99.5%
Taylor expanded in y around inf 67.4%
*-rgt-identity67.4%
times-frac67.4%
associate-*l/71.1%
associate-*r/71.3%
*-rgt-identity71.3%
Simplified71.3%
if 1.60000000000000011e-67 < t < 7.4999999999999999e35Initial program 88.1%
Taylor expanded in z around inf 57.2%
unpow257.2%
associate-/r*63.1%
Simplified63.1%
if 7.4999999999999999e35 < t Initial program 76.6%
Taylor expanded in t around inf 75.2%
associate-/r*82.8%
Simplified82.8%
Final simplification72.9%
NOTE: y and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ (- x) z)))
(if (<= z -4.9e+190)
(/ t_1 (- y z))
(if (<= z 1.1e+114) (/ x (* (- y z) (- t z))) (/ t_1 (- t z))))))assert(y < t);
double code(double x, double y, double z, double t) {
double t_1 = -x / z;
double tmp;
if (z <= -4.9e+190) {
tmp = t_1 / (y - z);
} else if (z <= 1.1e+114) {
tmp = x / ((y - z) * (t - z));
} else {
tmp = t_1 / (t - z);
}
return tmp;
}
NOTE: y 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
if (z <= (-4.9d+190)) then
tmp = t_1 / (y - z)
else if (z <= 1.1d+114) then
tmp = x / ((y - z) * (t - z))
else
tmp = t_1 / (t - z)
end if
code = tmp
end function
assert y < t;
public static double code(double x, double y, double z, double t) {
double t_1 = -x / z;
double tmp;
if (z <= -4.9e+190) {
tmp = t_1 / (y - z);
} else if (z <= 1.1e+114) {
tmp = x / ((y - z) * (t - z));
} else {
tmp = t_1 / (t - z);
}
return tmp;
}
[y, t] = sort([y, t]) def code(x, y, z, t): t_1 = -x / z tmp = 0 if z <= -4.9e+190: tmp = t_1 / (y - z) elif z <= 1.1e+114: tmp = x / ((y - z) * (t - z)) else: tmp = t_1 / (t - z) return tmp
y, t = sort([y, t]) function code(x, y, z, t) t_1 = Float64(Float64(-x) / z) tmp = 0.0 if (z <= -4.9e+190) tmp = Float64(t_1 / Float64(y - z)); elseif (z <= 1.1e+114) tmp = Float64(x / Float64(Float64(y - z) * Float64(t - z))); else tmp = Float64(t_1 / Float64(t - z)); end return tmp end
y, t = num2cell(sort([y, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = -x / z;
tmp = 0.0;
if (z <= -4.9e+190)
tmp = t_1 / (y - z);
elseif (z <= 1.1e+114)
tmp = x / ((y - z) * (t - z));
else
tmp = t_1 / (t - z);
end
tmp_2 = tmp;
end
NOTE: y and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[((-x) / z), $MachinePrecision]}, If[LessEqual[z, -4.9e+190], N[(t$95$1 / N[(y - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.1e+114], N[(x / N[(N[(y - z), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 / N[(t - z), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[y, t] = \mathsf{sort}([y, t])\\
\\
\begin{array}{l}
t_1 := \frac{-x}{z}\\
\mathbf{if}\;z \leq -4.9 \cdot 10^{+190}:\\
\;\;\;\;\frac{t_1}{y - z}\\
\mathbf{elif}\;z \leq 1.1 \cdot 10^{+114}:\\
\;\;\;\;\frac{x}{\left(y - z\right) \cdot \left(t - z\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{t_1}{t - z}\\
\end{array}
\end{array}
if z < -4.8999999999999996e190Initial program 69.2%
Taylor expanded in t around 0 69.2%
associate-*r/69.2%
neg-mul-169.2%
*-commutative69.2%
associate-/r*97.1%
Simplified97.1%
if -4.8999999999999996e190 < z < 1.1e114Initial program 93.9%
if 1.1e114 < z Initial program 75.0%
Taylor expanded in y around 0 74.9%
mul-1-neg74.9%
distribute-frac-neg74.9%
associate-/r*90.8%
Simplified90.8%
Final simplification93.9%
NOTE: y and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (or (<= z -1.65e-43) (not (<= z 1.06e-66))) (/ (/ (- x) z) (- y z)) (/ (/ x t) (- y z))))
assert(y < t);
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.65e-43) || !(z <= 1.06e-66)) {
tmp = (-x / z) / (y - z);
} else {
tmp = (x / t) / (y - z);
}
return tmp;
}
NOTE: y 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-43)) .or. (.not. (z <= 1.06d-66))) then
tmp = (-x / z) / (y - z)
else
tmp = (x / t) / (y - z)
end if
code = tmp
end function
assert y < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.65e-43) || !(z <= 1.06e-66)) {
tmp = (-x / z) / (y - z);
} else {
tmp = (x / t) / (y - z);
}
return tmp;
}
[y, t] = sort([y, t]) def code(x, y, z, t): tmp = 0 if (z <= -1.65e-43) or not (z <= 1.06e-66): tmp = (-x / z) / (y - z) else: tmp = (x / t) / (y - z) return tmp
y, t = sort([y, t]) function code(x, y, z, t) tmp = 0.0 if ((z <= -1.65e-43) || !(z <= 1.06e-66)) tmp = Float64(Float64(Float64(-x) / z) / Float64(y - z)); else tmp = Float64(Float64(x / t) / Float64(y - z)); end return tmp end
y, t = num2cell(sort([y, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if ((z <= -1.65e-43) || ~((z <= 1.06e-66)))
tmp = (-x / z) / (y - z);
else
tmp = (x / t) / (y - z);
end
tmp_2 = tmp;
end
NOTE: y and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[Or[LessEqual[z, -1.65e-43], N[Not[LessEqual[z, 1.06e-66]], $MachinePrecision]], N[(N[((-x) / z), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision], N[(N[(x / t), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[y, t] = \mathsf{sort}([y, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.65 \cdot 10^{-43} \lor \neg \left(z \leq 1.06 \cdot 10^{-66}\right):\\
\;\;\;\;\frac{\frac{-x}{z}}{y - z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{t}}{y - z}\\
\end{array}
\end{array}
if z < -1.65000000000000008e-43 or 1.05999999999999994e-66 < z Initial program 86.2%
Taylor expanded in t around 0 73.4%
associate-*r/73.4%
neg-mul-173.4%
*-commutative73.4%
associate-/r*84.0%
Simplified84.0%
if -1.65000000000000008e-43 < z < 1.05999999999999994e-66Initial program 92.4%
Taylor expanded in t around inf 80.3%
associate-/r*83.3%
Simplified83.3%
Final simplification83.7%
NOTE: y and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (or (<= z -6.2e+24) (not (<= z 7.2e-38))) (/ (/ x z) z) (/ x (* (- y z) t))))
assert(y < t);
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -6.2e+24) || !(z <= 7.2e-38)) {
tmp = (x / z) / z;
} else {
tmp = x / ((y - z) * t);
}
return tmp;
}
NOTE: y 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 <= (-6.2d+24)) .or. (.not. (z <= 7.2d-38))) then
tmp = (x / z) / z
else
tmp = x / ((y - z) * t)
end if
code = tmp
end function
assert y < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -6.2e+24) || !(z <= 7.2e-38)) {
tmp = (x / z) / z;
} else {
tmp = x / ((y - z) * t);
}
return tmp;
}
[y, t] = sort([y, t]) def code(x, y, z, t): tmp = 0 if (z <= -6.2e+24) or not (z <= 7.2e-38): tmp = (x / z) / z else: tmp = x / ((y - z) * t) return tmp
y, t = sort([y, t]) function code(x, y, z, t) tmp = 0.0 if ((z <= -6.2e+24) || !(z <= 7.2e-38)) tmp = Float64(Float64(x / z) / z); else tmp = Float64(x / Float64(Float64(y - z) * t)); end return tmp end
y, t = num2cell(sort([y, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if ((z <= -6.2e+24) || ~((z <= 7.2e-38)))
tmp = (x / z) / z;
else
tmp = x / ((y - z) * t);
end
tmp_2 = tmp;
end
NOTE: y and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[Or[LessEqual[z, -6.2e+24], N[Not[LessEqual[z, 7.2e-38]], $MachinePrecision]], N[(N[(x / z), $MachinePrecision] / z), $MachinePrecision], N[(x / N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[y, t] = \mathsf{sort}([y, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6.2 \cdot 10^{+24} \lor \neg \left(z \leq 7.2 \cdot 10^{-38}\right):\\
\;\;\;\;\frac{\frac{x}{z}}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\left(y - z\right) \cdot t}\\
\end{array}
\end{array}
if z < -6.20000000000000022e24 or 7.2000000000000001e-38 < z Initial program 83.3%
Taylor expanded in z around inf 70.1%
unpow270.1%
associate-/r*77.1%
Simplified77.1%
if -6.20000000000000022e24 < z < 7.2000000000000001e-38Initial program 93.9%
Taylor expanded in t around inf 73.4%
Final simplification75.2%
NOTE: y and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (or (<= z -4100.0) (not (<= z 6e-29))) (/ x (* y z)) (/ x (* y t))))
assert(y < t);
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -4100.0) || !(z <= 6e-29)) {
tmp = x / (y * z);
} else {
tmp = x / (y * t);
}
return tmp;
}
NOTE: y 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 <= (-4100.0d0)) .or. (.not. (z <= 6d-29))) then
tmp = x / (y * z)
else
tmp = x / (y * t)
end if
code = tmp
end function
assert y < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -4100.0) || !(z <= 6e-29)) {
tmp = x / (y * z);
} else {
tmp = x / (y * t);
}
return tmp;
}
[y, t] = sort([y, t]) def code(x, y, z, t): tmp = 0 if (z <= -4100.0) or not (z <= 6e-29): tmp = x / (y * z) else: tmp = x / (y * t) return tmp
y, t = sort([y, t]) function code(x, y, z, t) tmp = 0.0 if ((z <= -4100.0) || !(z <= 6e-29)) tmp = Float64(x / Float64(y * z)); else tmp = Float64(x / Float64(y * t)); end return tmp end
y, t = num2cell(sort([y, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if ((z <= -4100.0) || ~((z <= 6e-29)))
tmp = x / (y * z);
else
tmp = x / (y * t);
end
tmp_2 = tmp;
end
NOTE: y and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[Or[LessEqual[z, -4100.0], N[Not[LessEqual[z, 6e-29]], $MachinePrecision]], N[(x / N[(y * z), $MachinePrecision]), $MachinePrecision], N[(x / N[(y * t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[y, t] = \mathsf{sort}([y, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4100 \lor \neg \left(z \leq 6 \cdot 10^{-29}\right):\\
\;\;\;\;\frac{x}{y \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y \cdot t}\\
\end{array}
\end{array}
if z < -4100 or 6.0000000000000005e-29 < z Initial program 83.8%
associate-/r*99.2%
Simplified99.2%
Taylor expanded in y around inf 46.2%
Taylor expanded in t around 0 38.2%
associate-*r/38.2%
neg-mul-138.2%
*-commutative38.2%
Simplified38.2%
expm1-log1p-u37.8%
expm1-udef55.1%
add-sqr-sqrt26.4%
sqrt-unprod53.7%
sqr-neg53.7%
sqrt-unprod28.7%
add-sqr-sqrt55.2%
associate-/r*55.2%
Applied egg-rr55.2%
expm1-def41.9%
expm1-log1p42.3%
associate-/r*34.7%
Simplified34.7%
if -4100 < z < 6.0000000000000005e-29Initial program 93.7%
Taylor expanded in z around 0 58.7%
Final simplification46.4%
NOTE: y and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (or (<= z -5.2e-11) (not (<= z 1e-42))) (/ x (* z z)) (/ x (* y t))))
assert(y < t);
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -5.2e-11) || !(z <= 1e-42)) {
tmp = x / (z * z);
} else {
tmp = x / (y * t);
}
return tmp;
}
NOTE: y 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-11)) .or. (.not. (z <= 1d-42))) then
tmp = x / (z * z)
else
tmp = x / (y * t)
end if
code = tmp
end function
assert y < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -5.2e-11) || !(z <= 1e-42)) {
tmp = x / (z * z);
} else {
tmp = x / (y * t);
}
return tmp;
}
[y, t] = sort([y, t]) def code(x, y, z, t): tmp = 0 if (z <= -5.2e-11) or not (z <= 1e-42): tmp = x / (z * z) else: tmp = x / (y * t) return tmp
y, t = sort([y, t]) function code(x, y, z, t) tmp = 0.0 if ((z <= -5.2e-11) || !(z <= 1e-42)) tmp = Float64(x / Float64(z * z)); else tmp = Float64(x / Float64(y * t)); end return tmp end
y, t = num2cell(sort([y, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if ((z <= -5.2e-11) || ~((z <= 1e-42)))
tmp = x / (z * z);
else
tmp = x / (y * t);
end
tmp_2 = tmp;
end
NOTE: y and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[Or[LessEqual[z, -5.2e-11], N[Not[LessEqual[z, 1e-42]], $MachinePrecision]], N[(x / N[(z * z), $MachinePrecision]), $MachinePrecision], N[(x / N[(y * t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[y, t] = \mathsf{sort}([y, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.2 \cdot 10^{-11} \lor \neg \left(z \leq 10^{-42}\right):\\
\;\;\;\;\frac{x}{z \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y \cdot t}\\
\end{array}
\end{array}
if z < -5.2000000000000001e-11 or 1.00000000000000004e-42 < z Initial program 84.7%
Taylor expanded in z around inf 67.8%
unpow267.8%
Simplified67.8%
if -5.2000000000000001e-11 < z < 1.00000000000000004e-42Initial program 93.3%
Taylor expanded in z around 0 61.7%
Final simplification65.0%
NOTE: y and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (or (<= z -1.95e-10) (not (<= z 1e-42))) (/ (/ x z) z) (/ x (* y t))))
assert(y < t);
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.95e-10) || !(z <= 1e-42)) {
tmp = (x / z) / z;
} else {
tmp = x / (y * t);
}
return tmp;
}
NOTE: y 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.95d-10)) .or. (.not. (z <= 1d-42))) then
tmp = (x / z) / z
else
tmp = x / (y * t)
end if
code = tmp
end function
assert y < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.95e-10) || !(z <= 1e-42)) {
tmp = (x / z) / z;
} else {
tmp = x / (y * t);
}
return tmp;
}
[y, t] = sort([y, t]) def code(x, y, z, t): tmp = 0 if (z <= -1.95e-10) or not (z <= 1e-42): tmp = (x / z) / z else: tmp = x / (y * t) return tmp
y, t = sort([y, t]) function code(x, y, z, t) tmp = 0.0 if ((z <= -1.95e-10) || !(z <= 1e-42)) tmp = Float64(Float64(x / z) / z); else tmp = Float64(x / Float64(y * t)); end return tmp end
y, t = num2cell(sort([y, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if ((z <= -1.95e-10) || ~((z <= 1e-42)))
tmp = (x / z) / z;
else
tmp = x / (y * t);
end
tmp_2 = tmp;
end
NOTE: y and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[Or[LessEqual[z, -1.95e-10], N[Not[LessEqual[z, 1e-42]], $MachinePrecision]], N[(N[(x / z), $MachinePrecision] / z), $MachinePrecision], N[(x / N[(y * t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[y, t] = \mathsf{sort}([y, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.95 \cdot 10^{-10} \lor \neg \left(z \leq 10^{-42}\right):\\
\;\;\;\;\frac{\frac{x}{z}}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y \cdot t}\\
\end{array}
\end{array}
if z < -1.95e-10 or 1.00000000000000004e-42 < z Initial program 84.7%
Taylor expanded in z around inf 67.8%
unpow267.8%
associate-/r*74.2%
Simplified74.2%
if -1.95e-10 < z < 1.00000000000000004e-42Initial program 93.3%
Taylor expanded in z around 0 61.7%
Final simplification68.5%
NOTE: y 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(y < t);
double code(double x, double y, double z, double t) {
return (x / (y - z)) / (t - z);
}
NOTE: y 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 y < t;
public static double code(double x, double y, double z, double t) {
return (x / (y - z)) / (t - z);
}
[y, t] = sort([y, t]) def code(x, y, z, t): return (x / (y - z)) / (t - z)
y, t = sort([y, t]) function code(x, y, z, t) return Float64(Float64(x / Float64(y - z)) / Float64(t - z)) end
y, t = num2cell(sort([y, t])){:}
function tmp = code(x, y, z, t)
tmp = (x / (y - z)) / (t - z);
end
NOTE: y and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := N[(N[(x / N[(y - z), $MachinePrecision]), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[y, t] = \mathsf{sort}([y, t])\\
\\
\frac{\frac{x}{y - z}}{t - z}
\end{array}
Initial program 88.6%
associate-/r*97.6%
Simplified97.6%
Final simplification97.6%
NOTE: y and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (/ x (* y t)))
assert(y < t);
double code(double x, double y, double z, double t) {
return x / (y * t);
}
NOTE: y 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 y < t;
public static double code(double x, double y, double z, double t) {
return x / (y * t);
}
[y, t] = sort([y, t]) def code(x, y, z, t): return x / (y * t)
y, t = sort([y, t]) function code(x, y, z, t) return Float64(x / Float64(y * t)) end
y, t = num2cell(sort([y, t])){:}
function tmp = code(x, y, z, t)
tmp = x / (y * t);
end
NOTE: y 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}
[y, t] = \mathsf{sort}([y, t])\\
\\
\frac{x}{y \cdot t}
\end{array}
Initial program 88.6%
Taylor expanded in z around 0 38.7%
Final simplification38.7%
(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 2023274
(FPCore (x y z t)
:name "Data.Random.Distribution.Triangular:triangularCDF from random-fu-0.2.6.2, B"
:precision binary64
:herbie-target
(if (< (/ x (* (- y z) (- t z))) 0.0) (/ (/ x (- y z)) (- t z)) (* x (/ 1.0 (* (- y z) (- t z)))))
(/ x (* (- y z) (- t z))))