
(FPCore (x y z t) :precision binary64 (/ x (* (- y z) (- t z))))
double code(double x, double y, double z, double t) {
return x / ((y - z) * (t - z));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = x / ((y - z) * (t - z))
end function
public static double code(double x, double y, double z, double t) {
return x / ((y - z) * (t - z));
}
def code(x, y, z, t): return x / ((y - z) * (t - z))
function code(x, y, z, t) return Float64(x / Float64(Float64(y - z) * Float64(t - z))) end
function tmp = code(x, y, z, t) tmp = x / ((y - z) * (t - z)); end
code[x_, y_, z_, t_] := N[(x / N[(N[(y - z), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{\left(y - z\right) \cdot \left(t - z\right)}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 15 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (/ x (* (- y z) (- t z))))
double code(double x, double y, double z, double t) {
return x / ((y - z) * (t - z));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = x / ((y - z) * (t - z))
end function
public static double code(double x, double y, double z, double t) {
return x / ((y - z) * (t - z));
}
def code(x, y, z, t): return x / ((y - z) * (t - z))
function code(x, y, z, t) return Float64(x / Float64(Float64(y - z) * Float64(t - z))) end
function tmp = code(x, y, z, t) tmp = x / ((y - z) * (t - z)); end
code[x_, y_, z_, t_] := N[(x / N[(N[(y - z), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{\left(y - z\right) \cdot \left(t - z\right)}
\end{array}
NOTE: y and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (/ (/ x (- z t)) (- z y)))
assert(y < t);
double code(double x, double y, double z, double t) {
return (x / (z - t)) / (z - y);
}
NOTE: y and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (x / (z - t)) / (z - y)
end function
assert y < t;
public static double code(double x, double y, double z, double t) {
return (x / (z - t)) / (z - y);
}
[y, t] = sort([y, t]) def code(x, y, z, t): return (x / (z - t)) / (z - y)
y, t = sort([y, t]) function code(x, y, z, t) return Float64(Float64(x / Float64(z - t)) / Float64(z - y)) end
y, t = num2cell(sort([y, t])){:}
function tmp = code(x, y, z, t)
tmp = (x / (z - t)) / (z - y);
end
NOTE: y and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := N[(N[(x / N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[y, t] = \mathsf{sort}([y, t])\\
\\
\frac{\frac{x}{z - t}}{z - y}
\end{array}
Initial program 88.9%
associate-/l/97.3%
sub-neg97.3%
+-commutative97.3%
neg-sub097.3%
associate-+l-97.3%
sub0-neg97.3%
mul-1-neg97.3%
associate-/r*97.3%
associate-/l/97.3%
mul-1-neg97.3%
sub-neg97.3%
distribute-neg-out97.3%
remove-double-neg97.3%
+-commutative97.3%
sub-neg97.3%
Simplified97.3%
Final simplification97.3%
NOTE: y and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ x (* y (- t z)))) (t_2 (/ x (* t (- y z)))))
(if (<= z -2.35e+80)
(/ 1.0 (* z (/ z x)))
(if (<= z -2.8e-31)
t_1
(if (<= z 6.8e-178)
t_2
(if (<= z 1.6e-97)
t_1
(if (<= z 4.8e+66) t_2 (* (/ x z) (/ 1.0 z)))))))))assert(y < t);
double code(double x, double y, double z, double t) {
double t_1 = x / (y * (t - z));
double t_2 = x / (t * (y - z));
double tmp;
if (z <= -2.35e+80) {
tmp = 1.0 / (z * (z / x));
} else if (z <= -2.8e-31) {
tmp = t_1;
} else if (z <= 6.8e-178) {
tmp = t_2;
} else if (z <= 1.6e-97) {
tmp = t_1;
} else if (z <= 4.8e+66) {
tmp = t_2;
} else {
tmp = (x / z) * (1.0 / z);
}
return tmp;
}
NOTE: y and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = x / (y * (t - z))
t_2 = x / (t * (y - z))
if (z <= (-2.35d+80)) then
tmp = 1.0d0 / (z * (z / x))
else if (z <= (-2.8d-31)) then
tmp = t_1
else if (z <= 6.8d-178) then
tmp = t_2
else if (z <= 1.6d-97) then
tmp = t_1
else if (z <= 4.8d+66) then
tmp = t_2
else
tmp = (x / z) * (1.0d0 / z)
end if
code = tmp
end function
assert y < t;
public static double code(double x, double y, double z, double t) {
double t_1 = x / (y * (t - z));
double t_2 = x / (t * (y - z));
double tmp;
if (z <= -2.35e+80) {
tmp = 1.0 / (z * (z / x));
} else if (z <= -2.8e-31) {
tmp = t_1;
} else if (z <= 6.8e-178) {
tmp = t_2;
} else if (z <= 1.6e-97) {
tmp = t_1;
} else if (z <= 4.8e+66) {
tmp = t_2;
} else {
tmp = (x / z) * (1.0 / z);
}
return tmp;
}
[y, t] = sort([y, t]) def code(x, y, z, t): t_1 = x / (y * (t - z)) t_2 = x / (t * (y - z)) tmp = 0 if z <= -2.35e+80: tmp = 1.0 / (z * (z / x)) elif z <= -2.8e-31: tmp = t_1 elif z <= 6.8e-178: tmp = t_2 elif z <= 1.6e-97: tmp = t_1 elif z <= 4.8e+66: tmp = t_2 else: tmp = (x / z) * (1.0 / z) return tmp
y, t = sort([y, t]) function code(x, y, z, t) t_1 = Float64(x / Float64(y * Float64(t - z))) t_2 = Float64(x / Float64(t * Float64(y - z))) tmp = 0.0 if (z <= -2.35e+80) tmp = Float64(1.0 / Float64(z * Float64(z / x))); elseif (z <= -2.8e-31) tmp = t_1; elseif (z <= 6.8e-178) tmp = t_2; elseif (z <= 1.6e-97) tmp = t_1; elseif (z <= 4.8e+66) tmp = t_2; else tmp = Float64(Float64(x / z) * Float64(1.0 / z)); end return tmp end
y, t = num2cell(sort([y, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = x / (y * (t - z));
t_2 = x / (t * (y - z));
tmp = 0.0;
if (z <= -2.35e+80)
tmp = 1.0 / (z * (z / x));
elseif (z <= -2.8e-31)
tmp = t_1;
elseif (z <= 6.8e-178)
tmp = t_2;
elseif (z <= 1.6e-97)
tmp = t_1;
elseif (z <= 4.8e+66)
tmp = t_2;
else
tmp = (x / z) * (1.0 / z);
end
tmp_2 = tmp;
end
NOTE: y and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x / N[(y * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x / N[(t * N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.35e+80], N[(1.0 / N[(z * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -2.8e-31], t$95$1, If[LessEqual[z, 6.8e-178], t$95$2, If[LessEqual[z, 1.6e-97], t$95$1, If[LessEqual[z, 4.8e+66], t$95$2, N[(N[(x / z), $MachinePrecision] * N[(1.0 / z), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
[y, t] = \mathsf{sort}([y, t])\\
\\
\begin{array}{l}
t_1 := \frac{x}{y \cdot \left(t - z\right)}\\
t_2 := \frac{x}{t \cdot \left(y - z\right)}\\
\mathbf{if}\;z \leq -2.35 \cdot 10^{+80}:\\
\;\;\;\;\frac{1}{z \cdot \frac{z}{x}}\\
\mathbf{elif}\;z \leq -2.8 \cdot 10^{-31}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 6.8 \cdot 10^{-178}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq 1.6 \cdot 10^{-97}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 4.8 \cdot 10^{+66}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{z} \cdot \frac{1}{z}\\
\end{array}
\end{array}
if z < -2.35000000000000005e80Initial program 83.9%
remove-double-neg83.9%
sub0-neg83.9%
div-sub83.9%
div083.9%
div083.9%
associate-/r*99.9%
distribute-frac-neg99.9%
neg-mul-199.9%
sub-neg99.9%
+-commutative99.9%
neg-sub099.9%
associate-+l-99.9%
sub0-neg99.9%
mul-1-neg99.9%
times-frac99.9%
metadata-eval99.9%
*-lft-identity99.9%
div-sub99.9%
neg-sub099.9%
distribute-frac-neg99.9%
Simplified83.9%
Taylor expanded in t around 0 83.9%
clear-num83.8%
inv-pow83.8%
metadata-eval83.8%
sqr-pow71.0%
associate-/l*70.2%
div-inv70.2%
clear-num70.2%
metadata-eval70.2%
metadata-eval70.2%
associate-/l*76.9%
div-inv76.9%
clear-num76.9%
metadata-eval76.9%
metadata-eval76.9%
Applied egg-rr76.9%
pow-sqr97.5%
metadata-eval97.5%
unpow-197.5%
Simplified97.5%
Taylor expanded in z around inf 94.8%
if -2.35000000000000005e80 < z < -2.7999999999999999e-31 or 6.79999999999999945e-178 < z < 1.5999999999999999e-97Initial program 88.1%
remove-double-neg88.1%
sub0-neg88.1%
div-sub85.5%
div088.1%
div088.1%
associate-/r*98.1%
distribute-frac-neg98.1%
neg-mul-198.1%
sub-neg98.1%
+-commutative98.1%
neg-sub098.1%
associate-+l-98.1%
sub0-neg98.1%
mul-1-neg98.1%
times-frac98.1%
metadata-eval98.1%
*-lft-identity98.1%
div-sub98.1%
neg-sub098.1%
distribute-frac-neg98.1%
Simplified88.1%
Taylor expanded in y around inf 60.2%
associate-*r*60.2%
mul-1-neg60.2%
Simplified60.2%
Taylor expanded in z around 0 57.7%
*-commutative57.7%
mul-1-neg57.7%
distribute-lft-neg-out57.7%
distribute-rgt-out60.2%
+-commutative60.2%
sub-neg60.2%
Simplified60.2%
if -2.7999999999999999e-31 < z < 6.79999999999999945e-178 or 1.5999999999999999e-97 < z < 4.8000000000000003e66Initial program 92.0%
remove-double-neg92.0%
sub0-neg92.0%
div-sub89.3%
div092.0%
div092.0%
associate-/r*94.5%
distribute-frac-neg94.5%
neg-mul-194.5%
sub-neg94.5%
+-commutative94.5%
neg-sub094.5%
associate-+l-94.5%
sub0-neg94.5%
mul-1-neg94.5%
times-frac94.5%
metadata-eval94.5%
*-lft-identity94.5%
div-sub94.5%
neg-sub094.5%
distribute-frac-neg94.5%
Simplified92.0%
associate-/l/95.3%
div-inv95.2%
Applied egg-rr95.2%
Taylor expanded in t around inf 70.3%
associate-*r/70.3%
neg-mul-170.3%
Simplified70.3%
distribute-frac-neg70.3%
neg-sub070.3%
sub-neg70.3%
frac-2neg70.3%
distribute-frac-neg70.3%
remove-double-neg70.3%
distribute-rgt-neg-in70.3%
associate-/r*73.2%
neg-sub073.2%
sub-neg73.2%
+-commutative73.2%
associate--r+73.2%
neg-sub073.2%
remove-double-neg73.2%
Applied egg-rr73.2%
+-lft-identity73.2%
associate-/l/70.3%
*-commutative70.3%
Simplified70.3%
if 4.8000000000000003e66 < z Initial program 86.4%
remove-double-neg86.4%
sub0-neg86.4%
div-sub86.4%
div086.4%
div086.4%
associate-/r*99.9%
distribute-frac-neg99.9%
neg-mul-199.9%
sub-neg99.9%
+-commutative99.9%
neg-sub099.9%
associate-+l-99.9%
sub0-neg99.9%
mul-1-neg99.9%
times-frac99.9%
metadata-eval99.9%
*-lft-identity99.9%
div-sub99.9%
neg-sub099.9%
distribute-frac-neg99.9%
Simplified86.4%
associate-/l/99.9%
div-inv99.9%
Applied egg-rr99.9%
Taylor expanded in z around inf 83.6%
unpow283.6%
Simplified83.6%
associate-/r*93.8%
div-inv93.8%
Applied egg-rr93.8%
Final simplification77.6%
NOTE: y and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* (/ x z) (/ 1.0 z))))
(if (<= z -8.6e+33)
t_1
(if (<= z 5.2e-42)
(/ (/ x t) y)
(if (<= z 7.2e+57) (/ (- x) (* z t)) t_1)))))assert(y < t);
double code(double x, double y, double z, double t) {
double t_1 = (x / z) * (1.0 / z);
double tmp;
if (z <= -8.6e+33) {
tmp = t_1;
} else if (z <= 5.2e-42) {
tmp = (x / t) / y;
} else if (z <= 7.2e+57) {
tmp = -x / (z * t);
} else {
tmp = t_1;
}
return tmp;
}
NOTE: y and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = (x / z) * (1.0d0 / z)
if (z <= (-8.6d+33)) then
tmp = t_1
else if (z <= 5.2d-42) then
tmp = (x / t) / y
else if (z <= 7.2d+57) then
tmp = -x / (z * t)
else
tmp = t_1
end if
code = tmp
end function
assert y < t;
public static double code(double x, double y, double z, double t) {
double t_1 = (x / z) * (1.0 / z);
double tmp;
if (z <= -8.6e+33) {
tmp = t_1;
} else if (z <= 5.2e-42) {
tmp = (x / t) / y;
} else if (z <= 7.2e+57) {
tmp = -x / (z * t);
} else {
tmp = t_1;
}
return tmp;
}
[y, t] = sort([y, t]) def code(x, y, z, t): t_1 = (x / z) * (1.0 / z) tmp = 0 if z <= -8.6e+33: tmp = t_1 elif z <= 5.2e-42: tmp = (x / t) / y elif z <= 7.2e+57: tmp = -x / (z * t) else: tmp = t_1 return tmp
y, t = sort([y, t]) function code(x, y, z, t) t_1 = Float64(Float64(x / z) * Float64(1.0 / z)) tmp = 0.0 if (z <= -8.6e+33) tmp = t_1; elseif (z <= 5.2e-42) tmp = Float64(Float64(x / t) / y); elseif (z <= 7.2e+57) tmp = Float64(Float64(-x) / Float64(z * t)); else tmp = t_1; end return tmp end
y, t = num2cell(sort([y, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = (x / z) * (1.0 / z);
tmp = 0.0;
if (z <= -8.6e+33)
tmp = t_1;
elseif (z <= 5.2e-42)
tmp = (x / t) / y;
elseif (z <= 7.2e+57)
tmp = -x / (z * t);
else
tmp = t_1;
end
tmp_2 = tmp;
end
NOTE: y and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x / z), $MachinePrecision] * N[(1.0 / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -8.6e+33], t$95$1, If[LessEqual[z, 5.2e-42], N[(N[(x / t), $MachinePrecision] / y), $MachinePrecision], If[LessEqual[z, 7.2e+57], N[((-x) / N[(z * t), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
[y, t] = \mathsf{sort}([y, t])\\
\\
\begin{array}{l}
t_1 := \frac{x}{z} \cdot \frac{1}{z}\\
\mathbf{if}\;z \leq -8.6 \cdot 10^{+33}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 5.2 \cdot 10^{-42}:\\
\;\;\;\;\frac{\frac{x}{t}}{y}\\
\mathbf{elif}\;z \leq 7.2 \cdot 10^{+57}:\\
\;\;\;\;\frac{-x}{z \cdot t}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -8.60000000000000057e33 or 7.2000000000000005e57 < z Initial program 85.3%
remove-double-neg85.3%
sub0-neg85.3%
div-sub85.3%
div085.3%
div085.3%
associate-/r*99.9%
distribute-frac-neg99.9%
neg-mul-199.9%
sub-neg99.9%
+-commutative99.9%
neg-sub099.9%
associate-+l-99.9%
sub0-neg99.9%
mul-1-neg99.9%
times-frac99.9%
metadata-eval99.9%
*-lft-identity99.9%
div-sub99.9%
neg-sub099.9%
distribute-frac-neg99.9%
Simplified85.3%
associate-/l/99.9%
div-inv99.8%
Applied egg-rr99.8%
Taylor expanded in z around inf 79.0%
unpow279.0%
Simplified79.0%
associate-/r*89.9%
div-inv89.9%
Applied egg-rr89.9%
if -8.60000000000000057e33 < z < 5.2e-42Initial program 89.5%
remove-double-neg89.5%
sub0-neg89.5%
div-sub86.2%
div089.5%
div089.5%
associate-/r*95.0%
distribute-frac-neg95.0%
neg-mul-195.0%
sub-neg95.0%
+-commutative95.0%
neg-sub095.0%
associate-+l-95.0%
sub0-neg95.0%
mul-1-neg95.0%
times-frac95.0%
metadata-eval95.0%
*-lft-identity95.0%
div-sub95.0%
neg-sub095.0%
distribute-frac-neg95.0%
Simplified89.5%
Taylor expanded in z around 0 58.4%
associate-/l/65.1%
div-inv65.0%
Applied egg-rr65.0%
associate-*l/64.2%
un-div-inv64.4%
Applied egg-rr64.4%
if 5.2e-42 < z < 7.2000000000000005e57Initial program 99.9%
remove-double-neg99.9%
sub0-neg99.9%
div-sub99.9%
div099.9%
div099.9%
associate-/r*96.3%
distribute-frac-neg96.3%
neg-mul-196.3%
sub-neg96.3%
+-commutative96.3%
neg-sub096.3%
associate-+l-96.3%
sub0-neg96.3%
mul-1-neg96.3%
times-frac96.3%
metadata-eval96.3%
*-lft-identity96.3%
div-sub96.3%
neg-sub096.3%
distribute-frac-neg96.3%
Simplified99.9%
Taylor expanded in y around 0 60.8%
Taylor expanded in z around 0 42.2%
*-commutative42.2%
associate-*r/42.2%
neg-mul-142.2%
Simplified42.2%
Final simplification72.1%
NOTE: y and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(if (<= z -3.7e+33)
(/ 1.0 (* z (/ z x)))
(if (<= z 5.5e-47)
(/ (/ x t) y)
(if (<= z 9.4e+62) (/ (- x) (* z t)) (* (/ x z) (/ 1.0 z))))))assert(y < t);
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -3.7e+33) {
tmp = 1.0 / (z * (z / x));
} else if (z <= 5.5e-47) {
tmp = (x / t) / y;
} else if (z <= 9.4e+62) {
tmp = -x / (z * t);
} else {
tmp = (x / z) * (1.0 / z);
}
return tmp;
}
NOTE: y and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (z <= (-3.7d+33)) then
tmp = 1.0d0 / (z * (z / x))
else if (z <= 5.5d-47) then
tmp = (x / t) / y
else if (z <= 9.4d+62) then
tmp = -x / (z * t)
else
tmp = (x / z) * (1.0d0 / z)
end if
code = tmp
end function
assert y < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -3.7e+33) {
tmp = 1.0 / (z * (z / x));
} else if (z <= 5.5e-47) {
tmp = (x / t) / y;
} else if (z <= 9.4e+62) {
tmp = -x / (z * t);
} else {
tmp = (x / z) * (1.0 / z);
}
return tmp;
}
[y, t] = sort([y, t]) def code(x, y, z, t): tmp = 0 if z <= -3.7e+33: tmp = 1.0 / (z * (z / x)) elif z <= 5.5e-47: tmp = (x / t) / y elif z <= 9.4e+62: tmp = -x / (z * t) else: tmp = (x / z) * (1.0 / z) return tmp
y, t = sort([y, t]) function code(x, y, z, t) tmp = 0.0 if (z <= -3.7e+33) tmp = Float64(1.0 / Float64(z * Float64(z / x))); elseif (z <= 5.5e-47) tmp = Float64(Float64(x / t) / y); elseif (z <= 9.4e+62) tmp = Float64(Float64(-x) / Float64(z * t)); else tmp = Float64(Float64(x / z) * Float64(1.0 / z)); end return tmp end
y, t = num2cell(sort([y, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (z <= -3.7e+33)
tmp = 1.0 / (z * (z / x));
elseif (z <= 5.5e-47)
tmp = (x / t) / y;
elseif (z <= 9.4e+62)
tmp = -x / (z * t);
else
tmp = (x / z) * (1.0 / z);
end
tmp_2 = tmp;
end
NOTE: y and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[z, -3.7e+33], N[(1.0 / N[(z * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 5.5e-47], N[(N[(x / t), $MachinePrecision] / y), $MachinePrecision], If[LessEqual[z, 9.4e+62], N[((-x) / N[(z * t), $MachinePrecision]), $MachinePrecision], N[(N[(x / z), $MachinePrecision] * N[(1.0 / z), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[y, t] = \mathsf{sort}([y, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.7 \cdot 10^{+33}:\\
\;\;\;\;\frac{1}{z \cdot \frac{z}{x}}\\
\mathbf{elif}\;z \leq 5.5 \cdot 10^{-47}:\\
\;\;\;\;\frac{\frac{x}{t}}{y}\\
\mathbf{elif}\;z \leq 9.4 \cdot 10^{+62}:\\
\;\;\;\;\frac{-x}{z \cdot t}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{z} \cdot \frac{1}{z}\\
\end{array}
\end{array}
if z < -3.6999999999999999e33Initial program 83.9%
remove-double-neg83.9%
sub0-neg83.9%
div-sub83.9%
div083.9%
div083.9%
associate-/r*99.9%
distribute-frac-neg99.9%
neg-mul-199.9%
sub-neg99.9%
+-commutative99.9%
neg-sub099.9%
associate-+l-99.9%
sub0-neg99.9%
mul-1-neg99.9%
times-frac99.9%
metadata-eval99.9%
*-lft-identity99.9%
div-sub99.9%
neg-sub099.9%
distribute-frac-neg99.9%
Simplified83.9%
Taylor expanded in t around 0 77.7%
clear-num77.7%
inv-pow77.7%
metadata-eval77.7%
sqr-pow64.2%
associate-/l*63.5%
div-inv63.5%
clear-num63.5%
metadata-eval63.5%
metadata-eval63.5%
associate-/l*69.3%
div-inv69.3%
clear-num69.3%
metadata-eval69.3%
metadata-eval69.3%
Applied egg-rr69.3%
pow-sqr89.5%
metadata-eval89.5%
unpow-189.5%
Simplified89.5%
Taylor expanded in z around inf 85.1%
if -3.6999999999999999e33 < z < 5.5000000000000002e-47Initial program 89.5%
remove-double-neg89.5%
sub0-neg89.5%
div-sub86.2%
div089.5%
div089.5%
associate-/r*95.0%
distribute-frac-neg95.0%
neg-mul-195.0%
sub-neg95.0%
+-commutative95.0%
neg-sub095.0%
associate-+l-95.0%
sub0-neg95.0%
mul-1-neg95.0%
times-frac95.0%
metadata-eval95.0%
*-lft-identity95.0%
div-sub95.0%
neg-sub095.0%
distribute-frac-neg95.0%
Simplified89.5%
Taylor expanded in z around 0 58.4%
associate-/l/65.1%
div-inv65.0%
Applied egg-rr65.0%
associate-*l/64.2%
un-div-inv64.4%
Applied egg-rr64.4%
if 5.5000000000000002e-47 < z < 9.4000000000000006e62Initial program 99.9%
remove-double-neg99.9%
sub0-neg99.9%
div-sub99.9%
div099.9%
div099.9%
associate-/r*96.3%
distribute-frac-neg96.3%
neg-mul-196.3%
sub-neg96.3%
+-commutative96.3%
neg-sub096.3%
associate-+l-96.3%
sub0-neg96.3%
mul-1-neg96.3%
times-frac96.3%
metadata-eval96.3%
*-lft-identity96.3%
div-sub96.3%
neg-sub096.3%
distribute-frac-neg96.3%
Simplified99.9%
Taylor expanded in y around 0 60.8%
Taylor expanded in z around 0 42.2%
*-commutative42.2%
associate-*r/42.2%
neg-mul-142.2%
Simplified42.2%
if 9.4000000000000006e62 < z Initial program 86.4%
remove-double-neg86.4%
sub0-neg86.4%
div-sub86.4%
div086.4%
div086.4%
associate-/r*99.9%
distribute-frac-neg99.9%
neg-mul-199.9%
sub-neg99.9%
+-commutative99.9%
neg-sub099.9%
associate-+l-99.9%
sub0-neg99.9%
mul-1-neg99.9%
times-frac99.9%
metadata-eval99.9%
*-lft-identity99.9%
div-sub99.9%
neg-sub099.9%
distribute-frac-neg99.9%
Simplified86.4%
associate-/l/99.9%
div-inv99.9%
Applied egg-rr99.9%
Taylor expanded in z around inf 83.6%
unpow283.6%
Simplified83.6%
associate-/r*93.8%
div-inv93.8%
Applied egg-rr93.8%
Final simplification72.1%
NOTE: y and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= z -6.8e+161) (/ (/ x z) (- z y)) (if (<= z 4.2e+102) (/ x (* (- y z) (- t z))) (/ (/ x z) (- z t)))))
assert(y < t);
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -6.8e+161) {
tmp = (x / z) / (z - y);
} else if (z <= 4.2e+102) {
tmp = x / ((y - z) * (t - z));
} else {
tmp = (x / z) / (z - t);
}
return tmp;
}
NOTE: y and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (z <= (-6.8d+161)) then
tmp = (x / z) / (z - y)
else if (z <= 4.2d+102) then
tmp = x / ((y - z) * (t - z))
else
tmp = (x / z) / (z - t)
end if
code = tmp
end function
assert y < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -6.8e+161) {
tmp = (x / z) / (z - y);
} else if (z <= 4.2e+102) {
tmp = x / ((y - z) * (t - z));
} else {
tmp = (x / z) / (z - t);
}
return tmp;
}
[y, t] = sort([y, t]) def code(x, y, z, t): tmp = 0 if z <= -6.8e+161: tmp = (x / z) / (z - y) elif z <= 4.2e+102: tmp = x / ((y - z) * (t - z)) else: tmp = (x / z) / (z - t) return tmp
y, t = sort([y, t]) function code(x, y, z, t) tmp = 0.0 if (z <= -6.8e+161) tmp = Float64(Float64(x / z) / Float64(z - y)); elseif (z <= 4.2e+102) tmp = Float64(x / Float64(Float64(y - z) * Float64(t - z))); else tmp = Float64(Float64(x / z) / Float64(z - t)); end return tmp end
y, t = num2cell(sort([y, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (z <= -6.8e+161)
tmp = (x / z) / (z - y);
elseif (z <= 4.2e+102)
tmp = x / ((y - z) * (t - z));
else
tmp = (x / z) / (z - t);
end
tmp_2 = tmp;
end
NOTE: y and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[z, -6.8e+161], N[(N[(x / z), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 4.2e+102], N[(x / N[(N[(y - z), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / z), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[y, t] = \mathsf{sort}([y, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6.8 \cdot 10^{+161}:\\
\;\;\;\;\frac{\frac{x}{z}}{z - y}\\
\mathbf{elif}\;z \leq 4.2 \cdot 10^{+102}:\\
\;\;\;\;\frac{x}{\left(y - z\right) \cdot \left(t - z\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{z}}{z - t}\\
\end{array}
\end{array}
if z < -6.79999999999999986e161Initial program 71.4%
remove-double-neg71.4%
sub0-neg71.4%
div-sub71.4%
div071.4%
div071.4%
associate-/r*99.9%
distribute-frac-neg99.9%
neg-mul-199.9%
sub-neg99.9%
+-commutative99.9%
neg-sub099.9%
associate-+l-99.9%
sub0-neg99.9%
mul-1-neg99.9%
times-frac99.9%
metadata-eval99.9%
*-lft-identity99.9%
div-sub99.9%
neg-sub099.9%
distribute-frac-neg99.9%
Simplified71.4%
associate-/l/99.9%
div-inv99.9%
Applied egg-rr99.9%
Taylor expanded in t around 0 71.4%
associate-/r*95.6%
Simplified95.6%
if -6.79999999999999986e161 < z < 4.20000000000000003e102Initial program 92.3%
if 4.20000000000000003e102 < z Initial program 83.5%
remove-double-neg83.5%
sub0-neg83.5%
div-sub83.5%
div083.5%
div083.5%
associate-/r*99.9%
distribute-frac-neg99.9%
neg-mul-199.9%
sub-neg99.9%
+-commutative99.9%
neg-sub099.9%
associate-+l-99.9%
sub0-neg99.9%
mul-1-neg99.9%
times-frac99.9%
metadata-eval99.9%
*-lft-identity99.9%
div-sub99.9%
neg-sub099.9%
distribute-frac-neg99.9%
Simplified83.5%
Taylor expanded in y around 0 82.5%
frac-2neg82.5%
distribute-frac-neg82.5%
neg-sub082.5%
sub-neg82.5%
distribute-frac-neg82.5%
frac-2neg82.5%
associate-/r*94.8%
Applied egg-rr94.8%
+-lft-identity94.8%
Simplified94.8%
Final simplification93.0%
NOTE: y and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ x (* z z))))
(if (<= z -1.1e+34)
t_1
(if (<= z 5e-42)
(/ (/ x t) y)
(if (<= z 6.5e+58) (/ (- x) (* z t)) t_1)))))assert(y < t);
double code(double x, double y, double z, double t) {
double t_1 = x / (z * z);
double tmp;
if (z <= -1.1e+34) {
tmp = t_1;
} else if (z <= 5e-42) {
tmp = (x / t) / y;
} else if (z <= 6.5e+58) {
tmp = -x / (z * t);
} else {
tmp = t_1;
}
return tmp;
}
NOTE: y and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = x / (z * z)
if (z <= (-1.1d+34)) then
tmp = t_1
else if (z <= 5d-42) then
tmp = (x / t) / y
else if (z <= 6.5d+58) then
tmp = -x / (z * t)
else
tmp = t_1
end if
code = tmp
end function
assert y < t;
public static double code(double x, double y, double z, double t) {
double t_1 = x / (z * z);
double tmp;
if (z <= -1.1e+34) {
tmp = t_1;
} else if (z <= 5e-42) {
tmp = (x / t) / y;
} else if (z <= 6.5e+58) {
tmp = -x / (z * t);
} else {
tmp = t_1;
}
return tmp;
}
[y, t] = sort([y, t]) def code(x, y, z, t): t_1 = x / (z * z) tmp = 0 if z <= -1.1e+34: tmp = t_1 elif z <= 5e-42: tmp = (x / t) / y elif z <= 6.5e+58: tmp = -x / (z * t) else: tmp = t_1 return tmp
y, t = sort([y, t]) function code(x, y, z, t) t_1 = Float64(x / Float64(z * z)) tmp = 0.0 if (z <= -1.1e+34) tmp = t_1; elseif (z <= 5e-42) tmp = Float64(Float64(x / t) / y); elseif (z <= 6.5e+58) tmp = Float64(Float64(-x) / Float64(z * t)); else tmp = t_1; end return tmp end
y, t = num2cell(sort([y, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = x / (z * z);
tmp = 0.0;
if (z <= -1.1e+34)
tmp = t_1;
elseif (z <= 5e-42)
tmp = (x / t) / y;
elseif (z <= 6.5e+58)
tmp = -x / (z * t);
else
tmp = t_1;
end
tmp_2 = tmp;
end
NOTE: y and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x / N[(z * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.1e+34], t$95$1, If[LessEqual[z, 5e-42], N[(N[(x / t), $MachinePrecision] / y), $MachinePrecision], If[LessEqual[z, 6.5e+58], N[((-x) / N[(z * t), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
[y, t] = \mathsf{sort}([y, t])\\
\\
\begin{array}{l}
t_1 := \frac{x}{z \cdot z}\\
\mathbf{if}\;z \leq -1.1 \cdot 10^{+34}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 5 \cdot 10^{-42}:\\
\;\;\;\;\frac{\frac{x}{t}}{y}\\
\mathbf{elif}\;z \leq 6.5 \cdot 10^{+58}:\\
\;\;\;\;\frac{-x}{z \cdot t}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -1.1000000000000001e34 or 6.49999999999999998e58 < z Initial program 85.3%
remove-double-neg85.3%
sub0-neg85.3%
div-sub85.3%
div085.3%
div085.3%
associate-/r*99.9%
distribute-frac-neg99.9%
neg-mul-199.9%
sub-neg99.9%
+-commutative99.9%
neg-sub099.9%
associate-+l-99.9%
sub0-neg99.9%
mul-1-neg99.9%
times-frac99.9%
metadata-eval99.9%
*-lft-identity99.9%
div-sub99.9%
neg-sub099.9%
distribute-frac-neg99.9%
Simplified85.3%
associate-/l/99.9%
div-inv99.8%
Applied egg-rr99.8%
Taylor expanded in z around inf 79.0%
unpow279.0%
Simplified79.0%
if -1.1000000000000001e34 < z < 5.00000000000000003e-42Initial program 89.5%
remove-double-neg89.5%
sub0-neg89.5%
div-sub86.2%
div089.5%
div089.5%
associate-/r*95.0%
distribute-frac-neg95.0%
neg-mul-195.0%
sub-neg95.0%
+-commutative95.0%
neg-sub095.0%
associate-+l-95.0%
sub0-neg95.0%
mul-1-neg95.0%
times-frac95.0%
metadata-eval95.0%
*-lft-identity95.0%
div-sub95.0%
neg-sub095.0%
distribute-frac-neg95.0%
Simplified89.5%
Taylor expanded in z around 0 58.4%
associate-/l/65.1%
div-inv65.0%
Applied egg-rr65.0%
associate-*l/64.2%
un-div-inv64.4%
Applied egg-rr64.4%
if 5.00000000000000003e-42 < z < 6.49999999999999998e58Initial program 99.9%
remove-double-neg99.9%
sub0-neg99.9%
div-sub99.9%
div099.9%
div099.9%
associate-/r*96.3%
distribute-frac-neg96.3%
neg-mul-196.3%
sub-neg96.3%
+-commutative96.3%
neg-sub096.3%
associate-+l-96.3%
sub0-neg96.3%
mul-1-neg96.3%
times-frac96.3%
metadata-eval96.3%
*-lft-identity96.3%
div-sub96.3%
neg-sub096.3%
distribute-frac-neg96.3%
Simplified99.9%
Taylor expanded in y around 0 60.8%
Taylor expanded in z around 0 42.2%
*-commutative42.2%
associate-*r/42.2%
neg-mul-142.2%
Simplified42.2%
Final simplification67.8%
NOTE: y and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= z -3.6e+33) (/ 1.0 (* z (/ z x))) (if (<= z 3.8e+58) (/ x (* t (- y z))) (* (/ x z) (/ 1.0 z)))))
assert(y < t);
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -3.6e+33) {
tmp = 1.0 / (z * (z / x));
} else if (z <= 3.8e+58) {
tmp = x / (t * (y - z));
} else {
tmp = (x / z) * (1.0 / z);
}
return tmp;
}
NOTE: y and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (z <= (-3.6d+33)) then
tmp = 1.0d0 / (z * (z / x))
else if (z <= 3.8d+58) then
tmp = x / (t * (y - z))
else
tmp = (x / z) * (1.0d0 / z)
end if
code = tmp
end function
assert y < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -3.6e+33) {
tmp = 1.0 / (z * (z / x));
} else if (z <= 3.8e+58) {
tmp = x / (t * (y - z));
} else {
tmp = (x / z) * (1.0 / z);
}
return tmp;
}
[y, t] = sort([y, t]) def code(x, y, z, t): tmp = 0 if z <= -3.6e+33: tmp = 1.0 / (z * (z / x)) elif z <= 3.8e+58: tmp = x / (t * (y - z)) else: tmp = (x / z) * (1.0 / z) return tmp
y, t = sort([y, t]) function code(x, y, z, t) tmp = 0.0 if (z <= -3.6e+33) tmp = Float64(1.0 / Float64(z * Float64(z / x))); elseif (z <= 3.8e+58) tmp = Float64(x / Float64(t * Float64(y - z))); else tmp = Float64(Float64(x / z) * Float64(1.0 / z)); end return tmp end
y, t = num2cell(sort([y, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (z <= -3.6e+33)
tmp = 1.0 / (z * (z / x));
elseif (z <= 3.8e+58)
tmp = x / (t * (y - z));
else
tmp = (x / z) * (1.0 / z);
end
tmp_2 = tmp;
end
NOTE: y and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[z, -3.6e+33], N[(1.0 / N[(z * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.8e+58], N[(x / N[(t * N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / z), $MachinePrecision] * N[(1.0 / z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[y, t] = \mathsf{sort}([y, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.6 \cdot 10^{+33}:\\
\;\;\;\;\frac{1}{z \cdot \frac{z}{x}}\\
\mathbf{elif}\;z \leq 3.8 \cdot 10^{+58}:\\
\;\;\;\;\frac{x}{t \cdot \left(y - z\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{z} \cdot \frac{1}{z}\\
\end{array}
\end{array}
if z < -3.6000000000000003e33Initial program 83.9%
remove-double-neg83.9%
sub0-neg83.9%
div-sub83.9%
div083.9%
div083.9%
associate-/r*99.9%
distribute-frac-neg99.9%
neg-mul-199.9%
sub-neg99.9%
+-commutative99.9%
neg-sub099.9%
associate-+l-99.9%
sub0-neg99.9%
mul-1-neg99.9%
times-frac99.9%
metadata-eval99.9%
*-lft-identity99.9%
div-sub99.9%
neg-sub099.9%
distribute-frac-neg99.9%
Simplified83.9%
Taylor expanded in t around 0 77.7%
clear-num77.7%
inv-pow77.7%
metadata-eval77.7%
sqr-pow64.2%
associate-/l*63.5%
div-inv63.5%
clear-num63.5%
metadata-eval63.5%
metadata-eval63.5%
associate-/l*69.3%
div-inv69.3%
clear-num69.3%
metadata-eval69.3%
metadata-eval69.3%
Applied egg-rr69.3%
pow-sqr89.5%
metadata-eval89.5%
unpow-189.5%
Simplified89.5%
Taylor expanded in z around inf 85.1%
if -3.6000000000000003e33 < z < 3.7999999999999999e58Initial program 91.3%
remove-double-neg91.3%
sub0-neg91.3%
div-sub88.6%
div091.3%
div091.3%
associate-/r*95.2%
distribute-frac-neg95.2%
neg-mul-195.2%
sub-neg95.2%
+-commutative95.2%
neg-sub095.2%
associate-+l-95.2%
sub0-neg95.2%
mul-1-neg95.2%
times-frac95.2%
metadata-eval95.2%
*-lft-identity95.2%
div-sub95.2%
neg-sub095.2%
distribute-frac-neg95.2%
Simplified91.3%
associate-/l/95.6%
div-inv95.6%
Applied egg-rr95.6%
Taylor expanded in t around inf 66.8%
associate-*r/66.8%
neg-mul-166.8%
Simplified66.8%
distribute-frac-neg66.8%
neg-sub066.8%
sub-neg66.8%
frac-2neg66.8%
distribute-frac-neg66.8%
remove-double-neg66.8%
distribute-rgt-neg-in66.8%
associate-/r*70.2%
neg-sub070.2%
sub-neg70.2%
+-commutative70.2%
associate--r+70.2%
neg-sub070.2%
remove-double-neg70.2%
Applied egg-rr70.2%
+-lft-identity70.2%
associate-/l/66.8%
*-commutative66.8%
Simplified66.8%
if 3.7999999999999999e58 < z Initial program 86.4%
remove-double-neg86.4%
sub0-neg86.4%
div-sub86.4%
div086.4%
div086.4%
associate-/r*99.9%
distribute-frac-neg99.9%
neg-mul-199.9%
sub-neg99.9%
+-commutative99.9%
neg-sub099.9%
associate-+l-99.9%
sub0-neg99.9%
mul-1-neg99.9%
times-frac99.9%
metadata-eval99.9%
*-lft-identity99.9%
div-sub99.9%
neg-sub099.9%
distribute-frac-neg99.9%
Simplified86.4%
associate-/l/99.9%
div-inv99.9%
Applied egg-rr99.9%
Taylor expanded in z around inf 83.6%
unpow283.6%
Simplified83.6%
associate-/r*93.8%
div-inv93.8%
Applied egg-rr93.8%
Final simplification75.9%
NOTE: y and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= y -7.8e-21) (/ x (* y (- t z))) (if (<= y 3.5e-108) (/ x (* z (- z t))) (/ x (* t (- y z))))))
assert(y < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -7.8e-21) {
tmp = x / (y * (t - z));
} else if (y <= 3.5e-108) {
tmp = x / (z * (z - t));
} else {
tmp = x / (t * (y - z));
}
return tmp;
}
NOTE: y and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= (-7.8d-21)) then
tmp = x / (y * (t - z))
else if (y <= 3.5d-108) then
tmp = x / (z * (z - t))
else
tmp = x / (t * (y - z))
end if
code = tmp
end function
assert y < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -7.8e-21) {
tmp = x / (y * (t - z));
} else if (y <= 3.5e-108) {
tmp = x / (z * (z - t));
} else {
tmp = x / (t * (y - z));
}
return tmp;
}
[y, t] = sort([y, t]) def code(x, y, z, t): tmp = 0 if y <= -7.8e-21: tmp = x / (y * (t - z)) elif y <= 3.5e-108: tmp = x / (z * (z - t)) else: tmp = x / (t * (y - z)) return tmp
y, t = sort([y, t]) function code(x, y, z, t) tmp = 0.0 if (y <= -7.8e-21) tmp = Float64(x / Float64(y * Float64(t - z))); elseif (y <= 3.5e-108) tmp = Float64(x / Float64(z * Float64(z - t))); else tmp = Float64(x / Float64(t * Float64(y - z))); end return tmp end
y, t = num2cell(sort([y, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (y <= -7.8e-21)
tmp = x / (y * (t - z));
elseif (y <= 3.5e-108)
tmp = x / (z * (z - t));
else
tmp = x / (t * (y - z));
end
tmp_2 = tmp;
end
NOTE: y and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[y, -7.8e-21], N[(x / N[(y * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.5e-108], N[(x / N[(z * N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x / N[(t * N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[y, t] = \mathsf{sort}([y, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -7.8 \cdot 10^{-21}:\\
\;\;\;\;\frac{x}{y \cdot \left(t - z\right)}\\
\mathbf{elif}\;y \leq 3.5 \cdot 10^{-108}:\\
\;\;\;\;\frac{x}{z \cdot \left(z - t\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{t \cdot \left(y - z\right)}\\
\end{array}
\end{array}
if y < -7.8000000000000001e-21Initial program 89.4%
remove-double-neg89.4%
sub0-neg89.4%
div-sub89.4%
div089.4%
div089.4%
associate-/r*97.5%
distribute-frac-neg97.5%
neg-mul-197.5%
sub-neg97.5%
+-commutative97.5%
neg-sub097.5%
associate-+l-97.5%
sub0-neg97.5%
mul-1-neg97.5%
times-frac97.5%
metadata-eval97.5%
*-lft-identity97.5%
div-sub97.5%
neg-sub097.5%
distribute-frac-neg97.5%
Simplified89.4%
Taylor expanded in y around inf 82.9%
associate-*r*82.9%
mul-1-neg82.9%
Simplified82.9%
Taylor expanded in z around 0 78.6%
*-commutative78.6%
mul-1-neg78.6%
distribute-lft-neg-out78.6%
distribute-rgt-out82.9%
+-commutative82.9%
sub-neg82.9%
Simplified82.9%
if -7.8000000000000001e-21 < y < 3.4999999999999999e-108Initial program 86.9%
remove-double-neg86.9%
sub0-neg86.9%
div-sub82.6%
div086.9%
div086.9%
associate-/r*96.9%
distribute-frac-neg96.9%
neg-mul-196.9%
sub-neg96.9%
+-commutative96.9%
neg-sub096.9%
associate-+l-96.9%
sub0-neg96.9%
mul-1-neg96.9%
times-frac96.9%
metadata-eval96.9%
*-lft-identity96.9%
div-sub96.9%
neg-sub096.9%
distribute-frac-neg96.9%
Simplified86.9%
Taylor expanded in y around 0 75.2%
if 3.4999999999999999e-108 < y Initial program 91.0%
remove-double-neg91.0%
sub0-neg91.0%
div-sub91.0%
div091.0%
div091.0%
associate-/r*96.9%
distribute-frac-neg96.9%
neg-mul-196.9%
sub-neg96.9%
+-commutative96.9%
neg-sub096.9%
associate-+l-96.9%
sub0-neg96.9%
mul-1-neg96.9%
times-frac96.9%
metadata-eval96.9%
*-lft-identity96.9%
div-sub96.9%
neg-sub096.9%
distribute-frac-neg96.9%
Simplified91.0%
associate-/l/97.4%
div-inv97.2%
Applied egg-rr97.2%
Taylor expanded in t around inf 61.9%
associate-*r/61.9%
neg-mul-161.9%
Simplified61.9%
distribute-frac-neg61.9%
neg-sub061.9%
sub-neg61.9%
frac-2neg61.9%
distribute-frac-neg61.9%
remove-double-neg61.9%
distribute-rgt-neg-in61.9%
associate-/r*65.5%
neg-sub065.5%
sub-neg65.5%
+-commutative65.5%
associate--r+65.5%
neg-sub065.5%
remove-double-neg65.5%
Applied egg-rr65.5%
+-lft-identity65.5%
associate-/l/61.9%
*-commutative61.9%
Simplified61.9%
Final simplification72.9%
NOTE: y and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= y -5.8e-27) (/ x (* y (- t z))) (if (<= y 2.7e-104) (/ x (* z (- z t))) (/ (/ x t) (- y z)))))
assert(y < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -5.8e-27) {
tmp = x / (y * (t - z));
} else if (y <= 2.7e-104) {
tmp = x / (z * (z - t));
} else {
tmp = (x / t) / (y - z);
}
return tmp;
}
NOTE: y and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= (-5.8d-27)) then
tmp = x / (y * (t - z))
else if (y <= 2.7d-104) then
tmp = x / (z * (z - t))
else
tmp = (x / t) / (y - z)
end if
code = tmp
end function
assert y < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -5.8e-27) {
tmp = x / (y * (t - z));
} else if (y <= 2.7e-104) {
tmp = x / (z * (z - t));
} else {
tmp = (x / t) / (y - z);
}
return tmp;
}
[y, t] = sort([y, t]) def code(x, y, z, t): tmp = 0 if y <= -5.8e-27: tmp = x / (y * (t - z)) elif y <= 2.7e-104: tmp = x / (z * (z - t)) else: tmp = (x / t) / (y - z) return tmp
y, t = sort([y, t]) function code(x, y, z, t) tmp = 0.0 if (y <= -5.8e-27) tmp = Float64(x / Float64(y * Float64(t - z))); elseif (y <= 2.7e-104) tmp = Float64(x / Float64(z * Float64(z - t))); else tmp = Float64(Float64(x / t) / Float64(y - z)); end return tmp end
y, t = num2cell(sort([y, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (y <= -5.8e-27)
tmp = x / (y * (t - z));
elseif (y <= 2.7e-104)
tmp = x / (z * (z - t));
else
tmp = (x / t) / (y - z);
end
tmp_2 = tmp;
end
NOTE: y and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[y, -5.8e-27], N[(x / N[(y * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.7e-104], N[(x / N[(z * N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / t), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[y, t] = \mathsf{sort}([y, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -5.8 \cdot 10^{-27}:\\
\;\;\;\;\frac{x}{y \cdot \left(t - z\right)}\\
\mathbf{elif}\;y \leq 2.7 \cdot 10^{-104}:\\
\;\;\;\;\frac{x}{z \cdot \left(z - t\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{t}}{y - z}\\
\end{array}
\end{array}
if y < -5.80000000000000008e-27Initial program 89.4%
remove-double-neg89.4%
sub0-neg89.4%
div-sub89.4%
div089.4%
div089.4%
associate-/r*97.5%
distribute-frac-neg97.5%
neg-mul-197.5%
sub-neg97.5%
+-commutative97.5%
neg-sub097.5%
associate-+l-97.5%
sub0-neg97.5%
mul-1-neg97.5%
times-frac97.5%
metadata-eval97.5%
*-lft-identity97.5%
div-sub97.5%
neg-sub097.5%
distribute-frac-neg97.5%
Simplified89.4%
Taylor expanded in y around inf 82.9%
associate-*r*82.9%
mul-1-neg82.9%
Simplified82.9%
Taylor expanded in z around 0 78.6%
*-commutative78.6%
mul-1-neg78.6%
distribute-lft-neg-out78.6%
distribute-rgt-out82.9%
+-commutative82.9%
sub-neg82.9%
Simplified82.9%
if -5.80000000000000008e-27 < y < 2.6999999999999998e-104Initial program 87.0%
remove-double-neg87.0%
sub0-neg87.0%
div-sub82.8%
div087.0%
div087.0%
associate-/r*96.9%
distribute-frac-neg96.9%
neg-mul-196.9%
sub-neg96.9%
+-commutative96.9%
neg-sub096.9%
associate-+l-96.9%
sub0-neg96.9%
mul-1-neg96.9%
times-frac96.9%
metadata-eval96.9%
*-lft-identity96.9%
div-sub96.9%
neg-sub096.9%
distribute-frac-neg96.9%
Simplified87.0%
Taylor expanded in y around 0 75.4%
if 2.6999999999999998e-104 < y Initial program 90.9%
remove-double-neg90.9%
sub0-neg90.9%
div-sub90.9%
div090.9%
div090.9%
associate-/r*96.9%
distribute-frac-neg96.9%
neg-mul-196.9%
sub-neg96.9%
+-commutative96.9%
neg-sub096.9%
associate-+l-96.9%
sub0-neg96.9%
mul-1-neg96.9%
times-frac96.9%
metadata-eval96.9%
*-lft-identity96.9%
div-sub96.9%
neg-sub096.9%
distribute-frac-neg96.9%
Simplified90.9%
associate-/l/97.4%
div-inv97.2%
Applied egg-rr97.2%
Taylor expanded in t around inf 61.5%
associate-*r/61.5%
neg-mul-161.5%
Simplified61.5%
frac-2neg61.5%
remove-double-neg61.5%
*-rgt-identity61.5%
*-commutative61.5%
distribute-rgt-neg-in61.5%
times-frac67.6%
metadata-eval67.6%
metadata-eval67.6%
frac-2neg67.6%
metadata-eval67.6%
Applied egg-rr67.6%
*-commutative67.6%
frac-times61.5%
neg-mul-161.5%
remove-double-neg61.5%
neg-sub061.5%
associate-+l-61.5%
neg-sub061.5%
+-commutative61.5%
sub-neg61.5%
distribute-rgt-neg-in61.5%
frac-2neg61.5%
Applied egg-rr61.5%
associate-/r*65.1%
Simplified65.1%
Final simplification74.1%
NOTE: y and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= y -2.7e-22) (/ (/ x y) (- t z)) (if (<= y 5.2e-105) (/ x (* z (- z t))) (/ (/ x t) (- y z)))))
assert(y < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -2.7e-22) {
tmp = (x / y) / (t - z);
} else if (y <= 5.2e-105) {
tmp = x / (z * (z - t));
} else {
tmp = (x / t) / (y - z);
}
return tmp;
}
NOTE: y and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= (-2.7d-22)) then
tmp = (x / y) / (t - z)
else if (y <= 5.2d-105) then
tmp = x / (z * (z - t))
else
tmp = (x / t) / (y - z)
end if
code = tmp
end function
assert y < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -2.7e-22) {
tmp = (x / y) / (t - z);
} else if (y <= 5.2e-105) {
tmp = x / (z * (z - t));
} else {
tmp = (x / t) / (y - z);
}
return tmp;
}
[y, t] = sort([y, t]) def code(x, y, z, t): tmp = 0 if y <= -2.7e-22: tmp = (x / y) / (t - z) elif y <= 5.2e-105: tmp = x / (z * (z - t)) else: tmp = (x / t) / (y - z) return tmp
y, t = sort([y, t]) function code(x, y, z, t) tmp = 0.0 if (y <= -2.7e-22) tmp = Float64(Float64(x / y) / Float64(t - z)); elseif (y <= 5.2e-105) tmp = Float64(x / Float64(z * Float64(z - t))); else tmp = Float64(Float64(x / t) / Float64(y - z)); end return tmp end
y, t = num2cell(sort([y, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (y <= -2.7e-22)
tmp = (x / y) / (t - z);
elseif (y <= 5.2e-105)
tmp = x / (z * (z - t));
else
tmp = (x / t) / (y - z);
end
tmp_2 = tmp;
end
NOTE: y and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[y, -2.7e-22], N[(N[(x / y), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 5.2e-105], N[(x / N[(z * N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / t), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[y, t] = \mathsf{sort}([y, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.7 \cdot 10^{-22}:\\
\;\;\;\;\frac{\frac{x}{y}}{t - z}\\
\mathbf{elif}\;y \leq 5.2 \cdot 10^{-105}:\\
\;\;\;\;\frac{x}{z \cdot \left(z - t\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{t}}{y - z}\\
\end{array}
\end{array}
if y < -2.7000000000000002e-22Initial program 89.4%
remove-double-neg89.4%
sub0-neg89.4%
div-sub89.4%
div089.4%
div089.4%
associate-/r*97.5%
distribute-frac-neg97.5%
neg-mul-197.5%
sub-neg97.5%
+-commutative97.5%
neg-sub097.5%
associate-+l-97.5%
sub0-neg97.5%
mul-1-neg97.5%
times-frac97.5%
metadata-eval97.5%
*-lft-identity97.5%
div-sub97.5%
neg-sub097.5%
distribute-frac-neg97.5%
Simplified89.4%
Taylor expanded in y around inf 82.9%
associate-*r*82.9%
mul-1-neg82.9%
Simplified82.9%
div-inv82.8%
distribute-lft-neg-out82.8%
distribute-rgt-neg-in82.8%
associate-/r*84.4%
neg-sub084.4%
sub-neg84.4%
+-commutative84.4%
associate--r+84.4%
neg-sub084.4%
remove-double-neg84.4%
Applied egg-rr84.4%
associate-*r/85.7%
associate-*r/85.7%
*-rgt-identity85.7%
Simplified85.7%
if -2.7000000000000002e-22 < y < 5.1999999999999997e-105Initial program 87.0%
remove-double-neg87.0%
sub0-neg87.0%
div-sub82.8%
div087.0%
div087.0%
associate-/r*96.9%
distribute-frac-neg96.9%
neg-mul-196.9%
sub-neg96.9%
+-commutative96.9%
neg-sub096.9%
associate-+l-96.9%
sub0-neg96.9%
mul-1-neg96.9%
times-frac96.9%
metadata-eval96.9%
*-lft-identity96.9%
div-sub96.9%
neg-sub096.9%
distribute-frac-neg96.9%
Simplified87.0%
Taylor expanded in y around 0 75.4%
if 5.1999999999999997e-105 < y Initial program 90.9%
remove-double-neg90.9%
sub0-neg90.9%
div-sub90.9%
div090.9%
div090.9%
associate-/r*96.9%
distribute-frac-neg96.9%
neg-mul-196.9%
sub-neg96.9%
+-commutative96.9%
neg-sub096.9%
associate-+l-96.9%
sub0-neg96.9%
mul-1-neg96.9%
times-frac96.9%
metadata-eval96.9%
*-lft-identity96.9%
div-sub96.9%
neg-sub096.9%
distribute-frac-neg96.9%
Simplified90.9%
associate-/l/97.4%
div-inv97.2%
Applied egg-rr97.2%
Taylor expanded in t around inf 61.5%
associate-*r/61.5%
neg-mul-161.5%
Simplified61.5%
frac-2neg61.5%
remove-double-neg61.5%
*-rgt-identity61.5%
*-commutative61.5%
distribute-rgt-neg-in61.5%
times-frac67.6%
metadata-eval67.6%
metadata-eval67.6%
frac-2neg67.6%
metadata-eval67.6%
Applied egg-rr67.6%
*-commutative67.6%
frac-times61.5%
neg-mul-161.5%
remove-double-neg61.5%
neg-sub061.5%
associate-+l-61.5%
neg-sub061.5%
+-commutative61.5%
sub-neg61.5%
distribute-rgt-neg-in61.5%
frac-2neg61.5%
Applied egg-rr61.5%
associate-/r*65.1%
Simplified65.1%
Final simplification74.9%
NOTE: y and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= y -4.2e+33) (/ (/ x y) (- t z)) (if (<= y 6.8e-107) (/ (/ x z) (- z t)) (/ (/ x t) (- y z)))))
assert(y < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -4.2e+33) {
tmp = (x / y) / (t - z);
} else if (y <= 6.8e-107) {
tmp = (x / z) / (z - t);
} else {
tmp = (x / t) / (y - z);
}
return tmp;
}
NOTE: y and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= (-4.2d+33)) then
tmp = (x / y) / (t - z)
else if (y <= 6.8d-107) then
tmp = (x / z) / (z - t)
else
tmp = (x / t) / (y - z)
end if
code = tmp
end function
assert y < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -4.2e+33) {
tmp = (x / y) / (t - z);
} else if (y <= 6.8e-107) {
tmp = (x / z) / (z - t);
} else {
tmp = (x / t) / (y - z);
}
return tmp;
}
[y, t] = sort([y, t]) def code(x, y, z, t): tmp = 0 if y <= -4.2e+33: tmp = (x / y) / (t - z) elif y <= 6.8e-107: tmp = (x / z) / (z - t) else: tmp = (x / t) / (y - z) return tmp
y, t = sort([y, t]) function code(x, y, z, t) tmp = 0.0 if (y <= -4.2e+33) tmp = Float64(Float64(x / y) / Float64(t - z)); elseif (y <= 6.8e-107) tmp = Float64(Float64(x / z) / Float64(z - t)); else tmp = Float64(Float64(x / t) / Float64(y - z)); end return tmp end
y, t = num2cell(sort([y, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (y <= -4.2e+33)
tmp = (x / y) / (t - z);
elseif (y <= 6.8e-107)
tmp = (x / z) / (z - t);
else
tmp = (x / t) / (y - z);
end
tmp_2 = tmp;
end
NOTE: y and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[y, -4.2e+33], N[(N[(x / y), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 6.8e-107], N[(N[(x / z), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision], N[(N[(x / t), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[y, t] = \mathsf{sort}([y, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.2 \cdot 10^{+33}:\\
\;\;\;\;\frac{\frac{x}{y}}{t - z}\\
\mathbf{elif}\;y \leq 6.8 \cdot 10^{-107}:\\
\;\;\;\;\frac{\frac{x}{z}}{z - t}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{t}}{y - z}\\
\end{array}
\end{array}
if y < -4.2000000000000001e33Initial program 89.1%
remove-double-neg89.1%
sub0-neg89.1%
div-sub89.1%
div089.1%
div089.1%
associate-/r*97.0%
distribute-frac-neg97.0%
neg-mul-197.0%
sub-neg97.0%
+-commutative97.0%
neg-sub097.0%
associate-+l-97.0%
sub0-neg97.0%
mul-1-neg97.0%
times-frac97.0%
metadata-eval97.0%
*-lft-identity97.0%
div-sub97.0%
neg-sub097.0%
distribute-frac-neg97.0%
Simplified89.1%
Taylor expanded in y around inf 87.5%
associate-*r*87.5%
mul-1-neg87.5%
Simplified87.5%
div-inv87.5%
distribute-lft-neg-out87.5%
distribute-rgt-neg-in87.5%
associate-/r*89.5%
neg-sub089.5%
sub-neg89.5%
+-commutative89.5%
associate--r+89.5%
neg-sub089.5%
remove-double-neg89.5%
Applied egg-rr89.5%
associate-*r/90.8%
associate-*r/90.8%
*-rgt-identity90.8%
Simplified90.8%
if -4.2000000000000001e33 < y < 6.79999999999999989e-107Initial program 87.3%
remove-double-neg87.3%
sub0-neg87.3%
div-sub83.4%
div087.3%
div087.3%
associate-/r*97.2%
distribute-frac-neg97.2%
neg-mul-197.2%
sub-neg97.2%
+-commutative97.2%
neg-sub097.2%
associate-+l-97.2%
sub0-neg97.2%
mul-1-neg97.2%
times-frac97.2%
metadata-eval97.2%
*-lft-identity97.2%
div-sub97.2%
neg-sub097.2%
distribute-frac-neg97.2%
Simplified87.3%
Taylor expanded in y around 0 72.4%
frac-2neg72.4%
distribute-frac-neg72.4%
neg-sub072.4%
sub-neg72.4%
distribute-frac-neg72.4%
frac-2neg72.4%
associate-/r*81.6%
Applied egg-rr81.6%
+-lft-identity81.6%
Simplified81.6%
if 6.79999999999999989e-107 < y Initial program 91.0%
remove-double-neg91.0%
sub0-neg91.0%
div-sub91.0%
div091.0%
div091.0%
associate-/r*96.9%
distribute-frac-neg96.9%
neg-mul-196.9%
sub-neg96.9%
+-commutative96.9%
neg-sub096.9%
associate-+l-96.9%
sub0-neg96.9%
mul-1-neg96.9%
times-frac96.9%
metadata-eval96.9%
*-lft-identity96.9%
div-sub96.9%
neg-sub096.9%
distribute-frac-neg96.9%
Simplified91.0%
associate-/l/97.4%
div-inv97.2%
Applied egg-rr97.2%
Taylor expanded in t around inf 61.9%
associate-*r/61.9%
neg-mul-161.9%
Simplified61.9%
frac-2neg61.9%
remove-double-neg61.9%
*-rgt-identity61.9%
*-commutative61.9%
distribute-rgt-neg-in61.9%
times-frac68.0%
metadata-eval68.0%
metadata-eval68.0%
frac-2neg68.0%
metadata-eval68.0%
Applied egg-rr68.0%
*-commutative68.0%
frac-times61.9%
neg-mul-161.9%
remove-double-neg61.9%
neg-sub061.9%
associate-+l-61.9%
neg-sub061.9%
+-commutative61.9%
sub-neg61.9%
distribute-rgt-neg-in61.9%
frac-2neg61.9%
Applied egg-rr61.9%
associate-/r*65.5%
Simplified65.5%
Final simplification78.4%
NOTE: y and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= y -2.06e+33) (/ (/ x (- t z)) y) (if (<= y 9.8e-107) (/ (/ x z) (- z t)) (/ (/ x t) (- y z)))))
assert(y < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -2.06e+33) {
tmp = (x / (t - z)) / y;
} else if (y <= 9.8e-107) {
tmp = (x / z) / (z - t);
} else {
tmp = (x / t) / (y - z);
}
return tmp;
}
NOTE: y and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= (-2.06d+33)) then
tmp = (x / (t - z)) / y
else if (y <= 9.8d-107) then
tmp = (x / z) / (z - t)
else
tmp = (x / t) / (y - z)
end if
code = tmp
end function
assert y < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -2.06e+33) {
tmp = (x / (t - z)) / y;
} else if (y <= 9.8e-107) {
tmp = (x / z) / (z - t);
} else {
tmp = (x / t) / (y - z);
}
return tmp;
}
[y, t] = sort([y, t]) def code(x, y, z, t): tmp = 0 if y <= -2.06e+33: tmp = (x / (t - z)) / y elif y <= 9.8e-107: tmp = (x / z) / (z - t) else: tmp = (x / t) / (y - z) return tmp
y, t = sort([y, t]) function code(x, y, z, t) tmp = 0.0 if (y <= -2.06e+33) tmp = Float64(Float64(x / Float64(t - z)) / y); elseif (y <= 9.8e-107) tmp = Float64(Float64(x / z) / Float64(z - t)); else tmp = Float64(Float64(x / t) / Float64(y - z)); end return tmp end
y, t = num2cell(sort([y, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (y <= -2.06e+33)
tmp = (x / (t - z)) / y;
elseif (y <= 9.8e-107)
tmp = (x / z) / (z - t);
else
tmp = (x / t) / (y - z);
end
tmp_2 = tmp;
end
NOTE: y and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[y, -2.06e+33], N[(N[(x / N[(t - z), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision], If[LessEqual[y, 9.8e-107], N[(N[(x / z), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision], N[(N[(x / t), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[y, t] = \mathsf{sort}([y, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.06 \cdot 10^{+33}:\\
\;\;\;\;\frac{\frac{x}{t - z}}{y}\\
\mathbf{elif}\;y \leq 9.8 \cdot 10^{-107}:\\
\;\;\;\;\frac{\frac{x}{z}}{z - t}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{t}}{y - z}\\
\end{array}
\end{array}
if y < -2.05999999999999993e33Initial program 89.1%
remove-double-neg89.1%
sub0-neg89.1%
div-sub89.1%
div089.1%
div089.1%
associate-/r*97.0%
distribute-frac-neg97.0%
neg-mul-197.0%
sub-neg97.0%
+-commutative97.0%
neg-sub097.0%
associate-+l-97.0%
sub0-neg97.0%
mul-1-neg97.0%
times-frac97.0%
metadata-eval97.0%
*-lft-identity97.0%
div-sub97.0%
neg-sub097.0%
distribute-frac-neg97.0%
Simplified89.1%
Taylor expanded in y around inf 87.5%
associate-*r*87.5%
mul-1-neg87.5%
Simplified87.5%
div-inv87.5%
distribute-lft-neg-out87.5%
distribute-rgt-neg-in87.5%
associate-/r*89.5%
neg-sub089.5%
sub-neg89.5%
+-commutative89.5%
associate--r+89.5%
neg-sub089.5%
remove-double-neg89.5%
Applied egg-rr89.5%
associate-*r/90.8%
associate-*r/90.8%
*-rgt-identity90.8%
Simplified90.8%
div-inv90.8%
div-inv90.8%
associate-*l*89.4%
un-div-inv89.5%
Applied egg-rr89.5%
associate-*r/90.8%
associate-*l/92.1%
associate-*r/92.1%
*-rgt-identity92.1%
Simplified92.1%
if -2.05999999999999993e33 < y < 9.79999999999999959e-107Initial program 87.3%
remove-double-neg87.3%
sub0-neg87.3%
div-sub83.4%
div087.3%
div087.3%
associate-/r*97.2%
distribute-frac-neg97.2%
neg-mul-197.2%
sub-neg97.2%
+-commutative97.2%
neg-sub097.2%
associate-+l-97.2%
sub0-neg97.2%
mul-1-neg97.2%
times-frac97.2%
metadata-eval97.2%
*-lft-identity97.2%
div-sub97.2%
neg-sub097.2%
distribute-frac-neg97.2%
Simplified87.3%
Taylor expanded in y around 0 72.4%
frac-2neg72.4%
distribute-frac-neg72.4%
neg-sub072.4%
sub-neg72.4%
distribute-frac-neg72.4%
frac-2neg72.4%
associate-/r*81.6%
Applied egg-rr81.6%
+-lft-identity81.6%
Simplified81.6%
if 9.79999999999999959e-107 < y Initial program 91.0%
remove-double-neg91.0%
sub0-neg91.0%
div-sub91.0%
div091.0%
div091.0%
associate-/r*96.9%
distribute-frac-neg96.9%
neg-mul-196.9%
sub-neg96.9%
+-commutative96.9%
neg-sub096.9%
associate-+l-96.9%
sub0-neg96.9%
mul-1-neg96.9%
times-frac96.9%
metadata-eval96.9%
*-lft-identity96.9%
div-sub96.9%
neg-sub096.9%
distribute-frac-neg96.9%
Simplified91.0%
associate-/l/97.4%
div-inv97.2%
Applied egg-rr97.2%
Taylor expanded in t around inf 61.9%
associate-*r/61.9%
neg-mul-161.9%
Simplified61.9%
frac-2neg61.9%
remove-double-neg61.9%
*-rgt-identity61.9%
*-commutative61.9%
distribute-rgt-neg-in61.9%
times-frac68.0%
metadata-eval68.0%
metadata-eval68.0%
frac-2neg68.0%
metadata-eval68.0%
Applied egg-rr68.0%
*-commutative68.0%
frac-times61.9%
neg-mul-161.9%
remove-double-neg61.9%
neg-sub061.9%
associate-+l-61.9%
neg-sub061.9%
+-commutative61.9%
sub-neg61.9%
distribute-rgt-neg-in61.9%
frac-2neg61.9%
Applied egg-rr61.9%
associate-/r*65.5%
Simplified65.5%
Final simplification78.7%
NOTE: y and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (or (<= z -7e+33) (not (<= z 6.8e+55))) (/ x (* z z)) (/ x (* t y))))
assert(y < t);
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -7e+33) || !(z <= 6.8e+55)) {
tmp = x / (z * z);
} else {
tmp = x / (t * y);
}
return tmp;
}
NOTE: y and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((z <= (-7d+33)) .or. (.not. (z <= 6.8d+55))) then
tmp = x / (z * z)
else
tmp = x / (t * y)
end if
code = tmp
end function
assert y < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -7e+33) || !(z <= 6.8e+55)) {
tmp = x / (z * z);
} else {
tmp = x / (t * y);
}
return tmp;
}
[y, t] = sort([y, t]) def code(x, y, z, t): tmp = 0 if (z <= -7e+33) or not (z <= 6.8e+55): tmp = x / (z * z) else: tmp = x / (t * y) return tmp
y, t = sort([y, t]) function code(x, y, z, t) tmp = 0.0 if ((z <= -7e+33) || !(z <= 6.8e+55)) tmp = Float64(x / Float64(z * z)); else tmp = Float64(x / Float64(t * y)); end return tmp end
y, t = num2cell(sort([y, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if ((z <= -7e+33) || ~((z <= 6.8e+55)))
tmp = x / (z * z);
else
tmp = x / (t * y);
end
tmp_2 = tmp;
end
NOTE: y and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[Or[LessEqual[z, -7e+33], N[Not[LessEqual[z, 6.8e+55]], $MachinePrecision]], N[(x / N[(z * z), $MachinePrecision]), $MachinePrecision], N[(x / N[(t * y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[y, t] = \mathsf{sort}([y, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -7 \cdot 10^{+33} \lor \neg \left(z \leq 6.8 \cdot 10^{+55}\right):\\
\;\;\;\;\frac{x}{z \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{t \cdot y}\\
\end{array}
\end{array}
if z < -7.0000000000000002e33 or 6.7999999999999996e55 < z Initial program 85.4%
remove-double-neg85.4%
sub0-neg85.4%
div-sub85.4%
div085.4%
div085.4%
associate-/r*99.9%
distribute-frac-neg99.9%
neg-mul-199.9%
sub-neg99.9%
+-commutative99.9%
neg-sub099.9%
associate-+l-99.9%
sub0-neg99.9%
mul-1-neg99.9%
times-frac99.9%
metadata-eval99.9%
*-lft-identity99.9%
div-sub99.9%
neg-sub099.9%
distribute-frac-neg99.9%
Simplified85.4%
associate-/l/99.9%
div-inv99.8%
Applied egg-rr99.8%
Taylor expanded in z around inf 78.3%
unpow278.3%
Simplified78.3%
if -7.0000000000000002e33 < z < 6.7999999999999996e55Initial program 91.3%
remove-double-neg91.3%
sub0-neg91.3%
div-sub88.5%
div091.3%
div091.3%
associate-/r*95.2%
distribute-frac-neg95.2%
neg-mul-195.2%
sub-neg95.2%
+-commutative95.2%
neg-sub095.2%
associate-+l-95.2%
sub0-neg95.2%
mul-1-neg95.2%
times-frac95.2%
metadata-eval95.2%
*-lft-identity95.2%
div-sub95.2%
neg-sub095.2%
distribute-frac-neg95.2%
Simplified91.3%
Taylor expanded in z around 0 53.3%
Final simplification63.2%
NOTE: y and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (or (<= z -3.9e+33) (not (<= z 6.8e+55))) (/ x (* z z)) (/ (/ x t) y)))
assert(y < t);
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -3.9e+33) || !(z <= 6.8e+55)) {
tmp = x / (z * z);
} else {
tmp = (x / t) / y;
}
return tmp;
}
NOTE: y and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((z <= (-3.9d+33)) .or. (.not. (z <= 6.8d+55))) then
tmp = x / (z * z)
else
tmp = (x / t) / y
end if
code = tmp
end function
assert y < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -3.9e+33) || !(z <= 6.8e+55)) {
tmp = x / (z * z);
} else {
tmp = (x / t) / y;
}
return tmp;
}
[y, t] = sort([y, t]) def code(x, y, z, t): tmp = 0 if (z <= -3.9e+33) or not (z <= 6.8e+55): tmp = x / (z * z) else: tmp = (x / t) / y return tmp
y, t = sort([y, t]) function code(x, y, z, t) tmp = 0.0 if ((z <= -3.9e+33) || !(z <= 6.8e+55)) tmp = Float64(x / Float64(z * z)); else tmp = Float64(Float64(x / t) / y); end return tmp end
y, t = num2cell(sort([y, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if ((z <= -3.9e+33) || ~((z <= 6.8e+55)))
tmp = x / (z * z);
else
tmp = (x / t) / y;
end
tmp_2 = tmp;
end
NOTE: y and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[Or[LessEqual[z, -3.9e+33], N[Not[LessEqual[z, 6.8e+55]], $MachinePrecision]], N[(x / N[(z * z), $MachinePrecision]), $MachinePrecision], N[(N[(x / t), $MachinePrecision] / y), $MachinePrecision]]
\begin{array}{l}
[y, t] = \mathsf{sort}([y, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.9 \cdot 10^{+33} \lor \neg \left(z \leq 6.8 \cdot 10^{+55}\right):\\
\;\;\;\;\frac{x}{z \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{t}}{y}\\
\end{array}
\end{array}
if z < -3.9000000000000002e33 or 6.7999999999999996e55 < z Initial program 85.4%
remove-double-neg85.4%
sub0-neg85.4%
div-sub85.4%
div085.4%
div085.4%
associate-/r*99.9%
distribute-frac-neg99.9%
neg-mul-199.9%
sub-neg99.9%
+-commutative99.9%
neg-sub099.9%
associate-+l-99.9%
sub0-neg99.9%
mul-1-neg99.9%
times-frac99.9%
metadata-eval99.9%
*-lft-identity99.9%
div-sub99.9%
neg-sub099.9%
distribute-frac-neg99.9%
Simplified85.4%
associate-/l/99.9%
div-inv99.8%
Applied egg-rr99.8%
Taylor expanded in z around inf 78.3%
unpow278.3%
Simplified78.3%
if -3.9000000000000002e33 < z < 6.7999999999999996e55Initial program 91.3%
remove-double-neg91.3%
sub0-neg91.3%
div-sub88.5%
div091.3%
div091.3%
associate-/r*95.2%
distribute-frac-neg95.2%
neg-mul-195.2%
sub-neg95.2%
+-commutative95.2%
neg-sub095.2%
associate-+l-95.2%
sub0-neg95.2%
mul-1-neg95.2%
times-frac95.2%
metadata-eval95.2%
*-lft-identity95.2%
div-sub95.2%
neg-sub095.2%
distribute-frac-neg95.2%
Simplified91.3%
Taylor expanded in z around 0 53.3%
associate-/l/58.9%
div-inv58.8%
Applied egg-rr58.8%
associate-*l/60.0%
un-div-inv60.1%
Applied egg-rr60.1%
Final simplification67.4%
NOTE: y and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (/ x (* t y)))
assert(y < t);
double code(double x, double y, double z, double t) {
return x / (t * y);
}
NOTE: y and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = x / (t * y)
end function
assert y < t;
public static double code(double x, double y, double z, double t) {
return x / (t * y);
}
[y, t] = sort([y, t]) def code(x, y, z, t): return x / (t * y)
y, t = sort([y, t]) function code(x, y, z, t) return Float64(x / Float64(t * y)) end
y, t = num2cell(sort([y, t])){:}
function tmp = code(x, y, z, t)
tmp = x / (t * y);
end
NOTE: y 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}
[y, t] = \mathsf{sort}([y, t])\\
\\
\frac{x}{t \cdot y}
\end{array}
Initial program 88.9%
remove-double-neg88.9%
sub0-neg88.9%
div-sub87.3%
div088.9%
div088.9%
associate-/r*97.1%
distribute-frac-neg97.1%
neg-mul-197.1%
sub-neg97.1%
+-commutative97.1%
neg-sub097.1%
associate-+l-97.1%
sub0-neg97.1%
mul-1-neg97.1%
times-frac97.1%
metadata-eval97.1%
*-lft-identity97.1%
div-sub97.1%
neg-sub097.1%
distribute-frac-neg97.1%
Simplified88.9%
Taylor expanded in z around 0 40.7%
Final simplification40.7%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (* (- y z) (- t z)))) (if (< (/ x t_1) 0.0) (/ (/ x (- y z)) (- t z)) (* x (/ 1.0 t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = (y - z) * (t - z);
double tmp;
if ((x / t_1) < 0.0) {
tmp = (x / (y - z)) / (t - z);
} else {
tmp = x * (1.0 / t_1);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = (y - z) * (t - z)
if ((x / t_1) < 0.0d0) then
tmp = (x / (y - z)) / (t - z)
else
tmp = x * (1.0d0 / t_1)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (y - z) * (t - z);
double tmp;
if ((x / t_1) < 0.0) {
tmp = (x / (y - z)) / (t - z);
} else {
tmp = x * (1.0 / t_1);
}
return tmp;
}
def code(x, y, z, t): t_1 = (y - z) * (t - z) tmp = 0 if (x / t_1) < 0.0: tmp = (x / (y - z)) / (t - z) else: tmp = x * (1.0 / t_1) return tmp
function code(x, y, z, t) t_1 = Float64(Float64(y - z) * Float64(t - z)) tmp = 0.0 if (Float64(x / t_1) < 0.0) tmp = Float64(Float64(x / Float64(y - z)) / Float64(t - z)); else tmp = Float64(x * Float64(1.0 / t_1)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (y - z) * (t - z); tmp = 0.0; if ((x / t_1) < 0.0) tmp = (x / (y - z)) / (t - z); else tmp = x * (1.0 / t_1); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(y - z), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision]}, If[Less[N[(x / t$95$1), $MachinePrecision], 0.0], N[(N[(x / N[(y - z), $MachinePrecision]), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], N[(x * N[(1.0 / t$95$1), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(y - z\right) \cdot \left(t - z\right)\\
\mathbf{if}\;\frac{x}{t_1} < 0:\\
\;\;\;\;\frac{\frac{x}{y - z}}{t - z}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{1}{t_1}\\
\end{array}
\end{array}
herbie shell --seed 2023297
(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))))