
(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 18 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (/ x (* (- y z) (- t z))))
double code(double x, double y, double z, double t) {
return x / ((y - z) * (t - z));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = x / ((y - z) * (t - z))
end function
public static double code(double x, double y, double z, double t) {
return x / ((y - z) * (t - z));
}
def code(x, y, z, t): return x / ((y - z) * (t - z))
function code(x, y, z, t) return Float64(x / Float64(Float64(y - z) * Float64(t - z))) end
function tmp = code(x, y, z, t) tmp = x / ((y - z) * (t - z)); end
code[x_, y_, z_, t_] := N[(x / N[(N[(y - z), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{\left(y - z\right) \cdot \left(t - z\right)}
\end{array}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (/ (/ x (- t z)) (- y z)))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
return (x / (t - z)) / (y - z);
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (x / (t - z)) / (y - z)
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
return (x / (t - z)) / (y - z);
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): return (x / (t - z)) / (y - z)
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) return Float64(Float64(x / Float64(t - z)) / Float64(y - z)) end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
tmp = (x / (t - z)) / (y - z);
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := N[(N[(x / N[(t - z), $MachinePrecision]), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\frac{\frac{x}{t - z}}{y - z}
\end{array}
Initial program 88.6%
associate-/l/97.4%
Simplified97.4%
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 (* (- t z) (- y z))))
(if (<= t_1 (- INFINITY))
(/ 1.0 (* t (/ (- y z) x)))
(if (<= t_1 5e+278) (/ x t_1) (/ (/ -1.0 (/ z x)) (- y z))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = (t - z) * (y - z);
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = 1.0 / (t * ((y - z) / x));
} else if (t_1 <= 5e+278) {
tmp = x / t_1;
} else {
tmp = (-1.0 / (z / x)) / (y - z);
}
return tmp;
}
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = (t - z) * (y - z);
double tmp;
if (t_1 <= -Double.POSITIVE_INFINITY) {
tmp = 1.0 / (t * ((y - z) / x));
} else if (t_1 <= 5e+278) {
tmp = x / t_1;
} else {
tmp = (-1.0 / (z / x)) / (y - z);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = (t - z) * (y - z) tmp = 0 if t_1 <= -math.inf: tmp = 1.0 / (t * ((y - z) / x)) elif t_1 <= 5e+278: tmp = x / t_1 else: tmp = (-1.0 / (z / x)) / (y - z) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(Float64(t - z) * Float64(y - z)) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = Float64(1.0 / Float64(t * Float64(Float64(y - z) / x))); elseif (t_1 <= 5e+278) tmp = Float64(x / t_1); else tmp = Float64(Float64(-1.0 / Float64(z / x)) / 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 = (t - z) * (y - z);
tmp = 0.0;
if (t_1 <= -Inf)
tmp = 1.0 / (t * ((y - z) / x));
elseif (t_1 <= 5e+278)
tmp = x / t_1;
else
tmp = (-1.0 / (z / x)) / (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[(t - z), $MachinePrecision] * N[(y - z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(1.0 / N[(t * N[(N[(y - z), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 5e+278], N[(x / t$95$1), $MachinePrecision], N[(N[(-1.0 / N[(z / x), $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(t - z\right) \cdot \left(y - z\right)\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;\frac{1}{t \cdot \frac{y - z}{x}}\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+278}:\\
\;\;\;\;\frac{x}{t\_1}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{-1}{\frac{z}{x}}}{y - z}\\
\end{array}
\end{array}
if (*.f64 (-.f64 y z) (-.f64 t z)) < -inf.0Initial program 51.3%
associate-/l/100.0%
div-inv99.8%
Applied egg-rr99.8%
clear-num99.7%
frac-times95.0%
metadata-eval95.0%
Applied egg-rr95.0%
Taylor expanded in t around inf 40.7%
associate-/l*81.1%
Simplified81.1%
if -inf.0 < (*.f64 (-.f64 y z) (-.f64 t z)) < 5.00000000000000029e278Initial program 99.4%
if 5.00000000000000029e278 < (*.f64 (-.f64 y z) (-.f64 t z)) Initial program 79.5%
associate-/l/99.9%
Simplified99.9%
clear-num99.9%
associate-/r/99.9%
Applied egg-rr99.9%
Taylor expanded in t around 0 89.2%
associate-*l/89.2%
associate-*r/89.2%
clear-num89.2%
un-div-inv89.2%
Applied egg-rr89.2%
Final simplification94.6%
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 (* (- t z) (- y z))))
(if (<= t_1 (- INFINITY))
(/ 1.0 (* t (/ (- y z) x)))
(if (<= t_1 5e+278) (/ x t_1) (/ (/ x z) (- z y))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = (t - z) * (y - z);
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = 1.0 / (t * ((y - z) / x));
} else if (t_1 <= 5e+278) {
tmp = x / t_1;
} else {
tmp = (x / z) / (z - y);
}
return tmp;
}
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = (t - z) * (y - z);
double tmp;
if (t_1 <= -Double.POSITIVE_INFINITY) {
tmp = 1.0 / (t * ((y - z) / x));
} else if (t_1 <= 5e+278) {
tmp = x / t_1;
} else {
tmp = (x / z) / (z - y);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = (t - z) * (y - z) tmp = 0 if t_1 <= -math.inf: tmp = 1.0 / (t * ((y - z) / x)) elif t_1 <= 5e+278: tmp = x / t_1 else: tmp = (x / z) / (z - y) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(Float64(t - z) * Float64(y - z)) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = Float64(1.0 / Float64(t * Float64(Float64(y - z) / x))); elseif (t_1 <= 5e+278) tmp = Float64(x / t_1); 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)
t_1 = (t - z) * (y - z);
tmp = 0.0;
if (t_1 <= -Inf)
tmp = 1.0 / (t * ((y - z) / x));
elseif (t_1 <= 5e+278)
tmp = x / t_1;
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_] := Block[{t$95$1 = N[(N[(t - z), $MachinePrecision] * N[(y - z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(1.0 / N[(t * N[(N[(y - z), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 5e+278], N[(x / t$95$1), $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}
t_1 := \left(t - z\right) \cdot \left(y - z\right)\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;\frac{1}{t \cdot \frac{y - z}{x}}\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+278}:\\
\;\;\;\;\frac{x}{t\_1}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{z}}{z - y}\\
\end{array}
\end{array}
if (*.f64 (-.f64 y z) (-.f64 t z)) < -inf.0Initial program 51.3%
associate-/l/100.0%
div-inv99.8%
Applied egg-rr99.8%
clear-num99.7%
frac-times95.0%
metadata-eval95.0%
Applied egg-rr95.0%
Taylor expanded in t around inf 40.7%
associate-/l*81.1%
Simplified81.1%
if -inf.0 < (*.f64 (-.f64 y z) (-.f64 t z)) < 5.00000000000000029e278Initial program 99.4%
if 5.00000000000000029e278 < (*.f64 (-.f64 y z) (-.f64 t z)) Initial program 79.5%
associate-/l/99.9%
Simplified99.9%
Taylor expanded in t around 0 89.2%
associate-*r/89.2%
neg-mul-189.2%
Simplified89.2%
Final simplification94.6%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(if (<= t -3.7e-116)
(/ (/ x y) (- t z))
(if (<= t 4.5e-82)
(/ (/ x z) (- z y))
(if (<= t 3.5e+95) (/ x (* t (- y 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 <= -3.7e-116) {
tmp = (x / y) / (t - z);
} else if (t <= 4.5e-82) {
tmp = (x / z) / (z - y);
} else if (t <= 3.5e+95) {
tmp = x / (t * (y - 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 <= (-3.7d-116)) then
tmp = (x / y) / (t - z)
else if (t <= 4.5d-82) then
tmp = (x / z) / (z - y)
else if (t <= 3.5d+95) then
tmp = x / (t * (y - 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 <= -3.7e-116) {
tmp = (x / y) / (t - z);
} else if (t <= 4.5e-82) {
tmp = (x / z) / (z - y);
} else if (t <= 3.5e+95) {
tmp = x / (t * (y - 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 <= -3.7e-116: tmp = (x / y) / (t - z) elif t <= 4.5e-82: tmp = (x / z) / (z - y) elif t <= 3.5e+95: tmp = x / (t * (y - 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 <= -3.7e-116) tmp = Float64(Float64(x / y) / Float64(t - z)); elseif (t <= 4.5e-82) tmp = Float64(Float64(x / z) / Float64(z - y)); elseif (t <= 3.5e+95) tmp = Float64(x / Float64(t * Float64(y - 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 <= -3.7e-116)
tmp = (x / y) / (t - z);
elseif (t <= 4.5e-82)
tmp = (x / z) / (z - y);
elseif (t <= 3.5e+95)
tmp = x / (t * (y - 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, -3.7e-116], N[(N[(x / y), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 4.5e-82], N[(N[(x / z), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3.5e+95], N[(x / N[(t * N[(y - z), $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 -3.7 \cdot 10^{-116}:\\
\;\;\;\;\frac{\frac{x}{y}}{t - z}\\
\mathbf{elif}\;t \leq 4.5 \cdot 10^{-82}:\\
\;\;\;\;\frac{\frac{x}{z}}{z - y}\\
\mathbf{elif}\;t \leq 3.5 \cdot 10^{+95}:\\
\;\;\;\;\frac{x}{t \cdot \left(y - z\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{t}}{y - z}\\
\end{array}
\end{array}
if t < -3.7000000000000002e-116Initial program 86.0%
Taylor expanded in x around 0 86.0%
associate-/l/97.8%
Simplified97.8%
Taylor expanded in y around inf 67.7%
if -3.7000000000000002e-116 < t < 4.4999999999999998e-82Initial program 96.1%
associate-/l/98.6%
Simplified98.6%
Taylor expanded in t around 0 83.2%
associate-*r/83.2%
neg-mul-183.2%
Simplified83.2%
if 4.4999999999999998e-82 < t < 3.5e95Initial program 93.4%
Taylor expanded in t around inf 65.0%
if 3.5e95 < t Initial program 80.2%
associate-/l/99.0%
Simplified99.0%
Taylor expanded in t around inf 96.0%
Final simplification77.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 (<= t -1.75e-115)
(/ (/ x y) (- t z))
(if (<= t 2.3e-82)
(/ x (* z (- z y)))
(if (<= t 2.95e+94) (/ x (* t (- y 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 <= -1.75e-115) {
tmp = (x / y) / (t - z);
} else if (t <= 2.3e-82) {
tmp = x / (z * (z - y));
} else if (t <= 2.95e+94) {
tmp = x / (t * (y - 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 <= (-1.75d-115)) then
tmp = (x / y) / (t - z)
else if (t <= 2.3d-82) then
tmp = x / (z * (z - y))
else if (t <= 2.95d+94) then
tmp = x / (t * (y - 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 <= -1.75e-115) {
tmp = (x / y) / (t - z);
} else if (t <= 2.3e-82) {
tmp = x / (z * (z - y));
} else if (t <= 2.95e+94) {
tmp = x / (t * (y - 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 <= -1.75e-115: tmp = (x / y) / (t - z) elif t <= 2.3e-82: tmp = x / (z * (z - y)) elif t <= 2.95e+94: tmp = x / (t * (y - 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 <= -1.75e-115) tmp = Float64(Float64(x / y) / Float64(t - z)); elseif (t <= 2.3e-82) tmp = Float64(x / Float64(z * Float64(z - y))); elseif (t <= 2.95e+94) tmp = Float64(x / Float64(t * Float64(y - 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 <= -1.75e-115)
tmp = (x / y) / (t - z);
elseif (t <= 2.3e-82)
tmp = x / (z * (z - y));
elseif (t <= 2.95e+94)
tmp = x / (t * (y - 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, -1.75e-115], N[(N[(x / y), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.3e-82], N[(x / N[(z * N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.95e+94], N[(x / N[(t * N[(y - z), $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 -1.75 \cdot 10^{-115}:\\
\;\;\;\;\frac{\frac{x}{y}}{t - z}\\
\mathbf{elif}\;t \leq 2.3 \cdot 10^{-82}:\\
\;\;\;\;\frac{x}{z \cdot \left(z - y\right)}\\
\mathbf{elif}\;t \leq 2.95 \cdot 10^{+94}:\\
\;\;\;\;\frac{x}{t \cdot \left(y - z\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{t}}{y - z}\\
\end{array}
\end{array}
if t < -1.7500000000000001e-115Initial program 86.0%
Taylor expanded in x around 0 86.0%
associate-/l/97.8%
Simplified97.8%
Taylor expanded in y around inf 67.7%
if -1.7500000000000001e-115 < t < 2.29999999999999997e-82Initial program 96.1%
Taylor expanded in t around 0 80.7%
associate-*r/80.7%
neg-mul-180.7%
Simplified80.7%
if 2.29999999999999997e-82 < t < 2.94999999999999995e94Initial program 93.4%
Taylor expanded in t around inf 65.0%
if 2.94999999999999995e94 < t Initial program 80.2%
associate-/l/99.0%
Simplified99.0%
Taylor expanded in t around inf 96.0%
Final simplification77.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 (<= z -0.043)
(/ x (* z (- y)))
(if (<= z 3.35e-19)
(/ (/ x t) y)
(if (<= z 5.4e+147) (/ (/ x y) (- z)) (/ x (* z (- t)))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -0.043) {
tmp = x / (z * -y);
} else if (z <= 3.35e-19) {
tmp = (x / t) / y;
} else if (z <= 5.4e+147) {
tmp = (x / y) / -z;
} else {
tmp = x / (z * -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 <= (-0.043d0)) then
tmp = x / (z * -y)
else if (z <= 3.35d-19) then
tmp = (x / t) / y
else if (z <= 5.4d+147) then
tmp = (x / y) / -z
else
tmp = x / (z * -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 <= -0.043) {
tmp = x / (z * -y);
} else if (z <= 3.35e-19) {
tmp = (x / t) / y;
} else if (z <= 5.4e+147) {
tmp = (x / y) / -z;
} else {
tmp = x / (z * -t);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if z <= -0.043: tmp = x / (z * -y) elif z <= 3.35e-19: tmp = (x / t) / y elif z <= 5.4e+147: tmp = (x / y) / -z else: tmp = x / (z * -t) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (z <= -0.043) tmp = Float64(x / Float64(z * Float64(-y))); elseif (z <= 3.35e-19) tmp = Float64(Float64(x / t) / y); elseif (z <= 5.4e+147) tmp = Float64(Float64(x / y) / Float64(-z)); else tmp = Float64(x / Float64(z * Float64(-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 <= -0.043)
tmp = x / (z * -y);
elseif (z <= 3.35e-19)
tmp = (x / t) / y;
elseif (z <= 5.4e+147)
tmp = (x / y) / -z;
else
tmp = x / (z * -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[LessEqual[z, -0.043], N[(x / N[(z * (-y)), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.35e-19], N[(N[(x / t), $MachinePrecision] / y), $MachinePrecision], If[LessEqual[z, 5.4e+147], N[(N[(x / y), $MachinePrecision] / (-z)), $MachinePrecision], N[(x / N[(z * (-t)), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.043:\\
\;\;\;\;\frac{x}{z \cdot \left(-y\right)}\\
\mathbf{elif}\;z \leq 3.35 \cdot 10^{-19}:\\
\;\;\;\;\frac{\frac{x}{t}}{y}\\
\mathbf{elif}\;z \leq 5.4 \cdot 10^{+147}:\\
\;\;\;\;\frac{\frac{x}{y}}{-z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{z \cdot \left(-t\right)}\\
\end{array}
\end{array}
if z < -0.042999999999999997Initial program 86.4%
associate-/l/99.9%
Simplified99.9%
Taylor expanded in t around 0 86.5%
associate-*r/86.5%
neg-mul-186.5%
Simplified86.5%
Taylor expanded in z around 0 39.0%
associate-*r/39.0%
mul-1-neg39.0%
*-commutative39.0%
Simplified39.0%
if -0.042999999999999997 < z < 3.34999999999999999e-19Initial program 94.2%
associate-/l/94.6%
Simplified94.6%
clear-num93.0%
associate-/r/94.5%
Applied egg-rr94.5%
Taylor expanded in z around 0 67.9%
associate-/r*69.9%
Simplified69.9%
if 3.34999999999999999e-19 < z < 5.39999999999999995e147Initial program 86.6%
associate-/l/99.9%
Simplified99.9%
Taylor expanded in t around 0 73.2%
associate-*r/73.2%
neg-mul-173.2%
Simplified73.2%
Taylor expanded in z around 0 46.2%
associate-*r/46.2%
mul-1-neg46.2%
*-commutative46.2%
Simplified46.2%
neg-mul-146.2%
*-commutative46.2%
times-frac54.9%
Applied egg-rr54.9%
associate-*r/50.4%
frac-2neg50.4%
metadata-eval50.4%
associate-*l/50.5%
*-un-lft-identity50.5%
Applied egg-rr50.5%
if 5.39999999999999995e147 < z Initial program 74.4%
associate-/l/99.9%
Simplified99.9%
Taylor expanded in t around inf 58.9%
Taylor expanded in y around 0 56.0%
associate-*r/56.0%
mul-1-neg56.0%
*-commutative56.0%
Simplified56.0%
Final simplification57.7%
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 (- y)))))
(if (<= z -0.043)
t_1
(if (<= z 2.5e-18)
(/ (/ x t) y)
(if (<= z 8.5e+147) t_1 (/ x (* z (- t))))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = x / (z * -y);
double tmp;
if (z <= -0.043) {
tmp = t_1;
} else if (z <= 2.5e-18) {
tmp = (x / t) / y;
} else if (z <= 8.5e+147) {
tmp = t_1;
} else {
tmp = x / (z * -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) :: t_1
real(8) :: tmp
t_1 = x / (z * -y)
if (z <= (-0.043d0)) then
tmp = t_1
else if (z <= 2.5d-18) then
tmp = (x / t) / y
else if (z <= 8.5d+147) then
tmp = t_1
else
tmp = x / (z * -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 t_1 = x / (z * -y);
double tmp;
if (z <= -0.043) {
tmp = t_1;
} else if (z <= 2.5e-18) {
tmp = (x / t) / y;
} else if (z <= 8.5e+147) {
tmp = t_1;
} else {
tmp = x / (z * -t);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = x / (z * -y) tmp = 0 if z <= -0.043: tmp = t_1 elif z <= 2.5e-18: tmp = (x / t) / y elif z <= 8.5e+147: tmp = t_1 else: tmp = x / (z * -t) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(x / Float64(z * Float64(-y))) tmp = 0.0 if (z <= -0.043) tmp = t_1; elseif (z <= 2.5e-18) tmp = Float64(Float64(x / t) / y); elseif (z <= 8.5e+147) tmp = t_1; else tmp = Float64(x / Float64(z * Float64(-t))); 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 * -y);
tmp = 0.0;
if (z <= -0.043)
tmp = t_1;
elseif (z <= 2.5e-18)
tmp = (x / t) / y;
elseif (z <= 8.5e+147)
tmp = t_1;
else
tmp = x / (z * -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_] := Block[{t$95$1 = N[(x / N[(z * (-y)), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -0.043], t$95$1, If[LessEqual[z, 2.5e-18], N[(N[(x / t), $MachinePrecision] / y), $MachinePrecision], If[LessEqual[z, 8.5e+147], t$95$1, N[(x / N[(z * (-t)), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \frac{x}{z \cdot \left(-y\right)}\\
\mathbf{if}\;z \leq -0.043:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 2.5 \cdot 10^{-18}:\\
\;\;\;\;\frac{\frac{x}{t}}{y}\\
\mathbf{elif}\;z \leq 8.5 \cdot 10^{+147}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{z \cdot \left(-t\right)}\\
\end{array}
\end{array}
if z < -0.042999999999999997 or 2.50000000000000018e-18 < z < 8.5000000000000007e147Initial program 86.5%
associate-/l/99.9%
Simplified99.9%
Taylor expanded in t around 0 80.9%
associate-*r/80.9%
neg-mul-180.9%
Simplified80.9%
Taylor expanded in z around 0 42.0%
associate-*r/42.0%
mul-1-neg42.0%
*-commutative42.0%
Simplified42.0%
if -0.042999999999999997 < z < 2.50000000000000018e-18Initial program 94.2%
associate-/l/94.6%
Simplified94.6%
clear-num93.0%
associate-/r/94.5%
Applied egg-rr94.5%
Taylor expanded in z around 0 67.9%
associate-/r*69.9%
Simplified69.9%
if 8.5000000000000007e147 < z Initial program 74.4%
associate-/l/99.9%
Simplified99.9%
Taylor expanded in t around inf 58.9%
Taylor expanded in y around 0 56.0%
associate-*r/56.0%
mul-1-neg56.0%
*-commutative56.0%
Simplified56.0%
Final simplification56.9%
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 y))))
(if (<= z -21.0)
t_1
(if (<= z 6e+45) (/ x (* t y)) (if (<= z 1.15e+148) t_1 (/ x (* t z)))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = x / (z * y);
double tmp;
if (z <= -21.0) {
tmp = t_1;
} else if (z <= 6e+45) {
tmp = x / (t * y);
} else if (z <= 1.15e+148) {
tmp = t_1;
} else {
tmp = x / (t * z);
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = x / (z * y)
if (z <= (-21.0d0)) then
tmp = t_1
else if (z <= 6d+45) then
tmp = x / (t * y)
else if (z <= 1.15d+148) then
tmp = t_1
else
tmp = x / (t * z)
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = x / (z * y);
double tmp;
if (z <= -21.0) {
tmp = t_1;
} else if (z <= 6e+45) {
tmp = x / (t * y);
} else if (z <= 1.15e+148) {
tmp = t_1;
} else {
tmp = x / (t * z);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = x / (z * y) tmp = 0 if z <= -21.0: tmp = t_1 elif z <= 6e+45: tmp = x / (t * y) elif z <= 1.15e+148: tmp = t_1 else: tmp = x / (t * z) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(x / Float64(z * y)) tmp = 0.0 if (z <= -21.0) tmp = t_1; elseif (z <= 6e+45) tmp = Float64(x / Float64(t * y)); elseif (z <= 1.15e+148) tmp = t_1; else tmp = Float64(x / Float64(t * z)); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = x / (z * y);
tmp = 0.0;
if (z <= -21.0)
tmp = t_1;
elseif (z <= 6e+45)
tmp = x / (t * y);
elseif (z <= 1.15e+148)
tmp = t_1;
else
tmp = x / (t * z);
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x / N[(z * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -21.0], t$95$1, If[LessEqual[z, 6e+45], N[(x / N[(t * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.15e+148], t$95$1, N[(x / N[(t * z), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \frac{x}{z \cdot y}\\
\mathbf{if}\;z \leq -21:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 6 \cdot 10^{+45}:\\
\;\;\;\;\frac{x}{t \cdot y}\\
\mathbf{elif}\;z \leq 1.15 \cdot 10^{+148}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{t \cdot z}\\
\end{array}
\end{array}
if z < -21 or 6.00000000000000021e45 < z < 1.15e148Initial program 85.1%
associate-/l/99.9%
Simplified99.9%
Taylor expanded in t around 0 85.1%
associate-*r/85.1%
neg-mul-185.1%
Simplified85.1%
Taylor expanded in z around 0 44.6%
associate-*r/44.6%
mul-1-neg44.6%
*-commutative44.6%
Simplified44.6%
div-inv44.6%
add-sqr-sqrt26.3%
sqrt-unprod44.8%
sqr-neg44.8%
sqrt-unprod13.7%
add-sqr-sqrt35.6%
*-commutative35.6%
Applied egg-rr35.6%
associate-*r/35.6%
*-commutative35.6%
*-rgt-identity35.6%
Simplified35.6%
if -21 < z < 6.00000000000000021e45Initial program 94.1%
Taylor expanded in z around 0 63.2%
if 1.15e148 < z Initial program 74.4%
Taylor expanded in y around 0 71.5%
associate-*r/71.5%
neg-mul-171.5%
Simplified71.5%
div-inv71.5%
add-sqr-sqrt36.7%
sqrt-unprod64.3%
sqr-neg64.3%
sqrt-unprod34.8%
add-sqr-sqrt71.5%
Applied egg-rr71.5%
associate-*r/71.5%
*-rgt-identity71.5%
Simplified71.5%
Taylor expanded in z around 0 55.9%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= y -9e-72) (/ (/ x y) (- t z)) (if (<= y 2.1e-204) (/ x (* z (- z t))) (/ x (* t (- y z))))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -9e-72) {
tmp = (x / y) / (t - z);
} else if (y <= 2.1e-204) {
tmp = x / (z * (z - t));
} else {
tmp = x / (t * (y - z));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= (-9d-72)) then
tmp = (x / y) / (t - z)
else if (y <= 2.1d-204) then
tmp = x / (z * (z - t))
else
tmp = x / (t * (y - z))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -9e-72) {
tmp = (x / y) / (t - z);
} else if (y <= 2.1e-204) {
tmp = x / (z * (z - t));
} else {
tmp = x / (t * (y - z));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if y <= -9e-72: tmp = (x / y) / (t - z) elif y <= 2.1e-204: tmp = x / (z * (z - t)) else: tmp = x / (t * (y - z)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (y <= -9e-72) tmp = Float64(Float64(x / y) / Float64(t - z)); elseif (y <= 2.1e-204) tmp = Float64(x / Float64(z * Float64(z - t))); else tmp = Float64(x / Float64(t * Float64(y - z))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (y <= -9e-72)
tmp = (x / y) / (t - z);
elseif (y <= 2.1e-204)
tmp = x / (z * (z - t));
else
tmp = x / (t * (y - z));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[y, -9e-72], N[(N[(x / y), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.1e-204], N[(x / N[(z * N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x / N[(t * N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -9 \cdot 10^{-72}:\\
\;\;\;\;\frac{\frac{x}{y}}{t - z}\\
\mathbf{elif}\;y \leq 2.1 \cdot 10^{-204}:\\
\;\;\;\;\frac{x}{z \cdot \left(z - t\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{t \cdot \left(y - z\right)}\\
\end{array}
\end{array}
if y < -9e-72Initial program 86.7%
Taylor expanded in x around 0 86.7%
associate-/l/98.3%
Simplified98.3%
Taylor expanded in y around inf 84.3%
if -9e-72 < y < 2.10000000000000009e-204Initial program 92.5%
Taylor expanded in y around 0 82.8%
associate-*r/82.8%
neg-mul-182.8%
Simplified82.8%
if 2.10000000000000009e-204 < y Initial program 88.0%
Taylor expanded in t around inf 62.6%
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 (<= t -5.1e-79) (/ (/ x y) t) (if (<= t 7e-86) (/ (/ (- x) 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 <= -5.1e-79) {
tmp = (x / y) / t;
} else if (t <= 7e-86) {
tmp = (-x / 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 <= (-5.1d-79)) then
tmp = (x / y) / t
else if (t <= 7d-86) then
tmp = (-x / 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 <= -5.1e-79) {
tmp = (x / y) / t;
} else if (t <= 7e-86) {
tmp = (-x / 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 <= -5.1e-79: tmp = (x / y) / t elif t <= 7e-86: tmp = (-x / 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 <= -5.1e-79) tmp = Float64(Float64(x / y) / t); elseif (t <= 7e-86) tmp = Float64(Float64(Float64(-x) / z) / y); else tmp = Float64(x / Float64(t * Float64(y - z))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (t <= -5.1e-79)
tmp = (x / y) / t;
elseif (t <= 7e-86)
tmp = (-x / 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, -5.1e-79], N[(N[(x / y), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[t, 7e-86], N[(N[((-x) / z), $MachinePrecision] / y), $MachinePrecision], N[(x / N[(t * N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -5.1 \cdot 10^{-79}:\\
\;\;\;\;\frac{\frac{x}{y}}{t}\\
\mathbf{elif}\;t \leq 7 \cdot 10^{-86}:\\
\;\;\;\;\frac{\frac{-x}{z}}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{t \cdot \left(y - z\right)}\\
\end{array}
\end{array}
if t < -5.0999999999999999e-79Initial program 86.7%
Taylor expanded in z around 0 58.7%
div-inv58.7%
associate-/r*57.7%
Applied egg-rr57.7%
*-commutative57.7%
associate-*l/60.7%
associate-*r/60.6%
associate-*l/60.6%
*-lft-identity60.6%
Simplified60.6%
if -5.0999999999999999e-79 < t < 7.00000000000000041e-86Initial program 93.9%
associate-/l/97.7%
Simplified97.7%
Taylor expanded in t around 0 80.4%
associate-*r/80.4%
neg-mul-180.4%
Simplified80.4%
Taylor expanded in z around 0 51.7%
associate-*r/51.7%
mul-1-neg51.7%
*-commutative51.7%
Simplified51.7%
neg-mul-151.7%
*-commutative51.7%
times-frac55.8%
Applied egg-rr55.8%
associate-*l/55.9%
associate-*r/55.9%
associate-*l/55.9%
*-commutative55.9%
frac-2neg55.9%
metadata-eval55.9%
un-div-inv55.9%
Applied egg-rr55.9%
if 7.00000000000000041e-86 < t Initial program 84.8%
Taylor expanded in t around inf 74.9%
Final simplification63.6%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (or (<= z -0.029) (not (<= z 5.2e-19))) (/ (/ (- x) z) y) (/ (/ x t) y)))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -0.029) || !(z <= 5.2e-19)) {
tmp = (-x / z) / y;
} else {
tmp = (x / t) / y;
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((z <= (-0.029d0)) .or. (.not. (z <= 5.2d-19))) then
tmp = (-x / z) / y
else
tmp = (x / t) / y
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -0.029) || !(z <= 5.2e-19)) {
tmp = (-x / z) / y;
} else {
tmp = (x / t) / y;
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if (z <= -0.029) or not (z <= 5.2e-19): tmp = (-x / z) / y else: tmp = (x / t) / y return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if ((z <= -0.029) || !(z <= 5.2e-19)) tmp = Float64(Float64(Float64(-x) / 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 <= -0.029) || ~((z <= 5.2e-19)))
tmp = (-x / z) / y;
else
tmp = (x / t) / y;
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[Or[LessEqual[z, -0.029], N[Not[LessEqual[z, 5.2e-19]], $MachinePrecision]], N[(N[((-x) / z), $MachinePrecision] / y), $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 -0.029 \lor \neg \left(z \leq 5.2 \cdot 10^{-19}\right):\\
\;\;\;\;\frac{\frac{-x}{z}}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{t}}{y}\\
\end{array}
\end{array}
if z < -0.0290000000000000015 or 5.20000000000000026e-19 < z Initial program 83.6%
associate-/l/99.9%
Simplified99.9%
Taylor expanded in t around 0 82.7%
associate-*r/82.7%
neg-mul-182.7%
Simplified82.7%
Taylor expanded in z around 0 41.7%
associate-*r/41.7%
mul-1-neg41.7%
*-commutative41.7%
Simplified41.7%
neg-mul-141.7%
*-commutative41.7%
times-frac49.3%
Applied egg-rr49.3%
associate-*l/49.3%
associate-*r/49.3%
associate-*l/49.3%
*-commutative49.3%
frac-2neg49.3%
metadata-eval49.3%
un-div-inv49.3%
Applied egg-rr49.3%
if -0.0290000000000000015 < z < 5.20000000000000026e-19Initial program 94.2%
associate-/l/94.6%
Simplified94.6%
clear-num93.0%
associate-/r/94.5%
Applied egg-rr94.5%
Taylor expanded in z around 0 67.9%
associate-/r*69.9%
Simplified69.9%
Final simplification59.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 -1.56e+31) (/ x (* z y)) (if (<= z 2.2e+87) (/ (/ x y) t) (/ x (* z (- t))))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.56e+31) {
tmp = x / (z * y);
} else if (z <= 2.2e+87) {
tmp = (x / y) / t;
} else {
tmp = x / (z * -t);
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (z <= (-1.56d+31)) then
tmp = x / (z * y)
else if (z <= 2.2d+87) then
tmp = (x / y) / t
else
tmp = x / (z * -t)
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.56e+31) {
tmp = x / (z * y);
} else if (z <= 2.2e+87) {
tmp = (x / y) / t;
} else {
tmp = x / (z * -t);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if z <= -1.56e+31: tmp = x / (z * y) elif z <= 2.2e+87: tmp = (x / y) / t else: tmp = x / (z * -t) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (z <= -1.56e+31) tmp = Float64(x / Float64(z * y)); elseif (z <= 2.2e+87) tmp = Float64(Float64(x / y) / t); else tmp = Float64(x / Float64(z * Float64(-t))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (z <= -1.56e+31)
tmp = x / (z * y);
elseif (z <= 2.2e+87)
tmp = (x / y) / t;
else
tmp = x / (z * -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[LessEqual[z, -1.56e+31], N[(x / N[(z * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.2e+87], N[(N[(x / y), $MachinePrecision] / t), $MachinePrecision], N[(x / N[(z * (-t)), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.56 \cdot 10^{+31}:\\
\;\;\;\;\frac{x}{z \cdot y}\\
\mathbf{elif}\;z \leq 2.2 \cdot 10^{+87}:\\
\;\;\;\;\frac{\frac{x}{y}}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{z \cdot \left(-t\right)}\\
\end{array}
\end{array}
if z < -1.56000000000000004e31Initial program 86.1%
associate-/l/99.9%
Simplified99.9%
Taylor expanded in t around 0 88.1%
associate-*r/88.1%
neg-mul-188.1%
Simplified88.1%
Taylor expanded in z around 0 38.9%
associate-*r/38.9%
mul-1-neg38.9%
*-commutative38.9%
Simplified38.9%
div-inv38.9%
add-sqr-sqrt30.0%
sqrt-unprod43.4%
sqr-neg43.4%
sqrt-unprod6.7%
add-sqr-sqrt35.1%
*-commutative35.1%
Applied egg-rr35.1%
associate-*r/35.1%
*-commutative35.1%
*-rgt-identity35.1%
Simplified35.1%
if -1.56000000000000004e31 < z < 2.2000000000000001e87Initial program 92.9%
Taylor expanded in z around 0 57.7%
div-inv57.6%
associate-/r*57.9%
Applied egg-rr57.9%
*-commutative57.9%
associate-*l/62.2%
associate-*r/63.0%
associate-*l/63.1%
*-lft-identity63.1%
Simplified63.1%
if 2.2000000000000001e87 < z Initial program 78.3%
associate-/l/99.9%
Simplified99.9%
Taylor expanded in t around inf 52.7%
Taylor expanded in y around 0 46.2%
associate-*r/46.2%
mul-1-neg46.2%
*-commutative46.2%
Simplified46.2%
Final simplification54.1%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (or (<= z -2.4e+35) (not (<= z 3.8e+135))) (/ x (* t z)) (/ x (* t y))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -2.4e+35) || !(z <= 3.8e+135)) {
tmp = x / (t * z);
} else {
tmp = x / (t * y);
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((z <= (-2.4d+35)) .or. (.not. (z <= 3.8d+135))) then
tmp = x / (t * z)
else
tmp = x / (t * y)
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -2.4e+35) || !(z <= 3.8e+135)) {
tmp = x / (t * z);
} else {
tmp = x / (t * y);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if (z <= -2.4e+35) or not (z <= 3.8e+135): tmp = x / (t * z) else: tmp = x / (t * y) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if ((z <= -2.4e+35) || !(z <= 3.8e+135)) tmp = Float64(x / Float64(t * z)); else tmp = Float64(x / Float64(t * y)); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if ((z <= -2.4e+35) || ~((z <= 3.8e+135)))
tmp = x / (t * z);
else
tmp = x / (t * y);
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[Or[LessEqual[z, -2.4e+35], N[Not[LessEqual[z, 3.8e+135]], $MachinePrecision]], N[(x / N[(t * z), $MachinePrecision]), $MachinePrecision], N[(x / N[(t * y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.4 \cdot 10^{+35} \lor \neg \left(z \leq 3.8 \cdot 10^{+135}\right):\\
\;\;\;\;\frac{x}{t \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{t \cdot y}\\
\end{array}
\end{array}
if z < -2.40000000000000015e35 or 3.8000000000000001e135 < z Initial program 81.8%
Taylor expanded in y around 0 76.8%
associate-*r/76.8%
neg-mul-176.8%
Simplified76.8%
div-inv76.8%
add-sqr-sqrt48.6%
sqrt-unprod65.2%
sqr-neg65.2%
sqrt-unprod24.2%
add-sqr-sqrt68.4%
Applied egg-rr68.4%
associate-*r/68.4%
*-rgt-identity68.4%
Simplified68.4%
Taylor expanded in z around 0 46.7%
if -2.40000000000000015e35 < z < 3.8000000000000001e135Initial program 92.0%
Taylor expanded in z around 0 54.5%
Final simplification52.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 -7.7e+31) (/ x (* z y)) (if (<= z 1.95e+136) (/ (/ x y) t) (/ x (* t z)))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -7.7e+31) {
tmp = x / (z * y);
} else if (z <= 1.95e+136) {
tmp = (x / y) / t;
} else {
tmp = x / (t * z);
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (z <= (-7.7d+31)) then
tmp = x / (z * y)
else if (z <= 1.95d+136) then
tmp = (x / y) / t
else
tmp = x / (t * z)
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -7.7e+31) {
tmp = x / (z * y);
} else if (z <= 1.95e+136) {
tmp = (x / y) / t;
} else {
tmp = x / (t * z);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if z <= -7.7e+31: tmp = x / (z * y) elif z <= 1.95e+136: tmp = (x / y) / t else: tmp = x / (t * z) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (z <= -7.7e+31) tmp = Float64(x / Float64(z * y)); elseif (z <= 1.95e+136) tmp = Float64(Float64(x / y) / t); else tmp = Float64(x / Float64(t * z)); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (z <= -7.7e+31)
tmp = x / (z * y);
elseif (z <= 1.95e+136)
tmp = (x / y) / t;
else
tmp = x / (t * z);
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[z, -7.7e+31], N[(x / N[(z * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.95e+136], N[(N[(x / y), $MachinePrecision] / t), $MachinePrecision], N[(x / N[(t * z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -7.7 \cdot 10^{+31}:\\
\;\;\;\;\frac{x}{z \cdot y}\\
\mathbf{elif}\;z \leq 1.95 \cdot 10^{+136}:\\
\;\;\;\;\frac{\frac{x}{y}}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{t \cdot z}\\
\end{array}
\end{array}
if z < -7.69999999999999967e31Initial program 86.1%
associate-/l/99.9%
Simplified99.9%
Taylor expanded in t around 0 88.1%
associate-*r/88.1%
neg-mul-188.1%
Simplified88.1%
Taylor expanded in z around 0 38.9%
associate-*r/38.9%
mul-1-neg38.9%
*-commutative38.9%
Simplified38.9%
div-inv38.9%
add-sqr-sqrt30.0%
sqrt-unprod43.4%
sqr-neg43.4%
sqrt-unprod6.7%
add-sqr-sqrt35.1%
*-commutative35.1%
Applied egg-rr35.1%
associate-*r/35.1%
*-commutative35.1%
*-rgt-identity35.1%
Simplified35.1%
if -7.69999999999999967e31 < z < 1.9500000000000001e136Initial program 91.9%
Taylor expanded in z around 0 54.8%
div-inv54.7%
associate-/r*55.0%
Applied egg-rr55.0%
*-commutative55.0%
associate-*l/59.5%
associate-*r/61.0%
associate-*l/61.1%
*-lft-identity61.1%
Simplified61.1%
if 1.9500000000000001e136 < z Initial program 75.9%
Taylor expanded in y around 0 73.1%
associate-*r/73.1%
neg-mul-173.1%
Simplified73.1%
div-inv73.1%
add-sqr-sqrt40.4%
sqrt-unprod66.4%
sqr-neg66.4%
sqrt-unprod32.8%
add-sqr-sqrt73.1%
Applied egg-rr73.1%
associate-*r/73.1%
*-rgt-identity73.1%
Simplified73.1%
Taylor expanded in z around 0 55.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 -29.0) (/ x (* z y)) (if (<= z 1.95e+136) (/ (/ x t) y) (/ x (* t z)))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -29.0) {
tmp = x / (z * y);
} else if (z <= 1.95e+136) {
tmp = (x / t) / y;
} else {
tmp = x / (t * z);
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (z <= (-29.0d0)) then
tmp = x / (z * y)
else if (z <= 1.95d+136) then
tmp = (x / t) / y
else
tmp = x / (t * z)
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -29.0) {
tmp = x / (z * y);
} else if (z <= 1.95e+136) {
tmp = (x / t) / y;
} else {
tmp = x / (t * z);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if z <= -29.0: tmp = x / (z * y) elif z <= 1.95e+136: tmp = (x / t) / y else: tmp = x / (t * z) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (z <= -29.0) tmp = Float64(x / Float64(z * y)); elseif (z <= 1.95e+136) tmp = Float64(Float64(x / t) / y); else tmp = Float64(x / Float64(t * z)); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (z <= -29.0)
tmp = x / (z * y);
elseif (z <= 1.95e+136)
tmp = (x / t) / y;
else
tmp = x / (t * z);
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[z, -29.0], N[(x / N[(z * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.95e+136], N[(N[(x / t), $MachinePrecision] / y), $MachinePrecision], N[(x / N[(t * z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -29:\\
\;\;\;\;\frac{x}{z \cdot y}\\
\mathbf{elif}\;z \leq 1.95 \cdot 10^{+136}:\\
\;\;\;\;\frac{\frac{x}{t}}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{t \cdot z}\\
\end{array}
\end{array}
if z < -29Initial program 86.1%
associate-/l/99.9%
Simplified99.9%
Taylor expanded in t around 0 86.3%
associate-*r/86.3%
neg-mul-186.3%
Simplified86.3%
Taylor expanded in z around 0 39.6%
associate-*r/39.6%
mul-1-neg39.6%
*-commutative39.6%
Simplified39.6%
div-inv39.6%
add-sqr-sqrt28.3%
sqrt-unprod41.8%
sqr-neg41.8%
sqrt-unprod6.0%
add-sqr-sqrt31.3%
*-commutative31.3%
Applied egg-rr31.3%
associate-*r/31.3%
*-commutative31.3%
*-rgt-identity31.3%
Simplified31.3%
if -29 < z < 1.9500000000000001e136Initial program 92.1%
associate-/l/96.0%
Simplified96.0%
clear-num94.8%
associate-/r/95.8%
Applied egg-rr95.8%
Taylor expanded in z around 0 57.0%
associate-/r*60.8%
Simplified60.8%
if 1.9500000000000001e136 < z Initial program 75.9%
Taylor expanded in y around 0 73.1%
associate-*r/73.1%
neg-mul-173.1%
Simplified73.1%
div-inv73.1%
add-sqr-sqrt40.4%
sqrt-unprod66.4%
sqr-neg66.4%
sqrt-unprod32.8%
add-sqr-sqrt73.1%
Applied egg-rr73.1%
associate-*r/73.1%
*-rgt-identity73.1%
Simplified73.1%
Taylor expanded in z around 0 55.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 (<= t 1.72e+37) (/ x (* (- t 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 <= 1.72e+37) {
tmp = x / ((t - 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 <= 1.72d+37) then
tmp = x / ((t - 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 <= 1.72e+37) {
tmp = x / ((t - 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 <= 1.72e+37: tmp = x / ((t - 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 <= 1.72e+37) tmp = Float64(x / Float64(Float64(t - 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 <= 1.72e+37)
tmp = x / ((t - 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, 1.72e+37], N[(x / N[(N[(t - z), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision], N[(N[(x / t), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq 1.72 \cdot 10^{+37}:\\
\;\;\;\;\frac{x}{\left(t - z\right) \cdot y}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{t}}{y - z}\\
\end{array}
\end{array}
if t < 1.72000000000000002e37Initial program 90.6%
Taylor expanded in y around inf 66.8%
*-commutative66.8%
Simplified66.8%
if 1.72000000000000002e37 < t Initial program 81.8%
associate-/l/99.0%
Simplified99.0%
Taylor expanded in t around inf 94.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 (<= t 1.28e-23) (/ x (* (- t 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 <= 1.28e-23) {
tmp = x / ((t - 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 <= 1.28d-23) then
tmp = x / ((t - 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 <= 1.28e-23) {
tmp = x / ((t - 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 <= 1.28e-23: tmp = x / ((t - 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 <= 1.28e-23) tmp = Float64(x / Float64(Float64(t - z) * y)); else tmp = Float64(x / Float64(t * Float64(y - z))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (t <= 1.28e-23)
tmp = x / ((t - 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, 1.28e-23], N[(x / N[(N[(t - z), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision], N[(x / N[(t * N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq 1.28 \cdot 10^{-23}:\\
\;\;\;\;\frac{x}{\left(t - z\right) \cdot y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{t \cdot \left(y - z\right)}\\
\end{array}
\end{array}
if t < 1.28000000000000005e-23Initial program 90.8%
Taylor expanded in y around inf 67.1%
*-commutative67.1%
Simplified67.1%
if 1.28000000000000005e-23 < t Initial program 82.4%
Taylor expanded in t around inf 76.4%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (/ x (* t y)))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
return x / (t * y);
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = x / (t * y)
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
return x / (t * y);
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): return x / (t * y)
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) return Float64(x / Float64(t * y)) end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
tmp = x / (t * y);
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := N[(x / N[(t * y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\frac{x}{t \cdot y}
\end{array}
Initial program 88.6%
Taylor expanded in z around 0 44.2%
(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 2024090
(FPCore (x y z t)
:name "Data.Random.Distribution.Triangular:triangularCDF from random-fu-0.2.6.2, B"
:precision binary64
:alt
(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))))