
(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 19 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 (- 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 85.8%
associate-/r*96.2%
div-inv96.2%
Applied egg-rr96.2%
un-div-inv96.2%
Applied egg-rr96.2%
Final simplification96.2%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* (/ x y) (/ 1.0 t))) (t_2 (- (/ x (* z t)))))
(if (<= t -1.05e-41)
t_1
(if (<= t 5e-15)
(/ (- x) (* y z))
(if (<= t 2.9e+147)
t_2
(if (<= t 1.6e+187) (/ (/ x y) t) (if (<= t 1e+208) t_2 t_1)))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = (x / y) * (1.0 / t);
double t_2 = -(x / (z * t));
double tmp;
if (t <= -1.05e-41) {
tmp = t_1;
} else if (t <= 5e-15) {
tmp = -x / (y * z);
} else if (t <= 2.9e+147) {
tmp = t_2;
} else if (t <= 1.6e+187) {
tmp = (x / y) / t;
} else if (t <= 1e+208) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (x / y) * (1.0d0 / t)
t_2 = -(x / (z * t))
if (t <= (-1.05d-41)) then
tmp = t_1
else if (t <= 5d-15) then
tmp = -x / (y * z)
else if (t <= 2.9d+147) then
tmp = t_2
else if (t <= 1.6d+187) then
tmp = (x / y) / t
else if (t <= 1d+208) then
tmp = t_2
else
tmp = t_1
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = (x / y) * (1.0 / t);
double t_2 = -(x / (z * t));
double tmp;
if (t <= -1.05e-41) {
tmp = t_1;
} else if (t <= 5e-15) {
tmp = -x / (y * z);
} else if (t <= 2.9e+147) {
tmp = t_2;
} else if (t <= 1.6e+187) {
tmp = (x / y) / t;
} else if (t <= 1e+208) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = (x / y) * (1.0 / t) t_2 = -(x / (z * t)) tmp = 0 if t <= -1.05e-41: tmp = t_1 elif t <= 5e-15: tmp = -x / (y * z) elif t <= 2.9e+147: tmp = t_2 elif t <= 1.6e+187: tmp = (x / y) / t elif t <= 1e+208: tmp = t_2 else: tmp = t_1 return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(Float64(x / y) * Float64(1.0 / t)) t_2 = Float64(-Float64(x / Float64(z * t))) tmp = 0.0 if (t <= -1.05e-41) tmp = t_1; elseif (t <= 5e-15) tmp = Float64(Float64(-x) / Float64(y * z)); elseif (t <= 2.9e+147) tmp = t_2; elseif (t <= 1.6e+187) tmp = Float64(Float64(x / y) / t); elseif (t <= 1e+208) tmp = t_2; else tmp = t_1; end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = (x / y) * (1.0 / t);
t_2 = -(x / (z * t));
tmp = 0.0;
if (t <= -1.05e-41)
tmp = t_1;
elseif (t <= 5e-15)
tmp = -x / (y * z);
elseif (t <= 2.9e+147)
tmp = t_2;
elseif (t <= 1.6e+187)
tmp = (x / y) / t;
elseif (t <= 1e+208)
tmp = t_2;
else
tmp = t_1;
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x / y), $MachinePrecision] * N[(1.0 / t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = (-N[(x / N[(z * t), $MachinePrecision]), $MachinePrecision])}, If[LessEqual[t, -1.05e-41], t$95$1, If[LessEqual[t, 5e-15], N[((-x) / N[(y * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.9e+147], t$95$2, If[LessEqual[t, 1.6e+187], N[(N[(x / y), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[t, 1e+208], t$95$2, t$95$1]]]]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \frac{x}{y} \cdot \frac{1}{t}\\
t_2 := -\frac{x}{z \cdot t}\\
\mathbf{if}\;t \leq -1.05 \cdot 10^{-41}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 5 \cdot 10^{-15}:\\
\;\;\;\;\frac{-x}{y \cdot z}\\
\mathbf{elif}\;t \leq 2.9 \cdot 10^{+147}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t \leq 1.6 \cdot 10^{+187}:\\
\;\;\;\;\frac{\frac{x}{y}}{t}\\
\mathbf{elif}\;t \leq 10^{+208}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if t < -1.05000000000000006e-41 or 9.9999999999999998e207 < t Initial program 84.0%
Taylor expanded in z around 0 51.4%
*-un-lft-identity51.4%
times-frac59.0%
Applied egg-rr59.0%
if -1.05000000000000006e-41 < t < 4.99999999999999999e-15Initial program 87.2%
Taylor expanded in y around inf 60.4%
*-commutative60.4%
associate-/r*63.7%
Simplified63.7%
Taylor expanded in t around 0 42.1%
associate-*r/42.1%
neg-mul-142.1%
*-commutative42.1%
Simplified42.1%
if 4.99999999999999999e-15 < t < 2.8999999999999998e147 or 1.59999999999999997e187 < t < 9.9999999999999998e207Initial program 82.1%
Taylor expanded in y around 0 65.1%
associate-*r/65.1%
neg-mul-165.1%
Simplified65.1%
Taylor expanded in z around 0 54.8%
associate-*r/54.8%
neg-mul-154.8%
Simplified54.8%
if 2.8999999999999998e147 < t < 1.59999999999999997e187Initial program 100.0%
Taylor expanded in z around 0 100.0%
clear-num99.8%
associate-/r/99.7%
*-commutative99.7%
associate-/r*100.0%
Applied egg-rr100.0%
associate-*l/100.0%
associate-*l/100.0%
*-un-lft-identity100.0%
Applied egg-rr100.0%
Final simplification52.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 (- (/ x (* z t)))))
(if (<= t -1.05e-41)
(* (/ x y) (/ 1.0 t))
(if (<= t 3.9e-16)
(/ (- x) (* y z))
(if (<= t 6.5e+147)
t_1
(if (<= t 4.1e+187)
(/ (/ x y) t)
(if (<= t 4.5e+207) t_1 (/ 1.0 (* t (/ y x))))))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = -(x / (z * t));
double tmp;
if (t <= -1.05e-41) {
tmp = (x / y) * (1.0 / t);
} else if (t <= 3.9e-16) {
tmp = -x / (y * z);
} else if (t <= 6.5e+147) {
tmp = t_1;
} else if (t <= 4.1e+187) {
tmp = (x / y) / t;
} else if (t <= 4.5e+207) {
tmp = t_1;
} else {
tmp = 1.0 / (t * (y / x));
}
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 * t))
if (t <= (-1.05d-41)) then
tmp = (x / y) * (1.0d0 / t)
else if (t <= 3.9d-16) then
tmp = -x / (y * z)
else if (t <= 6.5d+147) then
tmp = t_1
else if (t <= 4.1d+187) then
tmp = (x / y) / t
else if (t <= 4.5d+207) then
tmp = t_1
else
tmp = 1.0d0 / (t * (y / x))
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 * t));
double tmp;
if (t <= -1.05e-41) {
tmp = (x / y) * (1.0 / t);
} else if (t <= 3.9e-16) {
tmp = -x / (y * z);
} else if (t <= 6.5e+147) {
tmp = t_1;
} else if (t <= 4.1e+187) {
tmp = (x / y) / t;
} else if (t <= 4.5e+207) {
tmp = t_1;
} else {
tmp = 1.0 / (t * (y / x));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = -(x / (z * t)) tmp = 0 if t <= -1.05e-41: tmp = (x / y) * (1.0 / t) elif t <= 3.9e-16: tmp = -x / (y * z) elif t <= 6.5e+147: tmp = t_1 elif t <= 4.1e+187: tmp = (x / y) / t elif t <= 4.5e+207: tmp = t_1 else: tmp = 1.0 / (t * (y / x)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(-Float64(x / Float64(z * t))) tmp = 0.0 if (t <= -1.05e-41) tmp = Float64(Float64(x / y) * Float64(1.0 / t)); elseif (t <= 3.9e-16) tmp = Float64(Float64(-x) / Float64(y * z)); elseif (t <= 6.5e+147) tmp = t_1; elseif (t <= 4.1e+187) tmp = Float64(Float64(x / y) / t); elseif (t <= 4.5e+207) tmp = t_1; else tmp = Float64(1.0 / Float64(t * Float64(y / x))); 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 * t));
tmp = 0.0;
if (t <= -1.05e-41)
tmp = (x / y) * (1.0 / t);
elseif (t <= 3.9e-16)
tmp = -x / (y * z);
elseif (t <= 6.5e+147)
tmp = t_1;
elseif (t <= 4.1e+187)
tmp = (x / y) / t;
elseif (t <= 4.5e+207)
tmp = t_1;
else
tmp = 1.0 / (t * (y / x));
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 * t), $MachinePrecision]), $MachinePrecision])}, If[LessEqual[t, -1.05e-41], N[(N[(x / y), $MachinePrecision] * N[(1.0 / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3.9e-16], N[((-x) / N[(y * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 6.5e+147], t$95$1, If[LessEqual[t, 4.1e+187], N[(N[(x / y), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[t, 4.5e+207], t$95$1, N[(1.0 / N[(t * N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := -\frac{x}{z \cdot t}\\
\mathbf{if}\;t \leq -1.05 \cdot 10^{-41}:\\
\;\;\;\;\frac{x}{y} \cdot \frac{1}{t}\\
\mathbf{elif}\;t \leq 3.9 \cdot 10^{-16}:\\
\;\;\;\;\frac{-x}{y \cdot z}\\
\mathbf{elif}\;t \leq 6.5 \cdot 10^{+147}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 4.1 \cdot 10^{+187}:\\
\;\;\;\;\frac{\frac{x}{y}}{t}\\
\mathbf{elif}\;t \leq 4.5 \cdot 10^{+207}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{t \cdot \frac{y}{x}}\\
\end{array}
\end{array}
if t < -1.05000000000000006e-41Initial program 87.3%
Taylor expanded in z around 0 50.5%
*-un-lft-identity50.5%
times-frac56.5%
Applied egg-rr56.5%
if -1.05000000000000006e-41 < t < 3.89999999999999977e-16Initial program 87.2%
Taylor expanded in y around inf 60.4%
*-commutative60.4%
associate-/r*63.7%
Simplified63.7%
Taylor expanded in t around 0 42.1%
associate-*r/42.1%
neg-mul-142.1%
*-commutative42.1%
Simplified42.1%
if 3.89999999999999977e-16 < t < 6.5e147 or 4.1e187 < t < 4.50000000000000003e207Initial program 82.1%
Taylor expanded in y around 0 65.1%
associate-*r/65.1%
neg-mul-165.1%
Simplified65.1%
Taylor expanded in z around 0 54.8%
associate-*r/54.8%
neg-mul-154.8%
Simplified54.8%
if 6.5e147 < t < 4.1e187Initial program 100.0%
Taylor expanded in z around 0 100.0%
clear-num99.8%
associate-/r/99.7%
*-commutative99.7%
associate-/r*100.0%
Applied egg-rr100.0%
associate-*l/100.0%
associate-*l/100.0%
*-un-lft-identity100.0%
Applied egg-rr100.0%
if 4.50000000000000003e207 < t Initial program 70.5%
Taylor expanded in z around 0 55.0%
clear-num54.9%
associate-/r/55.0%
*-commutative55.0%
associate-/r*49.9%
Applied egg-rr49.9%
associate-/l/55.0%
associate-*l/55.0%
*-commutative55.0%
times-frac64.5%
associate-/r/64.6%
associate-/r/69.4%
Applied egg-rr69.4%
Final simplification52.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 -2.3e-41)
(/ (/ x t) y)
(if (<= t 2.7e-15)
(/ (- x) (* y z))
(if (or (<= t 2.3e+147) (and (not (<= t 6.3e+187)) (<= t 8.8e+207)))
(- (/ 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 (t <= -2.3e-41) {
tmp = (x / t) / y;
} else if (t <= 2.7e-15) {
tmp = -x / (y * z);
} else if ((t <= 2.3e+147) || (!(t <= 6.3e+187) && (t <= 8.8e+207))) {
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 (t <= (-2.3d-41)) then
tmp = (x / t) / y
else if (t <= 2.7d-15) then
tmp = -x / (y * z)
else if ((t <= 2.3d+147) .or. (.not. (t <= 6.3d+187)) .and. (t <= 8.8d+207)) 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 (t <= -2.3e-41) {
tmp = (x / t) / y;
} else if (t <= 2.7e-15) {
tmp = -x / (y * z);
} else if ((t <= 2.3e+147) || (!(t <= 6.3e+187) && (t <= 8.8e+207))) {
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 t <= -2.3e-41: tmp = (x / t) / y elif t <= 2.7e-15: tmp = -x / (y * z) elif (t <= 2.3e+147) or (not (t <= 6.3e+187) and (t <= 8.8e+207)): 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 (t <= -2.3e-41) tmp = Float64(Float64(x / t) / y); elseif (t <= 2.7e-15) tmp = Float64(Float64(-x) / Float64(y * z)); elseif ((t <= 2.3e+147) || (!(t <= 6.3e+187) && (t <= 8.8e+207))) tmp = Float64(-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 (t <= -2.3e-41)
tmp = (x / t) / y;
elseif (t <= 2.7e-15)
tmp = -x / (y * z);
elseif ((t <= 2.3e+147) || (~((t <= 6.3e+187)) && (t <= 8.8e+207)))
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[LessEqual[t, -2.3e-41], N[(N[(x / t), $MachinePrecision] / y), $MachinePrecision], If[LessEqual[t, 2.7e-15], N[((-x) / N[(y * z), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[t, 2.3e+147], And[N[Not[LessEqual[t, 6.3e+187]], $MachinePrecision], LessEqual[t, 8.8e+207]]], (-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}\;t \leq -2.3 \cdot 10^{-41}:\\
\;\;\;\;\frac{\frac{x}{t}}{y}\\
\mathbf{elif}\;t \leq 2.7 \cdot 10^{-15}:\\
\;\;\;\;\frac{-x}{y \cdot z}\\
\mathbf{elif}\;t \leq 2.3 \cdot 10^{+147} \lor \neg \left(t \leq 6.3 \cdot 10^{+187}\right) \land t \leq 8.8 \cdot 10^{+207}:\\
\;\;\;\;-\frac{x}{z \cdot t}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{t}\\
\end{array}
\end{array}
if t < -2.3000000000000001e-41Initial program 87.3%
Taylor expanded in y around inf 51.2%
*-commutative51.2%
associate-/r*56.0%
Simplified56.0%
Taylor expanded in t around inf 55.2%
if -2.3000000000000001e-41 < t < 2.70000000000000009e-15Initial program 87.2%
Taylor expanded in y around inf 60.4%
*-commutative60.4%
associate-/r*63.7%
Simplified63.7%
Taylor expanded in t around 0 42.1%
associate-*r/42.1%
neg-mul-142.1%
*-commutative42.1%
Simplified42.1%
if 2.70000000000000009e-15 < t < 2.2999999999999999e147 or 6.30000000000000005e187 < t < 8.80000000000000034e207Initial program 82.1%
Taylor expanded in y around 0 65.1%
associate-*r/65.1%
neg-mul-165.1%
Simplified65.1%
Taylor expanded in z around 0 54.8%
associate-*r/54.8%
neg-mul-154.8%
Simplified54.8%
if 2.2999999999999999e147 < t < 6.30000000000000005e187 or 8.80000000000000034e207 < t Initial program 80.7%
Taylor expanded in z around 0 70.5%
clear-num70.4%
associate-/r/70.4%
*-commutative70.4%
associate-/r*67.2%
Applied egg-rr67.2%
associate-*l/79.8%
associate-*l/79.9%
*-un-lft-identity79.9%
Applied egg-rr79.9%
Final simplification52.2%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ x (- y z))))
(if (<= t -3.3e-186)
(* (/ x (- t z)) (/ 1.0 y))
(if (<= t 3.5e+19) (* t_1 (/ -1.0 z)) (/ t_1 t)))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = x / (y - z);
double tmp;
if (t <= -3.3e-186) {
tmp = (x / (t - z)) * (1.0 / y);
} else if (t <= 3.5e+19) {
tmp = t_1 * (-1.0 / z);
} else {
tmp = t_1 / 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 / (y - z)
if (t <= (-3.3d-186)) then
tmp = (x / (t - z)) * (1.0d0 / y)
else if (t <= 3.5d+19) then
tmp = t_1 * ((-1.0d0) / z)
else
tmp = t_1 / 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 / (y - z);
double tmp;
if (t <= -3.3e-186) {
tmp = (x / (t - z)) * (1.0 / y);
} else if (t <= 3.5e+19) {
tmp = t_1 * (-1.0 / z);
} else {
tmp = t_1 / t;
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = x / (y - z) tmp = 0 if t <= -3.3e-186: tmp = (x / (t - z)) * (1.0 / y) elif t <= 3.5e+19: tmp = t_1 * (-1.0 / z) else: tmp = t_1 / t return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(x / Float64(y - z)) tmp = 0.0 if (t <= -3.3e-186) tmp = Float64(Float64(x / Float64(t - z)) * Float64(1.0 / y)); elseif (t <= 3.5e+19) tmp = Float64(t_1 * Float64(-1.0 / z)); else tmp = Float64(t_1 / 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 / (y - z);
tmp = 0.0;
if (t <= -3.3e-186)
tmp = (x / (t - z)) * (1.0 / y);
elseif (t <= 3.5e+19)
tmp = t_1 * (-1.0 / z);
else
tmp = t_1 / 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[(y - z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -3.3e-186], N[(N[(x / N[(t - z), $MachinePrecision]), $MachinePrecision] * N[(1.0 / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3.5e+19], N[(t$95$1 * N[(-1.0 / z), $MachinePrecision]), $MachinePrecision], N[(t$95$1 / t), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \frac{x}{y - z}\\
\mathbf{if}\;t \leq -3.3 \cdot 10^{-186}:\\
\;\;\;\;\frac{x}{t - z} \cdot \frac{1}{y}\\
\mathbf{elif}\;t \leq 3.5 \cdot 10^{+19}:\\
\;\;\;\;t_1 \cdot \frac{-1}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{t_1}{t}\\
\end{array}
\end{array}
if t < -3.29999999999999999e-186Initial program 85.2%
Taylor expanded in y around inf 53.3%
*-commutative53.3%
associate-/r*60.1%
Simplified60.1%
div-inv60.1%
Applied egg-rr60.1%
if -3.29999999999999999e-186 < t < 3.5e19Initial program 88.7%
associate-/r*93.0%
div-inv93.0%
Applied egg-rr93.0%
Taylor expanded in t around 0 79.2%
if 3.5e19 < t Initial program 82.2%
associate-/r*99.8%
div-inv99.7%
Applied egg-rr99.7%
Taylor expanded in t around inf 90.0%
un-div-inv90.1%
Applied egg-rr90.1%
Final simplification73.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 (- y z))))
(if (<= t -1.26e-185)
(/ 1.0 (* y (/ (- t z) x)))
(if (<= t 7e+19) (* t_1 (/ -1.0 z)) (/ t_1 t)))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = x / (y - z);
double tmp;
if (t <= -1.26e-185) {
tmp = 1.0 / (y * ((t - z) / x));
} else if (t <= 7e+19) {
tmp = t_1 * (-1.0 / z);
} else {
tmp = t_1 / 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 / (y - z)
if (t <= (-1.26d-185)) then
tmp = 1.0d0 / (y * ((t - z) / x))
else if (t <= 7d+19) then
tmp = t_1 * ((-1.0d0) / z)
else
tmp = t_1 / 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 / (y - z);
double tmp;
if (t <= -1.26e-185) {
tmp = 1.0 / (y * ((t - z) / x));
} else if (t <= 7e+19) {
tmp = t_1 * (-1.0 / z);
} else {
tmp = t_1 / t;
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = x / (y - z) tmp = 0 if t <= -1.26e-185: tmp = 1.0 / (y * ((t - z) / x)) elif t <= 7e+19: tmp = t_1 * (-1.0 / z) else: tmp = t_1 / t return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(x / Float64(y - z)) tmp = 0.0 if (t <= -1.26e-185) tmp = Float64(1.0 / Float64(y * Float64(Float64(t - z) / x))); elseif (t <= 7e+19) tmp = Float64(t_1 * Float64(-1.0 / z)); else tmp = Float64(t_1 / 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 / (y - z);
tmp = 0.0;
if (t <= -1.26e-185)
tmp = 1.0 / (y * ((t - z) / x));
elseif (t <= 7e+19)
tmp = t_1 * (-1.0 / z);
else
tmp = t_1 / 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[(y - z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -1.26e-185], N[(1.0 / N[(y * N[(N[(t - z), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 7e+19], N[(t$95$1 * N[(-1.0 / z), $MachinePrecision]), $MachinePrecision], N[(t$95$1 / t), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \frac{x}{y - z}\\
\mathbf{if}\;t \leq -1.26 \cdot 10^{-185}:\\
\;\;\;\;\frac{1}{y \cdot \frac{t - z}{x}}\\
\mathbf{elif}\;t \leq 7 \cdot 10^{+19}:\\
\;\;\;\;t_1 \cdot \frac{-1}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{t_1}{t}\\
\end{array}
\end{array}
if t < -1.2599999999999999e-185Initial program 85.2%
Taylor expanded in y around inf 53.3%
*-commutative53.3%
associate-/r*60.1%
Simplified60.1%
clear-num60.1%
inv-pow60.1%
div-inv60.1%
clear-num60.2%
Applied egg-rr60.2%
unpow-160.2%
Simplified60.2%
if -1.2599999999999999e-185 < t < 7e19Initial program 88.7%
associate-/r*93.0%
div-inv93.0%
Applied egg-rr93.0%
Taylor expanded in t around 0 79.2%
if 7e19 < t Initial program 82.2%
associate-/r*99.8%
div-inv99.7%
Applied egg-rr99.7%
Taylor expanded in t around inf 90.0%
un-div-inv90.1%
Applied egg-rr90.1%
Final simplification73.8%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= y -1.2e-61) (/ (/ x (- t z)) y) (if (<= y 7.6e-187) (/ (- x) (* z (- t z))) (/ (/ x (- y z)) t))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.2e-61) {
tmp = (x / (t - z)) / y;
} else if (y <= 7.6e-187) {
tmp = -x / (z * (t - z));
} else {
tmp = (x / (y - 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 (y <= (-1.2d-61)) then
tmp = (x / (t - z)) / y
else if (y <= 7.6d-187) then
tmp = -x / (z * (t - z))
else
tmp = (x / (y - 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 (y <= -1.2e-61) {
tmp = (x / (t - z)) / y;
} else if (y <= 7.6e-187) {
tmp = -x / (z * (t - z));
} else {
tmp = (x / (y - z)) / t;
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if y <= -1.2e-61: tmp = (x / (t - z)) / y elif y <= 7.6e-187: tmp = -x / (z * (t - z)) else: tmp = (x / (y - z)) / t return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (y <= -1.2e-61) tmp = Float64(Float64(x / Float64(t - z)) / y); elseif (y <= 7.6e-187) tmp = Float64(Float64(-x) / Float64(z * Float64(t - z))); else tmp = Float64(Float64(x / Float64(y - z)) / 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 (y <= -1.2e-61)
tmp = (x / (t - z)) / y;
elseif (y <= 7.6e-187)
tmp = -x / (z * (t - z));
else
tmp = (x / (y - 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[y, -1.2e-61], N[(N[(x / N[(t - z), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision], If[LessEqual[y, 7.6e-187], N[((-x) / N[(z * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(y - z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.2 \cdot 10^{-61}:\\
\;\;\;\;\frac{\frac{x}{t - z}}{y}\\
\mathbf{elif}\;y \leq 7.6 \cdot 10^{-187}:\\
\;\;\;\;\frac{-x}{z \cdot \left(t - z\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y - z}}{t}\\
\end{array}
\end{array}
if y < -1.2e-61Initial program 80.7%
Taylor expanded in y around inf 75.5%
*-commutative75.5%
associate-/r*83.3%
Simplified83.3%
if -1.2e-61 < y < 7.60000000000000051e-187Initial program 90.8%
Taylor expanded in y around 0 83.3%
associate-*r/83.3%
neg-mul-183.3%
Simplified83.3%
if 7.60000000000000051e-187 < y Initial program 86.4%
associate-/r*95.2%
div-inv95.2%
Applied egg-rr95.2%
Taylor expanded in t around inf 65.4%
un-div-inv65.4%
Applied egg-rr65.4%
Final simplification76.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 (<= y -3.6e-61) (/ (/ x (- t z)) y) (if (<= y 8.4e-173) (/ (- (/ x z)) (- t z)) (/ (/ x (- y z)) t))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -3.6e-61) {
tmp = (x / (t - z)) / y;
} else if (y <= 8.4e-173) {
tmp = -(x / z) / (t - z);
} else {
tmp = (x / (y - 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 (y <= (-3.6d-61)) then
tmp = (x / (t - z)) / y
else if (y <= 8.4d-173) then
tmp = -(x / z) / (t - z)
else
tmp = (x / (y - 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 (y <= -3.6e-61) {
tmp = (x / (t - z)) / y;
} else if (y <= 8.4e-173) {
tmp = -(x / z) / (t - z);
} else {
tmp = (x / (y - z)) / t;
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if y <= -3.6e-61: tmp = (x / (t - z)) / y elif y <= 8.4e-173: tmp = -(x / z) / (t - z) else: tmp = (x / (y - z)) / t return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (y <= -3.6e-61) tmp = Float64(Float64(x / Float64(t - z)) / y); elseif (y <= 8.4e-173) tmp = Float64(Float64(-Float64(x / z)) / Float64(t - z)); else tmp = Float64(Float64(x / Float64(y - z)) / 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 (y <= -3.6e-61)
tmp = (x / (t - z)) / y;
elseif (y <= 8.4e-173)
tmp = -(x / z) / (t - z);
else
tmp = (x / (y - 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[y, -3.6e-61], N[(N[(x / N[(t - z), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision], If[LessEqual[y, 8.4e-173], N[((-N[(x / z), $MachinePrecision]) / N[(t - z), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(y - z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.6 \cdot 10^{-61}:\\
\;\;\;\;\frac{\frac{x}{t - z}}{y}\\
\mathbf{elif}\;y \leq 8.4 \cdot 10^{-173}:\\
\;\;\;\;\frac{-\frac{x}{z}}{t - z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y - z}}{t}\\
\end{array}
\end{array}
if y < -3.60000000000000014e-61Initial program 80.7%
Taylor expanded in y around inf 75.5%
*-commutative75.5%
associate-/r*83.3%
Simplified83.3%
if -3.60000000000000014e-61 < y < 8.40000000000000006e-173Initial program 90.1%
associate-/r*95.8%
div-inv95.8%
Applied egg-rr95.8%
un-div-inv95.8%
Applied egg-rr95.8%
Taylor expanded in y around 0 86.1%
associate-*r/86.1%
neg-mul-186.1%
Simplified86.1%
if 8.40000000000000006e-173 < y Initial program 86.9%
associate-/r*95.1%
div-inv95.1%
Applied egg-rr95.1%
Taylor expanded in t around inf 66.6%
un-div-inv66.6%
Applied egg-rr66.6%
Final simplification77.5%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (or (<= z -2.7e+84) (not (<= z 1.6e+60))) (/ x (* z (- t z))) (/ x (* (- y z) t))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -2.7e+84) || !(z <= 1.6e+60)) {
tmp = x / (z * (t - z));
} else {
tmp = x / ((y - 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 <= (-2.7d+84)) .or. (.not. (z <= 1.6d+60))) then
tmp = x / (z * (t - z))
else
tmp = x / ((y - 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 <= -2.7e+84) || !(z <= 1.6e+60)) {
tmp = x / (z * (t - z));
} else {
tmp = x / ((y - z) * t);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if (z <= -2.7e+84) or not (z <= 1.6e+60): tmp = x / (z * (t - z)) else: tmp = x / ((y - z) * t) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if ((z <= -2.7e+84) || !(z <= 1.6e+60)) tmp = Float64(x / Float64(z * Float64(t - z))); else tmp = Float64(x / Float64(Float64(y - z) * 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.7e+84) || ~((z <= 1.6e+60)))
tmp = x / (z * (t - z));
else
tmp = x / ((y - 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[Or[LessEqual[z, -2.7e+84], N[Not[LessEqual[z, 1.6e+60]], $MachinePrecision]], N[(x / N[(z * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x / N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.7 \cdot 10^{+84} \lor \neg \left(z \leq 1.6 \cdot 10^{+60}\right):\\
\;\;\;\;\frac{x}{z \cdot \left(t - z\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\left(y - z\right) \cdot t}\\
\end{array}
\end{array}
if z < -2.7e84 or 1.59999999999999995e60 < z Initial program 77.1%
Taylor expanded in y around 0 74.2%
associate-*r/74.2%
neg-mul-174.2%
Simplified74.2%
expm1-log1p-u74.0%
expm1-udef67.4%
add-sqr-sqrt29.3%
sqrt-unprod61.0%
sqr-neg61.0%
sqrt-unprod35.2%
add-sqr-sqrt64.5%
Applied egg-rr64.5%
expm1-def63.5%
expm1-log1p63.5%
Simplified63.5%
if -2.7e84 < z < 1.59999999999999995e60Initial program 91.0%
Taylor expanded in t around inf 66.8%
Final simplification65.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 -1.05e-41) (* (/ x y) (/ 1.0 t)) (if (<= t 1.36e-127) (/ (- x) (* y z)) (/ x (* (- y z) t)))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -1.05e-41) {
tmp = (x / y) * (1.0 / t);
} else if (t <= 1.36e-127) {
tmp = -x / (y * z);
} else {
tmp = x / ((y - 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 (t <= (-1.05d-41)) then
tmp = (x / y) * (1.0d0 / t)
else if (t <= 1.36d-127) then
tmp = -x / (y * z)
else
tmp = x / ((y - 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 (t <= -1.05e-41) {
tmp = (x / y) * (1.0 / t);
} else if (t <= 1.36e-127) {
tmp = -x / (y * z);
} else {
tmp = x / ((y - z) * t);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if t <= -1.05e-41: tmp = (x / y) * (1.0 / t) elif t <= 1.36e-127: tmp = -x / (y * z) else: tmp = x / ((y - z) * t) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (t <= -1.05e-41) tmp = Float64(Float64(x / y) * Float64(1.0 / t)); elseif (t <= 1.36e-127) tmp = Float64(Float64(-x) / Float64(y * z)); else tmp = Float64(x / Float64(Float64(y - z) * 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 (t <= -1.05e-41)
tmp = (x / y) * (1.0 / t);
elseif (t <= 1.36e-127)
tmp = -x / (y * z);
else
tmp = x / ((y - 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[t, -1.05e-41], N[(N[(x / y), $MachinePrecision] * N[(1.0 / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.36e-127], N[((-x) / N[(y * z), $MachinePrecision]), $MachinePrecision], N[(x / N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.05 \cdot 10^{-41}:\\
\;\;\;\;\frac{x}{y} \cdot \frac{1}{t}\\
\mathbf{elif}\;t \leq 1.36 \cdot 10^{-127}:\\
\;\;\;\;\frac{-x}{y \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\left(y - z\right) \cdot t}\\
\end{array}
\end{array}
if t < -1.05000000000000006e-41Initial program 87.3%
Taylor expanded in z around 0 50.5%
*-un-lft-identity50.5%
times-frac56.5%
Applied egg-rr56.5%
if -1.05000000000000006e-41 < t < 1.3599999999999999e-127Initial program 85.9%
Taylor expanded in y around inf 59.1%
*-commutative59.1%
associate-/r*62.7%
Simplified62.7%
Taylor expanded in t around 0 41.7%
associate-*r/41.7%
neg-mul-141.7%
*-commutative41.7%
Simplified41.7%
if 1.3599999999999999e-127 < t Initial program 84.1%
Taylor expanded in t around inf 70.6%
Final simplification54.8%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= y -3.2e-175) (/ (/ x y) t) (if (<= y 4e+18) (- (/ 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 (y <= -3.2e-175) {
tmp = (x / y) / t;
} else if (y <= 4e+18) {
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 (y <= (-3.2d-175)) then
tmp = (x / y) / t
else if (y <= 4d+18) 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 (y <= -3.2e-175) {
tmp = (x / y) / t;
} else if (y <= 4e+18) {
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 y <= -3.2e-175: tmp = (x / y) / t elif y <= 4e+18: 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 (y <= -3.2e-175) tmp = Float64(Float64(x / y) / t); elseif (y <= 4e+18) tmp = Float64(-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 (y <= -3.2e-175)
tmp = (x / y) / t;
elseif (y <= 4e+18)
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[LessEqual[y, -3.2e-175], N[(N[(x / y), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[y, 4e+18], (-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}\;y \leq -3.2 \cdot 10^{-175}:\\
\;\;\;\;\frac{\frac{x}{y}}{t}\\
\mathbf{elif}\;y \leq 4 \cdot 10^{+18}:\\
\;\;\;\;-\frac{x}{z \cdot t}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{t}}{y}\\
\end{array}
\end{array}
if y < -3.2e-175Initial program 83.9%
Taylor expanded in z around 0 48.4%
clear-num49.7%
associate-/r/48.4%
*-commutative48.4%
associate-/r*48.4%
Applied egg-rr48.4%
associate-*l/53.8%
associate-*l/53.8%
*-un-lft-identity53.8%
Applied egg-rr53.8%
if -3.2e-175 < y < 4e18Initial program 88.5%
Taylor expanded in y around 0 71.7%
associate-*r/71.7%
neg-mul-171.7%
Simplified71.7%
Taylor expanded in z around 0 45.0%
associate-*r/45.0%
neg-mul-145.0%
Simplified45.0%
if 4e18 < y Initial program 84.5%
Taylor expanded in y around inf 79.9%
*-commutative79.9%
associate-/r*84.3%
Simplified84.3%
Taylor expanded in t around inf 63.2%
Final simplification52.8%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= z -6.4e+150) (* (/ x (- y z)) (/ -1.0 z)) (/ x (* (- y z) (- t z)))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -6.4e+150) {
tmp = (x / (y - z)) * (-1.0 / z);
} else {
tmp = x / ((y - z) * (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 <= (-6.4d+150)) then
tmp = (x / (y - z)) * ((-1.0d0) / z)
else
tmp = x / ((y - z) * (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 <= -6.4e+150) {
tmp = (x / (y - z)) * (-1.0 / z);
} else {
tmp = x / ((y - z) * (t - z));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if z <= -6.4e+150: tmp = (x / (y - z)) * (-1.0 / z) else: tmp = x / ((y - z) * (t - z)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (z <= -6.4e+150) tmp = Float64(Float64(x / Float64(y - z)) * Float64(-1.0 / z)); else tmp = Float64(x / Float64(Float64(y - z) * 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 <= -6.4e+150)
tmp = (x / (y - z)) * (-1.0 / z);
else
tmp = x / ((y - z) * (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, -6.4e+150], N[(N[(x / N[(y - z), $MachinePrecision]), $MachinePrecision] * N[(-1.0 / z), $MachinePrecision]), $MachinePrecision], N[(x / N[(N[(y - z), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6.4 \cdot 10^{+150}:\\
\;\;\;\;\frac{x}{y - z} \cdot \frac{-1}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\left(y - z\right) \cdot \left(t - z\right)}\\
\end{array}
\end{array}
if z < -6.40000000000000031e150Initial program 61.3%
associate-/r*99.8%
div-inv99.8%
Applied egg-rr99.8%
Taylor expanded in t around 0 93.7%
if -6.40000000000000031e150 < z Initial program 91.0%
Final simplification91.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 (<= y -3.8e-79) (/ x (* y (- t z))) (/ x (* (- y z) t))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -3.8e-79) {
tmp = x / (y * (t - z));
} else {
tmp = x / ((y - 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 (y <= (-3.8d-79)) then
tmp = x / (y * (t - z))
else
tmp = x / ((y - 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 (y <= -3.8e-79) {
tmp = x / (y * (t - z));
} else {
tmp = x / ((y - z) * t);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if y <= -3.8e-79: tmp = x / (y * (t - z)) else: tmp = x / ((y - z) * t) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (y <= -3.8e-79) tmp = Float64(x / Float64(y * Float64(t - z))); else tmp = Float64(x / Float64(Float64(y - z) * 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 (y <= -3.8e-79)
tmp = x / (y * (t - z));
else
tmp = x / ((y - 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[y, -3.8e-79], N[(x / N[(y * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x / N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.8 \cdot 10^{-79}:\\
\;\;\;\;\frac{x}{y \cdot \left(t - z\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\left(y - z\right) \cdot t}\\
\end{array}
\end{array}
if y < -3.8000000000000001e-79Initial program 81.4%
Taylor expanded in y around inf 76.4%
*-commutative76.4%
Simplified76.4%
if -3.8000000000000001e-79 < y Initial program 88.0%
Taylor expanded in t around inf 57.1%
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 (<= y -1.22e-79) (/ (/ x y) (- t z)) (/ x (* (- y z) t))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.22e-79) {
tmp = (x / y) / (t - z);
} else {
tmp = x / ((y - 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 (y <= (-1.22d-79)) then
tmp = (x / y) / (t - z)
else
tmp = x / ((y - 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 (y <= -1.22e-79) {
tmp = (x / y) / (t - z);
} else {
tmp = x / ((y - z) * t);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if y <= -1.22e-79: tmp = (x / y) / (t - z) else: tmp = x / ((y - z) * t) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (y <= -1.22e-79) tmp = Float64(Float64(x / y) / Float64(t - z)); else tmp = Float64(x / Float64(Float64(y - z) * 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 (y <= -1.22e-79)
tmp = (x / y) / (t - z);
else
tmp = x / ((y - 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[y, -1.22e-79], N[(N[(x / y), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], N[(x / N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.22 \cdot 10^{-79}:\\
\;\;\;\;\frac{\frac{x}{y}}{t - z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\left(y - z\right) \cdot t}\\
\end{array}
\end{array}
if y < -1.22e-79Initial program 81.4%
associate-/r*98.0%
div-inv98.0%
Applied egg-rr98.0%
un-div-inv98.0%
Applied egg-rr98.0%
Taylor expanded in y around inf 76.4%
associate-/r*83.2%
Simplified83.2%
if -1.22e-79 < y Initial program 88.0%
Taylor expanded in t around inf 57.1%
Final simplification65.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 -2.4e-79) (/ (/ x (- t z)) y) (/ x (* (- y z) t))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -2.4e-79) {
tmp = (x / (t - z)) / y;
} else {
tmp = x / ((y - 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 (y <= (-2.4d-79)) then
tmp = (x / (t - z)) / y
else
tmp = x / ((y - 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 (y <= -2.4e-79) {
tmp = (x / (t - z)) / y;
} else {
tmp = x / ((y - z) * t);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if y <= -2.4e-79: tmp = (x / (t - z)) / y else: tmp = x / ((y - z) * t) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (y <= -2.4e-79) tmp = Float64(Float64(x / Float64(t - z)) / y); else tmp = Float64(x / Float64(Float64(y - z) * 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 (y <= -2.4e-79)
tmp = (x / (t - z)) / y;
else
tmp = x / ((y - 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[y, -2.4e-79], N[(N[(x / N[(t - z), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision], N[(x / N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.4 \cdot 10^{-79}:\\
\;\;\;\;\frac{\frac{x}{t - z}}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\left(y - z\right) \cdot t}\\
\end{array}
\end{array}
if y < -2.40000000000000006e-79Initial program 81.4%
Taylor expanded in y around inf 76.4%
*-commutative76.4%
associate-/r*83.8%
Simplified83.8%
if -2.40000000000000006e-79 < y Initial program 88.0%
Taylor expanded in t around inf 57.1%
Final simplification66.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 (<= y -3.1e-79) (/ (/ x (- t z)) y) (/ (/ x (- y z)) t)))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -3.1e-79) {
tmp = (x / (t - z)) / y;
} else {
tmp = (x / (y - 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 (y <= (-3.1d-79)) then
tmp = (x / (t - z)) / y
else
tmp = (x / (y - 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 (y <= -3.1e-79) {
tmp = (x / (t - z)) / y;
} else {
tmp = (x / (y - z)) / t;
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if y <= -3.1e-79: tmp = (x / (t - z)) / y else: tmp = (x / (y - z)) / t return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (y <= -3.1e-79) tmp = Float64(Float64(x / Float64(t - z)) / y); else tmp = Float64(Float64(x / Float64(y - z)) / 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 (y <= -3.1e-79)
tmp = (x / (t - z)) / y;
else
tmp = (x / (y - 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[y, -3.1e-79], N[(N[(x / N[(t - z), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision], N[(N[(x / N[(y - z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.1 \cdot 10^{-79}:\\
\;\;\;\;\frac{\frac{x}{t - z}}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y - z}}{t}\\
\end{array}
\end{array}
if y < -3.0999999999999999e-79Initial program 81.4%
Taylor expanded in y around inf 76.4%
*-commutative76.4%
associate-/r*83.8%
Simplified83.8%
if -3.0999999999999999e-79 < y Initial program 88.0%
associate-/r*95.3%
div-inv95.3%
Applied egg-rr95.3%
Taylor expanded in t around inf 61.5%
un-div-inv61.5%
Applied egg-rr61.5%
Final simplification69.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 85.8%
Taylor expanded in z around 0 38.4%
Final simplification38.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(Float64(x / 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[(N[(x / t), $MachinePrecision] / y), $MachinePrecision]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\frac{\frac{x}{t}}{y}
\end{array}
Initial program 85.8%
Taylor expanded in y around inf 54.8%
*-commutative54.8%
associate-/r*59.5%
Simplified59.5%
Taylor expanded in t around inf 40.2%
Final simplification40.2%
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(Float64(x / 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[(N[(x / y), $MachinePrecision] / t), $MachinePrecision]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\frac{\frac{x}{y}}{t}
\end{array}
Initial program 85.8%
Taylor expanded in z around 0 38.4%
clear-num38.9%
associate-/r/38.4%
*-commutative38.4%
associate-/r*38.5%
Applied egg-rr38.5%
associate-*l/43.1%
associate-*l/43.1%
*-un-lft-identity43.1%
Applied egg-rr43.1%
Final simplification43.1%
(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 2024020
(FPCore (x y z t)
:name "Data.Random.Distribution.Triangular:triangularCDF from random-fu-0.2.6.2, B"
:precision binary64
:herbie-target
(if (< (/ x (* (- y z) (- t z))) 0.0) (/ (/ x (- y z)) (- t z)) (* x (/ 1.0 (* (- y z) (- t z)))))
(/ x (* (- y z) (- t z))))