
(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 17 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 (let* ((t_1 (* (- y z) (- t z)))) (if (<= t_1 2e+284) (/ x t_1) (/ (/ x (- t z)) (- y z)))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = (y - z) * (t - z);
double tmp;
if (t_1 <= 2e+284) {
tmp = x / t_1;
} else {
tmp = (x / (t - z)) / (y - z);
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = (y - z) * (t - z)
if (t_1 <= 2d+284) then
tmp = x / t_1
else
tmp = (x / (t - z)) / (y - z)
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = (y - z) * (t - z);
double tmp;
if (t_1 <= 2e+284) {
tmp = x / t_1;
} else {
tmp = (x / (t - z)) / (y - z);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = (y - z) * (t - z) tmp = 0 if t_1 <= 2e+284: tmp = x / t_1 else: tmp = (x / (t - z)) / (y - z) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(Float64(y - z) * Float64(t - z)) tmp = 0.0 if (t_1 <= 2e+284) tmp = Float64(x / t_1); else tmp = Float64(Float64(x / Float64(t - z)) / Float64(y - z)); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = (y - z) * (t - z);
tmp = 0.0;
if (t_1 <= 2e+284)
tmp = x / t_1;
else
tmp = (x / (t - z)) / (y - z);
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(y - z), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 2e+284], N[(x / t$95$1), $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}
t_1 := \left(y - z\right) \cdot \left(t - z\right)\\
\mathbf{if}\;t\_1 \leq 2 \cdot 10^{+284}:\\
\;\;\;\;\frac{x}{t\_1}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{t - z}}{y - z}\\
\end{array}
\end{array}
if (*.f64 (-.f64 y z) (-.f64 t z)) < 2.00000000000000016e284Initial program 97.4%
if 2.00000000000000016e284 < (*.f64 (-.f64 y z) (-.f64 t z)) Initial program 73.7%
associate-/l/99.9%
Simplified99.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 -2.4e+160)
(/ (/ x z) z)
(if (or (<= z -1.65e-114) (not (<= z 1.6e-59)))
(/ 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 (z <= -2.4e+160) {
tmp = (x / z) / z;
} else if ((z <= -1.65e-114) || !(z <= 1.6e-59)) {
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 (z <= (-2.4d+160)) then
tmp = (x / z) / z
else if ((z <= (-1.65d-114)) .or. (.not. (z <= 1.6d-59))) 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 (z <= -2.4e+160) {
tmp = (x / z) / z;
} else if ((z <= -1.65e-114) || !(z <= 1.6e-59)) {
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 z <= -2.4e+160: tmp = (x / z) / z elif (z <= -1.65e-114) or not (z <= 1.6e-59): 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 (z <= -2.4e+160) tmp = Float64(Float64(x / z) / z); elseif ((z <= -1.65e-114) || !(z <= 1.6e-59)) tmp = Float64(x / Float64(z * Float64(z - y))); else tmp = Float64(Float64(x / t) / y); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (z <= -2.4e+160)
tmp = (x / z) / z;
elseif ((z <= -1.65e-114) || ~((z <= 1.6e-59)))
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[z, -2.4e+160], N[(N[(x / z), $MachinePrecision] / z), $MachinePrecision], If[Or[LessEqual[z, -1.65e-114], N[Not[LessEqual[z, 1.6e-59]], $MachinePrecision]], N[(x / N[(z * N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / t), $MachinePrecision] / y), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.4 \cdot 10^{+160}:\\
\;\;\;\;\frac{\frac{x}{z}}{z}\\
\mathbf{elif}\;z \leq -1.65 \cdot 10^{-114} \lor \neg \left(z \leq 1.6 \cdot 10^{-59}\right):\\
\;\;\;\;\frac{x}{z \cdot \left(z - y\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{t}}{y}\\
\end{array}
\end{array}
if z < -2.4000000000000001e160Initial program 64.7%
Taylor expanded in t around 0 64.7%
mul-1-neg64.7%
associate-/r*97.3%
distribute-neg-frac297.3%
neg-sub097.3%
sub-neg97.3%
+-commutative97.3%
associate--r+97.3%
neg-sub097.3%
remove-double-neg97.3%
Simplified97.3%
Taylor expanded in z around inf 90.4%
if -2.4000000000000001e160 < z < -1.65000000000000017e-114 or 1.6e-59 < z Initial program 90.7%
Taylor expanded in t around 0 72.1%
mul-1-neg72.1%
distribute-rgt-neg-in72.1%
neg-sub072.1%
sub-neg72.1%
+-commutative72.1%
associate--r+72.1%
neg-sub072.1%
remove-double-neg72.1%
Simplified72.1%
if -1.65000000000000017e-114 < z < 1.6e-59Initial program 95.7%
Taylor expanded in z around 0 71.5%
*-un-lft-identity71.5%
times-frac72.6%
Applied egg-rr72.6%
associate-*r/74.1%
associate-*l/74.2%
*-un-lft-identity74.2%
Applied egg-rr74.2%
Final simplification75.4%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(if (<= z -2.5e+46)
(/ (/ x (- z t)) z)
(if (<= z -2.3e-114)
(/ (/ x y) (- t z))
(if (<= z 6.4e-37) (/ x (* (- y z) t)) (/ (/ x z) (- z y))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -2.5e+46) {
tmp = (x / (z - t)) / z;
} else if (z <= -2.3e-114) {
tmp = (x / y) / (t - z);
} else if (z <= 6.4e-37) {
tmp = x / ((y - z) * t);
} else {
tmp = (x / z) / (z - y);
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (z <= (-2.5d+46)) then
tmp = (x / (z - t)) / z
else if (z <= (-2.3d-114)) then
tmp = (x / y) / (t - z)
else if (z <= 6.4d-37) then
tmp = x / ((y - z) * t)
else
tmp = (x / z) / (z - y)
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -2.5e+46) {
tmp = (x / (z - t)) / z;
} else if (z <= -2.3e-114) {
tmp = (x / y) / (t - z);
} else if (z <= 6.4e-37) {
tmp = x / ((y - z) * t);
} else {
tmp = (x / z) / (z - y);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if z <= -2.5e+46: tmp = (x / (z - t)) / z elif z <= -2.3e-114: tmp = (x / y) / (t - z) elif z <= 6.4e-37: tmp = x / ((y - z) * t) else: tmp = (x / z) / (z - y) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (z <= -2.5e+46) tmp = Float64(Float64(x / Float64(z - t)) / z); elseif (z <= -2.3e-114) tmp = Float64(Float64(x / y) / Float64(t - z)); elseif (z <= 6.4e-37) tmp = Float64(x / Float64(Float64(y - z) * t)); else tmp = Float64(Float64(x / z) / Float64(z - y)); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (z <= -2.5e+46)
tmp = (x / (z - t)) / z;
elseif (z <= -2.3e-114)
tmp = (x / y) / (t - z);
elseif (z <= 6.4e-37)
tmp = x / ((y - z) * t);
else
tmp = (x / z) / (z - y);
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[z, -2.5e+46], N[(N[(x / N[(z - t), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[z, -2.3e-114], N[(N[(x / y), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 6.4e-37], N[(x / N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision], N[(N[(x / z), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.5 \cdot 10^{+46}:\\
\;\;\;\;\frac{\frac{x}{z - t}}{z}\\
\mathbf{elif}\;z \leq -2.3 \cdot 10^{-114}:\\
\;\;\;\;\frac{\frac{x}{y}}{t - z}\\
\mathbf{elif}\;z \leq 6.4 \cdot 10^{-37}:\\
\;\;\;\;\frac{x}{\left(y - z\right) \cdot t}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{z}}{z - y}\\
\end{array}
\end{array}
if z < -2.5000000000000001e46Initial program 76.1%
associate-/l/99.8%
Simplified99.8%
Taylor expanded in y around 0 91.2%
neg-mul-191.2%
Simplified91.2%
frac-2neg91.2%
div-inv91.1%
distribute-neg-frac291.1%
sub-neg91.1%
distribute-neg-in91.1%
remove-double-neg91.1%
remove-double-neg91.1%
Applied egg-rr91.1%
associate-*r/91.2%
*-rgt-identity91.2%
+-commutative91.2%
unsub-neg91.2%
Simplified91.2%
if -2.5000000000000001e46 < z < -2.2999999999999999e-114Initial program 93.0%
Taylor expanded in y around inf 63.9%
associate-/r*69.6%
Simplified69.6%
if -2.2999999999999999e-114 < z < 6.3999999999999998e-37Initial program 96.0%
Taylor expanded in t around inf 78.0%
if 6.3999999999999998e-37 < z Initial program 87.8%
Taylor expanded in t around 0 73.9%
mul-1-neg73.9%
associate-/r*83.0%
distribute-neg-frac283.0%
neg-sub083.0%
sub-neg83.0%
+-commutative83.0%
associate--r+83.0%
neg-sub083.0%
remove-double-neg83.0%
Simplified83.0%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(if (<= z -4.1e+46)
(/ (/ x z) (- z t))
(if (<= z -3.4e-113)
(/ (/ x y) (- t z))
(if (<= z 3.8e-35) (/ x (* (- y z) t)) (/ (/ x z) (- z y))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -4.1e+46) {
tmp = (x / z) / (z - t);
} else if (z <= -3.4e-113) {
tmp = (x / y) / (t - z);
} else if (z <= 3.8e-35) {
tmp = x / ((y - z) * t);
} else {
tmp = (x / z) / (z - y);
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (z <= (-4.1d+46)) then
tmp = (x / z) / (z - t)
else if (z <= (-3.4d-113)) then
tmp = (x / y) / (t - z)
else if (z <= 3.8d-35) then
tmp = x / ((y - z) * t)
else
tmp = (x / z) / (z - y)
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -4.1e+46) {
tmp = (x / z) / (z - t);
} else if (z <= -3.4e-113) {
tmp = (x / y) / (t - z);
} else if (z <= 3.8e-35) {
tmp = x / ((y - z) * t);
} else {
tmp = (x / z) / (z - y);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if z <= -4.1e+46: tmp = (x / z) / (z - t) elif z <= -3.4e-113: tmp = (x / y) / (t - z) elif z <= 3.8e-35: tmp = x / ((y - z) * t) else: tmp = (x / z) / (z - y) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (z <= -4.1e+46) tmp = Float64(Float64(x / z) / Float64(z - t)); elseif (z <= -3.4e-113) tmp = Float64(Float64(x / y) / Float64(t - z)); elseif (z <= 3.8e-35) tmp = Float64(x / Float64(Float64(y - z) * t)); else tmp = Float64(Float64(x / z) / Float64(z - y)); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (z <= -4.1e+46)
tmp = (x / z) / (z - t);
elseif (z <= -3.4e-113)
tmp = (x / y) / (t - z);
elseif (z <= 3.8e-35)
tmp = x / ((y - z) * t);
else
tmp = (x / z) / (z - y);
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[z, -4.1e+46], N[(N[(x / z), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -3.4e-113], N[(N[(x / y), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.8e-35], N[(x / N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision], N[(N[(x / z), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.1 \cdot 10^{+46}:\\
\;\;\;\;\frac{\frac{x}{z}}{z - t}\\
\mathbf{elif}\;z \leq -3.4 \cdot 10^{-113}:\\
\;\;\;\;\frac{\frac{x}{y}}{t - z}\\
\mathbf{elif}\;z \leq 3.8 \cdot 10^{-35}:\\
\;\;\;\;\frac{x}{\left(y - z\right) \cdot t}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{z}}{z - y}\\
\end{array}
\end{array}
if z < -4.1e46Initial program 76.1%
Taylor expanded in y around 0 71.5%
mul-1-neg71.5%
associate-/r*91.1%
distribute-neg-frac291.1%
sub-neg91.1%
+-commutative91.1%
distribute-neg-in91.1%
remove-double-neg91.1%
unsub-neg91.1%
Simplified91.1%
if -4.1e46 < z < -3.4000000000000002e-113Initial program 93.0%
Taylor expanded in y around inf 63.9%
associate-/r*69.6%
Simplified69.6%
if -3.4000000000000002e-113 < z < 3.8000000000000001e-35Initial program 96.0%
Taylor expanded in t around inf 78.0%
if 3.8000000000000001e-35 < z Initial program 87.8%
Taylor expanded in t around 0 73.9%
mul-1-neg73.9%
associate-/r*83.0%
distribute-neg-frac283.0%
neg-sub083.0%
sub-neg83.0%
+-commutative83.0%
associate--r+83.0%
neg-sub083.0%
remove-double-neg83.0%
Simplified83.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 z) (- z t))))
(if (<= z -6.8e+46)
t_1
(if (<= z -9.5e-113)
(/ (/ x y) (- t z))
(if (<= z 1.05e-30) (/ x (* (- y 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 / z) / (z - t);
double tmp;
if (z <= -6.8e+46) {
tmp = t_1;
} else if (z <= -9.5e-113) {
tmp = (x / y) / (t - z);
} else if (z <= 1.05e-30) {
tmp = x / ((y - 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 / z) / (z - t)
if (z <= (-6.8d+46)) then
tmp = t_1
else if (z <= (-9.5d-113)) then
tmp = (x / y) / (t - z)
else if (z <= 1.05d-30) then
tmp = x / ((y - 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 / z) / (z - t);
double tmp;
if (z <= -6.8e+46) {
tmp = t_1;
} else if (z <= -9.5e-113) {
tmp = (x / y) / (t - z);
} else if (z <= 1.05e-30) {
tmp = x / ((y - 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 / z) / (z - t) tmp = 0 if z <= -6.8e+46: tmp = t_1 elif z <= -9.5e-113: tmp = (x / y) / (t - z) elif z <= 1.05e-30: tmp = x / ((y - 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(Float64(x / z) / Float64(z - t)) tmp = 0.0 if (z <= -6.8e+46) tmp = t_1; elseif (z <= -9.5e-113) tmp = Float64(Float64(x / y) / Float64(t - z)); elseif (z <= 1.05e-30) tmp = Float64(x / Float64(Float64(y - 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 / z) / (z - t);
tmp = 0.0;
if (z <= -6.8e+46)
tmp = t_1;
elseif (z <= -9.5e-113)
tmp = (x / y) / (t - z);
elseif (z <= 1.05e-30)
tmp = x / ((y - 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[(N[(x / z), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -6.8e+46], t$95$1, If[LessEqual[z, -9.5e-113], N[(N[(x / y), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.05e-30], N[(x / N[(N[(y - z), $MachinePrecision] * t), $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 - t}\\
\mathbf{if}\;z \leq -6.8 \cdot 10^{+46}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -9.5 \cdot 10^{-113}:\\
\;\;\;\;\frac{\frac{x}{y}}{t - z}\\
\mathbf{elif}\;z \leq 1.05 \cdot 10^{-30}:\\
\;\;\;\;\frac{x}{\left(y - z\right) \cdot t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -6.7999999999999996e46 or 1.0500000000000001e-30 < z Initial program 81.5%
Taylor expanded in y around 0 76.0%
mul-1-neg76.0%
associate-/r*90.7%
distribute-neg-frac290.7%
sub-neg90.7%
+-commutative90.7%
distribute-neg-in90.7%
remove-double-neg90.7%
unsub-neg90.7%
Simplified90.7%
if -6.7999999999999996e46 < z < -9.49999999999999987e-113Initial program 93.0%
Taylor expanded in y around inf 63.9%
associate-/r*69.6%
Simplified69.6%
if -9.49999999999999987e-113 < z < 1.0500000000000001e-30Initial program 96.1%
Taylor expanded in t around inf 77.7%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(if (<= z -2.4e+160)
(/ (/ x z) z)
(if (<= z -2e-113)
(/ x (* z (- z y)))
(if (<= z 1.65e+47) (/ x (* (- y z) t)) (* (/ x 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 <= -2.4e+160) {
tmp = (x / z) / z;
} else if (z <= -2e-113) {
tmp = x / (z * (z - y));
} else if (z <= 1.65e+47) {
tmp = x / ((y - z) * t);
} else {
tmp = (x / 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 <= (-2.4d+160)) then
tmp = (x / z) / z
else if (z <= (-2d-113)) then
tmp = x / (z * (z - y))
else if (z <= 1.65d+47) then
tmp = x / ((y - z) * t)
else
tmp = (x / 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 <= -2.4e+160) {
tmp = (x / z) / z;
} else if (z <= -2e-113) {
tmp = x / (z * (z - y));
} else if (z <= 1.65e+47) {
tmp = x / ((y - z) * t);
} else {
tmp = (x / 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 <= -2.4e+160: tmp = (x / z) / z elif z <= -2e-113: tmp = x / (z * (z - y)) elif z <= 1.65e+47: tmp = x / ((y - z) * t) else: tmp = (x / 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 <= -2.4e+160) tmp = Float64(Float64(x / z) / z); elseif (z <= -2e-113) tmp = Float64(x / Float64(z * Float64(z - y))); elseif (z <= 1.65e+47) tmp = Float64(x / Float64(Float64(y - z) * t)); else tmp = Float64(Float64(x / 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 <= -2.4e+160)
tmp = (x / z) / z;
elseif (z <= -2e-113)
tmp = x / (z * (z - y));
elseif (z <= 1.65e+47)
tmp = x / ((y - z) * t);
else
tmp = (x / 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, -2.4e+160], N[(N[(x / z), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[z, -2e-113], N[(x / N[(z * N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.65e+47], N[(x / N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision], N[(N[(x / z), $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 -2.4 \cdot 10^{+160}:\\
\;\;\;\;\frac{\frac{x}{z}}{z}\\
\mathbf{elif}\;z \leq -2 \cdot 10^{-113}:\\
\;\;\;\;\frac{x}{z \cdot \left(z - y\right)}\\
\mathbf{elif}\;z \leq 1.65 \cdot 10^{+47}:\\
\;\;\;\;\frac{x}{\left(y - z\right) \cdot t}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{z} \cdot \frac{1}{z}\\
\end{array}
\end{array}
if z < -2.4000000000000001e160Initial program 64.7%
Taylor expanded in t around 0 64.7%
mul-1-neg64.7%
associate-/r*97.3%
distribute-neg-frac297.3%
neg-sub097.3%
sub-neg97.3%
+-commutative97.3%
associate--r+97.3%
neg-sub097.3%
remove-double-neg97.3%
Simplified97.3%
Taylor expanded in z around inf 90.4%
if -2.4000000000000001e160 < z < -1.99999999999999996e-113Initial program 92.8%
Taylor expanded in t around 0 75.5%
mul-1-neg75.5%
distribute-rgt-neg-in75.5%
neg-sub075.5%
sub-neg75.5%
+-commutative75.5%
associate--r+75.5%
neg-sub075.5%
remove-double-neg75.5%
Simplified75.5%
if -1.99999999999999996e-113 < z < 1.65e47Initial program 96.4%
Taylor expanded in t around inf 76.2%
if 1.65e47 < z Initial program 84.5%
associate-/l/99.9%
Simplified99.9%
Taylor expanded in y around 0 93.8%
neg-mul-193.8%
Simplified93.8%
add-sqr-sqrt0.0%
sqrt-unprod68.7%
sqr-neg68.7%
sqrt-unprod68.5%
add-sqr-sqrt68.5%
div-inv68.5%
sub-neg68.5%
+-commutative68.5%
add-sqr-sqrt0.0%
sqrt-unprod80.5%
sqr-neg80.5%
sqrt-unprod87.9%
add-sqr-sqrt88.0%
Applied egg-rr88.0%
Taylor expanded in z around inf 86.1%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(if (<= z -2.8e+46)
(/ (/ x z) z)
(if (<= z -2.1e-112)
(/ x (* y (- z)))
(if (<= z 21000000.0) (/ (/ x t) y) (* (/ x 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 <= -2.8e+46) {
tmp = (x / z) / z;
} else if (z <= -2.1e-112) {
tmp = x / (y * -z);
} else if (z <= 21000000.0) {
tmp = (x / t) / y;
} else {
tmp = (x / 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 <= (-2.8d+46)) then
tmp = (x / z) / z
else if (z <= (-2.1d-112)) then
tmp = x / (y * -z)
else if (z <= 21000000.0d0) then
tmp = (x / t) / y
else
tmp = (x / 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 <= -2.8e+46) {
tmp = (x / z) / z;
} else if (z <= -2.1e-112) {
tmp = x / (y * -z);
} else if (z <= 21000000.0) {
tmp = (x / t) / y;
} else {
tmp = (x / 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 <= -2.8e+46: tmp = (x / z) / z elif z <= -2.1e-112: tmp = x / (y * -z) elif z <= 21000000.0: tmp = (x / t) / y else: tmp = (x / 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 <= -2.8e+46) tmp = Float64(Float64(x / z) / z); elseif (z <= -2.1e-112) tmp = Float64(x / Float64(y * Float64(-z))); elseif (z <= 21000000.0) tmp = Float64(Float64(x / t) / y); else tmp = Float64(Float64(x / 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 <= -2.8e+46)
tmp = (x / z) / z;
elseif (z <= -2.1e-112)
tmp = x / (y * -z);
elseif (z <= 21000000.0)
tmp = (x / t) / y;
else
tmp = (x / 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, -2.8e+46], N[(N[(x / z), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[z, -2.1e-112], N[(x / N[(y * (-z)), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 21000000.0], N[(N[(x / t), $MachinePrecision] / y), $MachinePrecision], N[(N[(x / z), $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 -2.8 \cdot 10^{+46}:\\
\;\;\;\;\frac{\frac{x}{z}}{z}\\
\mathbf{elif}\;z \leq -2.1 \cdot 10^{-112}:\\
\;\;\;\;\frac{x}{y \cdot \left(-z\right)}\\
\mathbf{elif}\;z \leq 21000000:\\
\;\;\;\;\frac{\frac{x}{t}}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{z} \cdot \frac{1}{z}\\
\end{array}
\end{array}
if z < -2.80000000000000018e46Initial program 76.1%
Taylor expanded in t around 0 76.0%
mul-1-neg76.0%
associate-/r*95.1%
distribute-neg-frac295.1%
neg-sub095.1%
sub-neg95.1%
+-commutative95.1%
associate--r+95.1%
neg-sub095.1%
remove-double-neg95.1%
Simplified95.1%
Taylor expanded in z around inf 85.1%
if -2.80000000000000018e46 < z < -2.1000000000000001e-112Initial program 93.0%
Taylor expanded in y around inf 63.9%
associate-/r*69.6%
Simplified69.6%
Taylor expanded in t around 0 47.4%
associate-*r/47.4%
neg-mul-147.4%
*-commutative47.4%
Simplified47.4%
if -2.1000000000000001e-112 < z < 2.1e7Initial program 96.3%
Taylor expanded in z around 0 66.5%
*-un-lft-identity66.5%
times-frac67.5%
Applied egg-rr67.5%
associate-*r/68.8%
associate-*l/68.8%
*-un-lft-identity68.8%
Applied egg-rr68.8%
if 2.1e7 < z Initial program 85.6%
associate-/l/99.8%
Simplified99.8%
Taylor expanded in y around 0 92.5%
neg-mul-192.5%
Simplified92.5%
add-sqr-sqrt0.0%
sqrt-unprod65.5%
sqr-neg65.5%
sqrt-unprod65.3%
add-sqr-sqrt65.3%
div-inv65.3%
sub-neg65.3%
+-commutative65.3%
add-sqr-sqrt0.0%
sqrt-unprod78.4%
sqr-neg78.4%
sqrt-unprod85.3%
add-sqr-sqrt85.4%
Applied egg-rr85.4%
Taylor expanded in z around inf 81.9%
Final simplification72.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 -3.7e+46)
t_1
(if (<= z -2.1e-112)
(/ x (* y (- z)))
(if (<= z 230000.0) (/ (/ 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 <= -3.7e+46) {
tmp = t_1;
} else if (z <= -2.1e-112) {
tmp = x / (y * -z);
} else if (z <= 230000.0) {
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 <= (-3.7d+46)) then
tmp = t_1
else if (z <= (-2.1d-112)) then
tmp = x / (y * -z)
else if (z <= 230000.0d0) 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 <= -3.7e+46) {
tmp = t_1;
} else if (z <= -2.1e-112) {
tmp = x / (y * -z);
} else if (z <= 230000.0) {
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 <= -3.7e+46: tmp = t_1 elif z <= -2.1e-112: tmp = x / (y * -z) elif z <= 230000.0: 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(Float64(x / z) / z) tmp = 0.0 if (z <= -3.7e+46) tmp = t_1; elseif (z <= -2.1e-112) tmp = Float64(x / Float64(y * Float64(-z))); elseif (z <= 230000.0) tmp = Float64(Float64(x / 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 <= -3.7e+46)
tmp = t_1;
elseif (z <= -2.1e-112)
tmp = x / (y * -z);
elseif (z <= 230000.0)
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[(N[(x / z), $MachinePrecision] / z), $MachinePrecision]}, If[LessEqual[z, -3.7e+46], t$95$1, If[LessEqual[z, -2.1e-112], N[(x / N[(y * (-z)), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 230000.0], N[(N[(x / t), $MachinePrecision] / y), $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 -3.7 \cdot 10^{+46}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -2.1 \cdot 10^{-112}:\\
\;\;\;\;\frac{x}{y \cdot \left(-z\right)}\\
\mathbf{elif}\;z \leq 230000:\\
\;\;\;\;\frac{\frac{x}{t}}{y}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -3.6999999999999999e46 or 2.3e5 < z Initial program 80.5%
Taylor expanded in t around 0 76.3%
mul-1-neg76.3%
associate-/r*91.6%
distribute-neg-frac291.6%
neg-sub091.6%
sub-neg91.6%
+-commutative91.6%
associate--r+91.6%
neg-sub091.6%
remove-double-neg91.6%
Simplified91.6%
Taylor expanded in z around inf 83.6%
if -3.6999999999999999e46 < z < -2.1000000000000001e-112Initial program 93.0%
Taylor expanded in y around inf 63.9%
associate-/r*69.6%
Simplified69.6%
Taylor expanded in t around 0 47.4%
associate-*r/47.4%
neg-mul-147.4%
*-commutative47.4%
Simplified47.4%
if -2.1000000000000001e-112 < z < 2.3e5Initial program 96.3%
Taylor expanded in z around 0 66.5%
*-un-lft-identity66.5%
times-frac67.5%
Applied egg-rr67.5%
associate-*r/68.8%
associate-*l/68.8%
*-un-lft-identity68.8%
Applied egg-rr68.8%
Final simplification72.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 -4e+105) (/ (/ x (- z t)) z) (if (<= z 2.8e+134) (/ x (* (- y z) (- t z))) (/ (/ x z) (- z y)))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -4e+105) {
tmp = (x / (z - t)) / z;
} else if (z <= 2.8e+134) {
tmp = x / ((y - z) * (t - z));
} else {
tmp = (x / z) / (z - y);
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (z <= (-4d+105)) then
tmp = (x / (z - t)) / z
else if (z <= 2.8d+134) then
tmp = x / ((y - z) * (t - z))
else
tmp = (x / z) / (z - y)
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -4e+105) {
tmp = (x / (z - t)) / z;
} else if (z <= 2.8e+134) {
tmp = x / ((y - z) * (t - z));
} else {
tmp = (x / z) / (z - y);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if z <= -4e+105: tmp = (x / (z - t)) / z elif z <= 2.8e+134: tmp = x / ((y - z) * (t - z)) else: tmp = (x / z) / (z - y) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (z <= -4e+105) tmp = Float64(Float64(x / Float64(z - t)) / z); elseif (z <= 2.8e+134) tmp = Float64(x / Float64(Float64(y - z) * Float64(t - z))); else tmp = Float64(Float64(x / z) / Float64(z - y)); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (z <= -4e+105)
tmp = (x / (z - t)) / z;
elseif (z <= 2.8e+134)
tmp = x / ((y - z) * (t - z));
else
tmp = (x / z) / (z - y);
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[z, -4e+105], N[(N[(x / N[(z - t), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[z, 2.8e+134], N[(x / N[(N[(y - z), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / z), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4 \cdot 10^{+105}:\\
\;\;\;\;\frac{\frac{x}{z - t}}{z}\\
\mathbf{elif}\;z \leq 2.8 \cdot 10^{+134}:\\
\;\;\;\;\frac{x}{\left(y - z\right) \cdot \left(t - z\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{z}}{z - y}\\
\end{array}
\end{array}
if z < -3.9999999999999998e105Initial program 70.9%
associate-/l/99.8%
Simplified99.8%
Taylor expanded in y around 0 94.9%
neg-mul-194.9%
Simplified94.9%
frac-2neg94.9%
div-inv94.8%
distribute-neg-frac294.8%
sub-neg94.8%
distribute-neg-in94.8%
remove-double-neg94.8%
remove-double-neg94.8%
Applied egg-rr94.8%
associate-*r/94.9%
*-rgt-identity94.9%
+-commutative94.9%
unsub-neg94.9%
Simplified94.9%
if -3.9999999999999998e105 < z < 2.7999999999999999e134Initial program 95.0%
if 2.7999999999999999e134 < z Initial program 85.4%
Taylor expanded in t around 0 83.1%
mul-1-neg83.1%
associate-/r*95.2%
distribute-neg-frac295.2%
neg-sub095.2%
sub-neg95.2%
+-commutative95.2%
associate--r+95.2%
neg-sub095.2%
remove-double-neg95.2%
Simplified95.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 (<= t -2.8e-156) (/ (/ x y) (- t z)) (if (<= t 5800.0) (* (/ x (- y z)) (/ -1.0 z)) (/ (/ x t) (- y z)))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -2.8e-156) {
tmp = (x / y) / (t - z);
} else if (t <= 5800.0) {
tmp = (x / (y - z)) * (-1.0 / z);
} else {
tmp = (x / t) / (y - z);
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (t <= (-2.8d-156)) then
tmp = (x / y) / (t - z)
else if (t <= 5800.0d0) then
tmp = (x / (y - z)) * ((-1.0d0) / z)
else
tmp = (x / t) / (y - z)
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= -2.8e-156) {
tmp = (x / y) / (t - z);
} else if (t <= 5800.0) {
tmp = (x / (y - z)) * (-1.0 / z);
} else {
tmp = (x / t) / (y - z);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if t <= -2.8e-156: tmp = (x / y) / (t - z) elif t <= 5800.0: tmp = (x / (y - z)) * (-1.0 / z) else: tmp = (x / t) / (y - z) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (t <= -2.8e-156) tmp = Float64(Float64(x / y) / Float64(t - z)); elseif (t <= 5800.0) tmp = Float64(Float64(x / Float64(y - z)) * Float64(-1.0 / z)); else tmp = Float64(Float64(x / t) / Float64(y - z)); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (t <= -2.8e-156)
tmp = (x / y) / (t - z);
elseif (t <= 5800.0)
tmp = (x / (y - z)) * (-1.0 / z);
else
tmp = (x / t) / (y - z);
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[t, -2.8e-156], N[(N[(x / y), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 5800.0], N[(N[(x / N[(y - z), $MachinePrecision]), $MachinePrecision] * N[(-1.0 / z), $MachinePrecision]), $MachinePrecision], N[(N[(x / t), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.8 \cdot 10^{-156}:\\
\;\;\;\;\frac{\frac{x}{y}}{t - z}\\
\mathbf{elif}\;t \leq 5800:\\
\;\;\;\;\frac{x}{y - z} \cdot \frac{-1}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{t}}{y - z}\\
\end{array}
\end{array}
if t < -2.8000000000000002e-156Initial program 92.5%
Taylor expanded in y around inf 62.5%
associate-/r*62.3%
Simplified62.3%
if -2.8000000000000002e-156 < t < 5800Initial program 88.7%
associate-/r*95.6%
div-inv95.6%
Applied egg-rr95.6%
Taylor expanded in t around 0 79.8%
if 5800 < t Initial program 82.4%
associate-/l/98.2%
Simplified98.2%
Taylor expanded in t around inf 88.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 (<= t -2.85e-161) (/ (/ x y) (- t z)) (if (<= t 1520.0) (/ x (* z (- z y))) (/ (/ x t) (- y z)))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -2.85e-161) {
tmp = (x / y) / (t - z);
} else if (t <= 1520.0) {
tmp = x / (z * (z - y));
} else {
tmp = (x / t) / (y - z);
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (t <= (-2.85d-161)) then
tmp = (x / y) / (t - z)
else if (t <= 1520.0d0) then
tmp = x / (z * (z - y))
else
tmp = (x / t) / (y - z)
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= -2.85e-161) {
tmp = (x / y) / (t - z);
} else if (t <= 1520.0) {
tmp = x / (z * (z - y));
} else {
tmp = (x / t) / (y - z);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if t <= -2.85e-161: tmp = (x / y) / (t - z) elif t <= 1520.0: tmp = x / (z * (z - y)) else: tmp = (x / t) / (y - z) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (t <= -2.85e-161) tmp = Float64(Float64(x / y) / Float64(t - z)); elseif (t <= 1520.0) 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 <= -2.85e-161)
tmp = (x / y) / (t - z);
elseif (t <= 1520.0)
tmp = x / (z * (z - y));
else
tmp = (x / t) / (y - z);
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[t, -2.85e-161], N[(N[(x / y), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1520.0], 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 -2.85 \cdot 10^{-161}:\\
\;\;\;\;\frac{\frac{x}{y}}{t - z}\\
\mathbf{elif}\;t \leq 1520:\\
\;\;\;\;\frac{x}{z \cdot \left(z - y\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{t}}{y - z}\\
\end{array}
\end{array}
if t < -2.85000000000000011e-161Initial program 92.5%
Taylor expanded in y around inf 62.5%
associate-/r*62.3%
Simplified62.3%
if -2.85000000000000011e-161 < t < 1520Initial program 88.7%
Taylor expanded in t around 0 70.8%
mul-1-neg70.8%
distribute-rgt-neg-in70.8%
neg-sub070.8%
sub-neg70.8%
+-commutative70.8%
associate--r+70.8%
neg-sub070.8%
remove-double-neg70.8%
Simplified70.8%
if 1520 < t Initial program 82.4%
associate-/l/98.2%
Simplified98.2%
Taylor expanded in t around inf 88.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 -5.5e+46) (not (<= z 2000.0))) (/ (/ x z) z) (/ (/ x y) t)))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -5.5e+46) || !(z <= 2000.0)) {
tmp = (x / z) / z;
} else {
tmp = (x / y) / t;
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((z <= (-5.5d+46)) .or. (.not. (z <= 2000.0d0))) then
tmp = (x / z) / z
else
tmp = (x / y) / t
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -5.5e+46) || !(z <= 2000.0)) {
tmp = (x / z) / z;
} else {
tmp = (x / y) / t;
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if (z <= -5.5e+46) or not (z <= 2000.0): tmp = (x / z) / z else: tmp = (x / y) / t return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if ((z <= -5.5e+46) || !(z <= 2000.0)) tmp = Float64(Float64(x / z) / z); else tmp = Float64(Float64(x / y) / t); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if ((z <= -5.5e+46) || ~((z <= 2000.0)))
tmp = (x / z) / z;
else
tmp = (x / y) / t;
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[Or[LessEqual[z, -5.5e+46], N[Not[LessEqual[z, 2000.0]], $MachinePrecision]], N[(N[(x / z), $MachinePrecision] / z), $MachinePrecision], N[(N[(x / y), $MachinePrecision] / t), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.5 \cdot 10^{+46} \lor \neg \left(z \leq 2000\right):\\
\;\;\;\;\frac{\frac{x}{z}}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{t}\\
\end{array}
\end{array}
if z < -5.4999999999999998e46 or 2e3 < z Initial program 80.5%
Taylor expanded in t around 0 76.3%
mul-1-neg76.3%
associate-/r*91.6%
distribute-neg-frac291.6%
neg-sub091.6%
sub-neg91.6%
+-commutative91.6%
associate--r+91.6%
neg-sub091.6%
remove-double-neg91.6%
Simplified91.6%
Taylor expanded in z around inf 83.6%
if -5.4999999999999998e46 < z < 2e3Initial program 95.5%
Taylor expanded in y around inf 74.9%
associate-/r*75.0%
Simplified75.0%
Taylor expanded in t around inf 59.9%
Final simplification70.3%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (or (<= z -3.7e+99) (not (<= z 1.26e+92))) (/ x (* z t)) (/ (/ x y) t)))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -3.7e+99) || !(z <= 1.26e+92)) {
tmp = x / (z * t);
} else {
tmp = (x / y) / t;
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((z <= (-3.7d+99)) .or. (.not. (z <= 1.26d+92))) then
tmp = x / (z * t)
else
tmp = (x / y) / t
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -3.7e+99) || !(z <= 1.26e+92)) {
tmp = x / (z * t);
} else {
tmp = (x / y) / t;
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if (z <= -3.7e+99) or not (z <= 1.26e+92): tmp = x / (z * t) else: tmp = (x / y) / t return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if ((z <= -3.7e+99) || !(z <= 1.26e+92)) tmp = Float64(x / Float64(z * t)); else tmp = Float64(Float64(x / y) / t); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if ((z <= -3.7e+99) || ~((z <= 1.26e+92)))
tmp = x / (z * t);
else
tmp = (x / y) / t;
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[Or[LessEqual[z, -3.7e+99], N[Not[LessEqual[z, 1.26e+92]], $MachinePrecision]], N[(x / N[(z * t), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] / t), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.7 \cdot 10^{+99} \lor \neg \left(z \leq 1.26 \cdot 10^{+92}\right):\\
\;\;\;\;\frac{x}{z \cdot t}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{t}\\
\end{array}
\end{array}
if z < -3.7000000000000001e99 or 1.26e92 < z Initial program 77.1%
associate-/l/99.8%
Simplified99.8%
Taylor expanded in y around 0 95.1%
neg-mul-195.1%
Simplified95.1%
add-sqr-sqrt52.6%
sqrt-unprod75.0%
sqr-neg75.0%
sqrt-unprod33.4%
add-sqr-sqrt65.5%
div-inv65.5%
sub-neg65.5%
+-commutative65.5%
add-sqr-sqrt32.2%
sqrt-unprod69.4%
sqr-neg69.4%
sqrt-unprod40.4%
add-sqr-sqrt89.9%
Applied egg-rr89.9%
Taylor expanded in z around 0 37.3%
if -3.7000000000000001e99 < z < 1.26e92Initial program 95.5%
Taylor expanded in y around inf 71.2%
associate-/r*71.3%
Simplified71.3%
Taylor expanded in t around inf 56.1%
Final simplification49.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 -6.5e+91) (not (<= z 2.5e+95))) (/ x (* z t)) (/ (/ x t) y)))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -6.5e+91) || !(z <= 2.5e+95)) {
tmp = x / (z * t);
} else {
tmp = (x / t) / y;
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((z <= (-6.5d+91)) .or. (.not. (z <= 2.5d+95))) then
tmp = x / (z * t)
else
tmp = (x / t) / y
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -6.5e+91) || !(z <= 2.5e+95)) {
tmp = x / (z * t);
} else {
tmp = (x / t) / y;
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if (z <= -6.5e+91) or not (z <= 2.5e+95): tmp = x / (z * t) else: tmp = (x / t) / y return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if ((z <= -6.5e+91) || !(z <= 2.5e+95)) tmp = Float64(x / Float64(z * t)); else tmp = Float64(Float64(x / t) / y); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if ((z <= -6.5e+91) || ~((z <= 2.5e+95)))
tmp = x / (z * t);
else
tmp = (x / t) / y;
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[Or[LessEqual[z, -6.5e+91], N[Not[LessEqual[z, 2.5e+95]], $MachinePrecision]], N[(x / N[(z * t), $MachinePrecision]), $MachinePrecision], N[(N[(x / t), $MachinePrecision] / y), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6.5 \cdot 10^{+91} \lor \neg \left(z \leq 2.5 \cdot 10^{+95}\right):\\
\;\;\;\;\frac{x}{z \cdot t}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{t}}{y}\\
\end{array}
\end{array}
if z < -6.4999999999999997e91 or 2.50000000000000012e95 < z Initial program 77.8%
associate-/l/99.9%
Simplified99.9%
Taylor expanded in y around 0 95.2%
neg-mul-195.2%
Simplified95.2%
add-sqr-sqrt54.1%
sqrt-unprod75.8%
sqr-neg75.8%
sqrt-unprod32.3%
add-sqr-sqrt66.6%
div-inv66.6%
sub-neg66.6%
+-commutative66.6%
add-sqr-sqrt34.3%
sqrt-unprod70.3%
sqr-neg70.3%
sqrt-unprod39.1%
add-sqr-sqrt90.3%
Applied egg-rr90.3%
Taylor expanded in z around 0 38.3%
if -6.4999999999999997e91 < z < 2.50000000000000012e95Initial program 95.4%
Taylor expanded in z around 0 54.4%
*-un-lft-identity54.4%
times-frac57.0%
Applied egg-rr57.0%
associate-*r/56.9%
associate-*l/56.9%
*-un-lft-identity56.9%
Applied egg-rr56.9%
Final simplification50.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 -2.35e+91) (not (<= z 2e+92))) (/ x (* z t)) (/ x (* y t))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -2.35e+91) || !(z <= 2e+92)) {
tmp = x / (z * t);
} else {
tmp = x / (y * t);
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((z <= (-2.35d+91)) .or. (.not. (z <= 2d+92))) then
tmp = x / (z * t)
else
tmp = x / (y * t)
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -2.35e+91) || !(z <= 2e+92)) {
tmp = x / (z * t);
} else {
tmp = x / (y * t);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if (z <= -2.35e+91) or not (z <= 2e+92): tmp = x / (z * t) else: tmp = x / (y * t) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if ((z <= -2.35e+91) || !(z <= 2e+92)) tmp = Float64(x / Float64(z * t)); else tmp = Float64(x / Float64(y * t)); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if ((z <= -2.35e+91) || ~((z <= 2e+92)))
tmp = x / (z * t);
else
tmp = x / (y * t);
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[Or[LessEqual[z, -2.35e+91], N[Not[LessEqual[z, 2e+92]], $MachinePrecision]], N[(x / N[(z * t), $MachinePrecision]), $MachinePrecision], N[(x / N[(y * t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.35 \cdot 10^{+91} \lor \neg \left(z \leq 2 \cdot 10^{+92}\right):\\
\;\;\;\;\frac{x}{z \cdot t}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y \cdot t}\\
\end{array}
\end{array}
if z < -2.3499999999999999e91 or 2.0000000000000001e92 < z Initial program 77.8%
associate-/l/99.9%
Simplified99.9%
Taylor expanded in y around 0 95.2%
neg-mul-195.2%
Simplified95.2%
add-sqr-sqrt54.1%
sqrt-unprod75.8%
sqr-neg75.8%
sqrt-unprod32.3%
add-sqr-sqrt66.6%
div-inv66.6%
sub-neg66.6%
+-commutative66.6%
add-sqr-sqrt34.3%
sqrt-unprod70.3%
sqr-neg70.3%
sqrt-unprod39.1%
add-sqr-sqrt90.3%
Applied egg-rr90.3%
Taylor expanded in z around 0 38.3%
if -2.3499999999999999e91 < z < 2.0000000000000001e92Initial program 95.4%
Taylor expanded in z around 0 54.4%
Final simplification48.5%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (/ (/ x (- y z)) (- t z)))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
return (x / (y - z)) / (t - z);
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (x / (y - z)) / (t - z)
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
return (x / (y - z)) / (t - z);
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): return (x / (y - z)) / (t - z)
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) return Float64(Float64(x / Float64(y - z)) / Float64(t - z)) end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
tmp = (x / (y - z)) / (t - z);
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := N[(N[(x / N[(y - z), $MachinePrecision]), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\frac{\frac{x}{y - z}}{t - z}
\end{array}
Initial program 88.9%
Taylor expanded in x around 0 88.9%
associate-/l/96.0%
Simplified96.0%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (/ x (* y t)))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
return x / (y * t);
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = x / (y * t)
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
return x / (y * t);
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): return x / (y * t)
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) return Float64(x / Float64(y * t)) end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
tmp = x / (y * t);
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := N[(x / N[(y * t), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\frac{x}{y \cdot t}
\end{array}
Initial program 88.9%
Taylor expanded in z around 0 41.4%
Final simplification41.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 2024158
(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))))