
(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 16 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 (- t z)) (- y z)))
assert(y < t);
double code(double x, double y, double z, double t) {
return (x / (t - z)) / (y - z);
}
NOTE: y and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (x / (t - z)) / (y - z)
end function
assert y < t;
public static double code(double x, double y, double z, double t) {
return (x / (t - z)) / (y - z);
}
[y, t] = sort([y, t]) def code(x, y, z, t): return (x / (t - z)) / (y - z)
y, t = sort([y, t]) function code(x, y, z, t) return Float64(Float64(x / Float64(t - z)) / Float64(y - z)) end
y, t = num2cell(sort([y, t])){:}
function tmp = code(x, y, z, t)
tmp = (x / (t - z)) / (y - z);
end
NOTE: y and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := N[(N[(x / N[(t - z), $MachinePrecision]), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[y, t] = \mathsf{sort}([y, t])\\
\\
\frac{\frac{x}{t - z}}{y - z}
\end{array}
Initial program 91.6%
associate-/l/97.1%
Simplified97.1%
Final simplification97.1%
NOTE: y and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ (/ x z) z)) (t_2 (/ (- x) (* t z))))
(if (<= z -5.8e+65)
t_1
(if (<= z -9e-47)
t_2
(if (<= z -5.8e-54)
t_1
(if (<= z -2.1e-92)
(/ (- x) (* z y))
(if (<= z 2.4e-13) (/ (/ x t) y) (if (<= z 2.7e+102) t_2 t_1))))))))assert(y < t);
double code(double x, double y, double z, double t) {
double t_1 = (x / z) / z;
double t_2 = -x / (t * z);
double tmp;
if (z <= -5.8e+65) {
tmp = t_1;
} else if (z <= -9e-47) {
tmp = t_2;
} else if (z <= -5.8e-54) {
tmp = t_1;
} else if (z <= -2.1e-92) {
tmp = -x / (z * y);
} else if (z <= 2.4e-13) {
tmp = (x / t) / y;
} else if (z <= 2.7e+102) {
tmp = t_2;
} 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) :: t_2
real(8) :: tmp
t_1 = (x / z) / z
t_2 = -x / (t * z)
if (z <= (-5.8d+65)) then
tmp = t_1
else if (z <= (-9d-47)) then
tmp = t_2
else if (z <= (-5.8d-54)) then
tmp = t_1
else if (z <= (-2.1d-92)) then
tmp = -x / (z * y)
else if (z <= 2.4d-13) then
tmp = (x / t) / y
else if (z <= 2.7d+102) then
tmp = t_2
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 t_2 = -x / (t * z);
double tmp;
if (z <= -5.8e+65) {
tmp = t_1;
} else if (z <= -9e-47) {
tmp = t_2;
} else if (z <= -5.8e-54) {
tmp = t_1;
} else if (z <= -2.1e-92) {
tmp = -x / (z * y);
} else if (z <= 2.4e-13) {
tmp = (x / t) / y;
} else if (z <= 2.7e+102) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
[y, t] = sort([y, t]) def code(x, y, z, t): t_1 = (x / z) / z t_2 = -x / (t * z) tmp = 0 if z <= -5.8e+65: tmp = t_1 elif z <= -9e-47: tmp = t_2 elif z <= -5.8e-54: tmp = t_1 elif z <= -2.1e-92: tmp = -x / (z * y) elif z <= 2.4e-13: tmp = (x / t) / y elif z <= 2.7e+102: tmp = t_2 else: tmp = t_1 return tmp
y, t = sort([y, t]) function code(x, y, z, t) t_1 = Float64(Float64(x / z) / z) t_2 = Float64(Float64(-x) / Float64(t * z)) tmp = 0.0 if (z <= -5.8e+65) tmp = t_1; elseif (z <= -9e-47) tmp = t_2; elseif (z <= -5.8e-54) tmp = t_1; elseif (z <= -2.1e-92) tmp = Float64(Float64(-x) / Float64(z * y)); elseif (z <= 2.4e-13) tmp = Float64(Float64(x / t) / y); elseif (z <= 2.7e+102) tmp = t_2; 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;
t_2 = -x / (t * z);
tmp = 0.0;
if (z <= -5.8e+65)
tmp = t_1;
elseif (z <= -9e-47)
tmp = t_2;
elseif (z <= -5.8e-54)
tmp = t_1;
elseif (z <= -2.1e-92)
tmp = -x / (z * y);
elseif (z <= 2.4e-13)
tmp = (x / t) / y;
elseif (z <= 2.7e+102)
tmp = t_2;
else
tmp = t_1;
end
tmp_2 = tmp;
end
NOTE: y and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x / z), $MachinePrecision] / z), $MachinePrecision]}, Block[{t$95$2 = N[((-x) / N[(t * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -5.8e+65], t$95$1, If[LessEqual[z, -9e-47], t$95$2, If[LessEqual[z, -5.8e-54], t$95$1, If[LessEqual[z, -2.1e-92], N[((-x) / N[(z * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.4e-13], N[(N[(x / t), $MachinePrecision] / y), $MachinePrecision], If[LessEqual[z, 2.7e+102], t$95$2, t$95$1]]]]]]]]
\begin{array}{l}
[y, t] = \mathsf{sort}([y, t])\\
\\
\begin{array}{l}
t_1 := \frac{\frac{x}{z}}{z}\\
t_2 := \frac{-x}{t \cdot z}\\
\mathbf{if}\;z \leq -5.8 \cdot 10^{+65}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -9 \cdot 10^{-47}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq -5.8 \cdot 10^{-54}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -2.1 \cdot 10^{-92}:\\
\;\;\;\;\frac{-x}{z \cdot y}\\
\mathbf{elif}\;z \leq 2.4 \cdot 10^{-13}:\\
\;\;\;\;\frac{\frac{x}{t}}{y}\\
\mathbf{elif}\;z \leq 2.7 \cdot 10^{+102}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -5.8000000000000001e65 or -9e-47 < z < -5.80000000000000029e-54 or 2.7000000000000001e102 < z Initial program 83.9%
Taylor expanded in z around inf 76.2%
unpow276.2%
associate-/r*83.0%
Simplified83.0%
if -5.8000000000000001e65 < z < -9e-47 or 2.3999999999999999e-13 < z < 2.7000000000000001e102Initial program 95.7%
associate-/l/99.6%
div-inv99.5%
Applied egg-rr99.5%
*-commutative99.5%
clear-num99.3%
un-div-inv99.4%
Applied egg-rr99.4%
Taylor expanded in y around 0 62.5%
Taylor expanded in z around 0 47.4%
associate-*r/47.4%
neg-mul-147.4%
*-commutative47.4%
Simplified47.4%
if -5.80000000000000029e-54 < z < -2.1e-92Initial program 100.0%
Taylor expanded in y around inf 76.3%
*-commutative76.3%
Simplified76.3%
Taylor expanded in t around 0 38.8%
associate-*r/38.8%
neg-mul-138.8%
Simplified38.8%
if -2.1e-92 < z < 2.3999999999999999e-13Initial program 96.7%
Taylor expanded in y around inf 83.3%
*-commutative83.3%
associate-/r*82.4%
Simplified82.4%
Taylor expanded in t around inf 74.8%
Final simplification71.9%
NOTE: y and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ (/ x z) z)) (t_2 (/ (- x) (* t z))))
(if (<= z -4.1e+65)
t_1
(if (<= z -1.4e-42)
t_2
(if (<= z -4.3e-54)
(* (/ x z) (/ 1.0 z))
(if (<= z -2.1e-92)
(/ (- x) (* z y))
(if (<= z 2.15e-13)
(/ (/ x t) y)
(if (<= z 2.7e+102) t_2 t_1))))))))assert(y < t);
double code(double x, double y, double z, double t) {
double t_1 = (x / z) / z;
double t_2 = -x / (t * z);
double tmp;
if (z <= -4.1e+65) {
tmp = t_1;
} else if (z <= -1.4e-42) {
tmp = t_2;
} else if (z <= -4.3e-54) {
tmp = (x / z) * (1.0 / z);
} else if (z <= -2.1e-92) {
tmp = -x / (z * y);
} else if (z <= 2.15e-13) {
tmp = (x / t) / y;
} else if (z <= 2.7e+102) {
tmp = t_2;
} 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) :: t_2
real(8) :: tmp
t_1 = (x / z) / z
t_2 = -x / (t * z)
if (z <= (-4.1d+65)) then
tmp = t_1
else if (z <= (-1.4d-42)) then
tmp = t_2
else if (z <= (-4.3d-54)) then
tmp = (x / z) * (1.0d0 / z)
else if (z <= (-2.1d-92)) then
tmp = -x / (z * y)
else if (z <= 2.15d-13) then
tmp = (x / t) / y
else if (z <= 2.7d+102) then
tmp = t_2
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 t_2 = -x / (t * z);
double tmp;
if (z <= -4.1e+65) {
tmp = t_1;
} else if (z <= -1.4e-42) {
tmp = t_2;
} else if (z <= -4.3e-54) {
tmp = (x / z) * (1.0 / z);
} else if (z <= -2.1e-92) {
tmp = -x / (z * y);
} else if (z <= 2.15e-13) {
tmp = (x / t) / y;
} else if (z <= 2.7e+102) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
[y, t] = sort([y, t]) def code(x, y, z, t): t_1 = (x / z) / z t_2 = -x / (t * z) tmp = 0 if z <= -4.1e+65: tmp = t_1 elif z <= -1.4e-42: tmp = t_2 elif z <= -4.3e-54: tmp = (x / z) * (1.0 / z) elif z <= -2.1e-92: tmp = -x / (z * y) elif z <= 2.15e-13: tmp = (x / t) / y elif z <= 2.7e+102: tmp = t_2 else: tmp = t_1 return tmp
y, t = sort([y, t]) function code(x, y, z, t) t_1 = Float64(Float64(x / z) / z) t_2 = Float64(Float64(-x) / Float64(t * z)) tmp = 0.0 if (z <= -4.1e+65) tmp = t_1; elseif (z <= -1.4e-42) tmp = t_2; elseif (z <= -4.3e-54) tmp = Float64(Float64(x / z) * Float64(1.0 / z)); elseif (z <= -2.1e-92) tmp = Float64(Float64(-x) / Float64(z * y)); elseif (z <= 2.15e-13) tmp = Float64(Float64(x / t) / y); elseif (z <= 2.7e+102) tmp = t_2; 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;
t_2 = -x / (t * z);
tmp = 0.0;
if (z <= -4.1e+65)
tmp = t_1;
elseif (z <= -1.4e-42)
tmp = t_2;
elseif (z <= -4.3e-54)
tmp = (x / z) * (1.0 / z);
elseif (z <= -2.1e-92)
tmp = -x / (z * y);
elseif (z <= 2.15e-13)
tmp = (x / t) / y;
elseif (z <= 2.7e+102)
tmp = t_2;
else
tmp = t_1;
end
tmp_2 = tmp;
end
NOTE: y and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x / z), $MachinePrecision] / z), $MachinePrecision]}, Block[{t$95$2 = N[((-x) / N[(t * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -4.1e+65], t$95$1, If[LessEqual[z, -1.4e-42], t$95$2, If[LessEqual[z, -4.3e-54], N[(N[(x / z), $MachinePrecision] * N[(1.0 / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -2.1e-92], N[((-x) / N[(z * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.15e-13], N[(N[(x / t), $MachinePrecision] / y), $MachinePrecision], If[LessEqual[z, 2.7e+102], t$95$2, t$95$1]]]]]]]]
\begin{array}{l}
[y, t] = \mathsf{sort}([y, t])\\
\\
\begin{array}{l}
t_1 := \frac{\frac{x}{z}}{z}\\
t_2 := \frac{-x}{t \cdot z}\\
\mathbf{if}\;z \leq -4.1 \cdot 10^{+65}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -1.4 \cdot 10^{-42}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq -4.3 \cdot 10^{-54}:\\
\;\;\;\;\frac{x}{z} \cdot \frac{1}{z}\\
\mathbf{elif}\;z \leq -2.1 \cdot 10^{-92}:\\
\;\;\;\;\frac{-x}{z \cdot y}\\
\mathbf{elif}\;z \leq 2.15 \cdot 10^{-13}:\\
\;\;\;\;\frac{\frac{x}{t}}{y}\\
\mathbf{elif}\;z \leq 2.7 \cdot 10^{+102}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -4.1000000000000001e65 or 2.7000000000000001e102 < z Initial program 83.4%
Taylor expanded in z around inf 75.7%
unpow275.7%
associate-/r*82.7%
Simplified82.7%
if -4.1000000000000001e65 < z < -1.39999999999999999e-42 or 2.1499999999999999e-13 < z < 2.7000000000000001e102Initial program 95.7%
associate-/l/99.6%
div-inv99.5%
Applied egg-rr99.5%
*-commutative99.5%
clear-num99.3%
un-div-inv99.4%
Applied egg-rr99.4%
Taylor expanded in y around 0 62.5%
Taylor expanded in z around 0 47.4%
associate-*r/47.4%
neg-mul-147.4%
*-commutative47.4%
Simplified47.4%
if -1.39999999999999999e-42 < z < -4.3e-54Initial program 99.0%
Taylor expanded in z around inf 90.0%
unpow290.0%
Simplified90.0%
*-un-lft-identity90.0%
times-frac90.5%
Applied egg-rr90.5%
*-commutative90.5%
Simplified90.5%
if -4.3e-54 < z < -2.1e-92Initial program 100.0%
Taylor expanded in y around inf 76.3%
*-commutative76.3%
Simplified76.3%
Taylor expanded in t around 0 38.8%
associate-*r/38.8%
neg-mul-138.8%
Simplified38.8%
if -2.1e-92 < z < 2.1499999999999999e-13Initial program 96.7%
Taylor expanded in y around inf 83.3%
*-commutative83.3%
associate-/r*82.4%
Simplified82.4%
Taylor expanded in t around inf 74.8%
Final simplification71.9%
NOTE: y and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ (/ x z) z)) (t_2 (/ x (* (- t z) y))))
(if (<= t 2.1e-234)
t_2
(if (<= t 4.3e-166)
t_1
(if (<= t 1.42e-96) t_2 (if (<= t 4500.0) t_1 (/ (/ x t) (- y z))))))))assert(y < t);
double code(double x, double y, double z, double t) {
double t_1 = (x / z) / z;
double t_2 = x / ((t - z) * y);
double tmp;
if (t <= 2.1e-234) {
tmp = t_2;
} else if (t <= 4.3e-166) {
tmp = t_1;
} else if (t <= 1.42e-96) {
tmp = t_2;
} else if (t <= 4500.0) {
tmp = t_1;
} else {
tmp = (x / t) / (y - z);
}
return tmp;
}
NOTE: y and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (x / z) / z
t_2 = x / ((t - z) * y)
if (t <= 2.1d-234) then
tmp = t_2
else if (t <= 4.3d-166) then
tmp = t_1
else if (t <= 1.42d-96) then
tmp = t_2
else if (t <= 4500.0d0) then
tmp = t_1
else
tmp = (x / t) / (y - z)
end if
code = tmp
end function
assert y < t;
public static double code(double x, double y, double z, double t) {
double t_1 = (x / z) / z;
double t_2 = x / ((t - z) * y);
double tmp;
if (t <= 2.1e-234) {
tmp = t_2;
} else if (t <= 4.3e-166) {
tmp = t_1;
} else if (t <= 1.42e-96) {
tmp = t_2;
} else if (t <= 4500.0) {
tmp = t_1;
} else {
tmp = (x / t) / (y - z);
}
return tmp;
}
[y, t] = sort([y, t]) def code(x, y, z, t): t_1 = (x / z) / z t_2 = x / ((t - z) * y) tmp = 0 if t <= 2.1e-234: tmp = t_2 elif t <= 4.3e-166: tmp = t_1 elif t <= 1.42e-96: tmp = t_2 elif t <= 4500.0: tmp = t_1 else: tmp = (x / t) / (y - z) return tmp
y, t = sort([y, t]) function code(x, y, z, t) t_1 = Float64(Float64(x / z) / z) t_2 = Float64(x / Float64(Float64(t - z) * y)) tmp = 0.0 if (t <= 2.1e-234) tmp = t_2; elseif (t <= 4.3e-166) tmp = t_1; elseif (t <= 1.42e-96) tmp = t_2; elseif (t <= 4500.0) tmp = t_1; else tmp = Float64(Float64(x / t) / Float64(y - z)); end return tmp end
y, t = num2cell(sort([y, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = (x / z) / z;
t_2 = x / ((t - z) * y);
tmp = 0.0;
if (t <= 2.1e-234)
tmp = t_2;
elseif (t <= 4.3e-166)
tmp = t_1;
elseif (t <= 1.42e-96)
tmp = t_2;
elseif (t <= 4500.0)
tmp = t_1;
else
tmp = (x / t) / (y - z);
end
tmp_2 = tmp;
end
NOTE: y and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x / z), $MachinePrecision] / z), $MachinePrecision]}, Block[{t$95$2 = N[(x / N[(N[(t - z), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, 2.1e-234], t$95$2, If[LessEqual[t, 4.3e-166], t$95$1, If[LessEqual[t, 1.42e-96], t$95$2, If[LessEqual[t, 4500.0], t$95$1, N[(N[(x / t), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
[y, t] = \mathsf{sort}([y, t])\\
\\
\begin{array}{l}
t_1 := \frac{\frac{x}{z}}{z}\\
t_2 := \frac{x}{\left(t - z\right) \cdot y}\\
\mathbf{if}\;t \leq 2.1 \cdot 10^{-234}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t \leq 4.3 \cdot 10^{-166}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 1.42 \cdot 10^{-96}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t \leq 4500:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{t}}{y - z}\\
\end{array}
\end{array}
if t < 2.09999999999999991e-234 or 4.3000000000000001e-166 < t < 1.42000000000000003e-96Initial program 92.4%
Taylor expanded in y around inf 66.4%
*-commutative66.4%
Simplified66.4%
if 2.09999999999999991e-234 < t < 4.3000000000000001e-166 or 1.42000000000000003e-96 < t < 4500Initial program 90.5%
Taylor expanded in z around inf 59.1%
unpow259.1%
associate-/r*68.3%
Simplified68.3%
if 4500 < t Initial program 90.2%
associate-/l/98.2%
Simplified98.2%
Taylor expanded in t around inf 88.9%
Final simplification72.7%
NOTE: y and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ (/ x z) z)))
(if (<= t 1.7e-231)
(/ x (* (- t z) y))
(if (<= t 2.65e-166)
t_1
(if (<= t 3e-104)
(/ (/ x y) (- t z))
(if (<= t 4500.0) t_1 (/ (/ x t) (- y z))))))))assert(y < t);
double code(double x, double y, double z, double t) {
double t_1 = (x / z) / z;
double tmp;
if (t <= 1.7e-231) {
tmp = x / ((t - z) * y);
} else if (t <= 2.65e-166) {
tmp = t_1;
} else if (t <= 3e-104) {
tmp = (x / y) / (t - z);
} else if (t <= 4500.0) {
tmp = t_1;
} else {
tmp = (x / t) / (y - z);
}
return tmp;
}
NOTE: y and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = (x / z) / z
if (t <= 1.7d-231) then
tmp = x / ((t - z) * y)
else if (t <= 2.65d-166) then
tmp = t_1
else if (t <= 3d-104) then
tmp = (x / y) / (t - z)
else if (t <= 4500.0d0) then
tmp = t_1
else
tmp = (x / t) / (y - z)
end if
code = tmp
end function
assert y < t;
public static double code(double x, double y, double z, double t) {
double t_1 = (x / z) / z;
double tmp;
if (t <= 1.7e-231) {
tmp = x / ((t - z) * y);
} else if (t <= 2.65e-166) {
tmp = t_1;
} else if (t <= 3e-104) {
tmp = (x / y) / (t - z);
} else if (t <= 4500.0) {
tmp = t_1;
} else {
tmp = (x / t) / (y - z);
}
return tmp;
}
[y, t] = sort([y, t]) def code(x, y, z, t): t_1 = (x / z) / z tmp = 0 if t <= 1.7e-231: tmp = x / ((t - z) * y) elif t <= 2.65e-166: tmp = t_1 elif t <= 3e-104: tmp = (x / y) / (t - z) elif t <= 4500.0: tmp = t_1 else: tmp = (x / t) / (y - z) return tmp
y, t = sort([y, t]) function code(x, y, z, t) t_1 = Float64(Float64(x / z) / z) tmp = 0.0 if (t <= 1.7e-231) tmp = Float64(x / Float64(Float64(t - z) * y)); elseif (t <= 2.65e-166) tmp = t_1; elseif (t <= 3e-104) tmp = Float64(Float64(x / y) / Float64(t - z)); elseif (t <= 4500.0) tmp = t_1; else tmp = Float64(Float64(x / t) / Float64(y - z)); end return tmp end
y, t = num2cell(sort([y, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = (x / z) / z;
tmp = 0.0;
if (t <= 1.7e-231)
tmp = x / ((t - z) * y);
elseif (t <= 2.65e-166)
tmp = t_1;
elseif (t <= 3e-104)
tmp = (x / y) / (t - z);
elseif (t <= 4500.0)
tmp = t_1;
else
tmp = (x / t) / (y - z);
end
tmp_2 = tmp;
end
NOTE: y and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x / z), $MachinePrecision] / z), $MachinePrecision]}, If[LessEqual[t, 1.7e-231], N[(x / N[(N[(t - z), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.65e-166], t$95$1, If[LessEqual[t, 3e-104], N[(N[(x / y), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 4500.0], t$95$1, N[(N[(x / t), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
[y, t] = \mathsf{sort}([y, t])\\
\\
\begin{array}{l}
t_1 := \frac{\frac{x}{z}}{z}\\
\mathbf{if}\;t \leq 1.7 \cdot 10^{-231}:\\
\;\;\;\;\frac{x}{\left(t - z\right) \cdot y}\\
\mathbf{elif}\;t \leq 2.65 \cdot 10^{-166}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 3 \cdot 10^{-104}:\\
\;\;\;\;\frac{\frac{x}{y}}{t - z}\\
\mathbf{elif}\;t \leq 4500:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{t}}{y - z}\\
\end{array}
\end{array}
if t < 1.7e-231Initial program 94.1%
Taylor expanded in y around inf 67.7%
*-commutative67.7%
Simplified67.7%
if 1.7e-231 < t < 2.64999999999999998e-166 or 3.0000000000000002e-104 < t < 4500Initial program 88.2%
Taylor expanded in z around inf 55.9%
unpow255.9%
associate-/r*67.4%
Simplified67.4%
if 2.64999999999999998e-166 < t < 3.0000000000000002e-104Initial program 83.2%
associate-/r*99.8%
Simplified99.8%
Taylor expanded in y around inf 74.5%
if 4500 < t Initial program 90.2%
associate-/l/98.2%
Simplified98.2%
Taylor expanded in t around inf 88.9%
Final simplification73.8%
NOTE: y and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ (/ x z) z)) (t_2 (/ (/ x (- t z)) y)))
(if (<= t 4.3e-231)
t_2
(if (<= t 2e-194)
t_1
(if (<= t 1.6e-104) t_2 (if (<= t 7500.0) t_1 (/ (/ x t) (- y z))))))))assert(y < t);
double code(double x, double y, double z, double t) {
double t_1 = (x / z) / z;
double t_2 = (x / (t - z)) / y;
double tmp;
if (t <= 4.3e-231) {
tmp = t_2;
} else if (t <= 2e-194) {
tmp = t_1;
} else if (t <= 1.6e-104) {
tmp = t_2;
} else if (t <= 7500.0) {
tmp = t_1;
} else {
tmp = (x / t) / (y - z);
}
return tmp;
}
NOTE: y and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (x / z) / z
t_2 = (x / (t - z)) / y
if (t <= 4.3d-231) then
tmp = t_2
else if (t <= 2d-194) then
tmp = t_1
else if (t <= 1.6d-104) then
tmp = t_2
else if (t <= 7500.0d0) then
tmp = t_1
else
tmp = (x / t) / (y - z)
end if
code = tmp
end function
assert y < t;
public static double code(double x, double y, double z, double t) {
double t_1 = (x / z) / z;
double t_2 = (x / (t - z)) / y;
double tmp;
if (t <= 4.3e-231) {
tmp = t_2;
} else if (t <= 2e-194) {
tmp = t_1;
} else if (t <= 1.6e-104) {
tmp = t_2;
} else if (t <= 7500.0) {
tmp = t_1;
} else {
tmp = (x / t) / (y - z);
}
return tmp;
}
[y, t] = sort([y, t]) def code(x, y, z, t): t_1 = (x / z) / z t_2 = (x / (t - z)) / y tmp = 0 if t <= 4.3e-231: tmp = t_2 elif t <= 2e-194: tmp = t_1 elif t <= 1.6e-104: tmp = t_2 elif t <= 7500.0: tmp = t_1 else: tmp = (x / t) / (y - z) return tmp
y, t = sort([y, t]) function code(x, y, z, t) t_1 = Float64(Float64(x / z) / z) t_2 = Float64(Float64(x / Float64(t - z)) / y) tmp = 0.0 if (t <= 4.3e-231) tmp = t_2; elseif (t <= 2e-194) tmp = t_1; elseif (t <= 1.6e-104) tmp = t_2; elseif (t <= 7500.0) tmp = t_1; else tmp = Float64(Float64(x / t) / Float64(y - z)); end return tmp end
y, t = num2cell(sort([y, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = (x / z) / z;
t_2 = (x / (t - z)) / y;
tmp = 0.0;
if (t <= 4.3e-231)
tmp = t_2;
elseif (t <= 2e-194)
tmp = t_1;
elseif (t <= 1.6e-104)
tmp = t_2;
elseif (t <= 7500.0)
tmp = t_1;
else
tmp = (x / t) / (y - z);
end
tmp_2 = tmp;
end
NOTE: y and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x / z), $MachinePrecision] / z), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x / N[(t - z), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]}, If[LessEqual[t, 4.3e-231], t$95$2, If[LessEqual[t, 2e-194], t$95$1, If[LessEqual[t, 1.6e-104], t$95$2, If[LessEqual[t, 7500.0], t$95$1, N[(N[(x / t), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
[y, t] = \mathsf{sort}([y, t])\\
\\
\begin{array}{l}
t_1 := \frac{\frac{x}{z}}{z}\\
t_2 := \frac{\frac{x}{t - z}}{y}\\
\mathbf{if}\;t \leq 4.3 \cdot 10^{-231}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t \leq 2 \cdot 10^{-194}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 1.6 \cdot 10^{-104}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t \leq 7500:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{t}}{y - z}\\
\end{array}
\end{array}
if t < 4.29999999999999998e-231 or 2.00000000000000004e-194 < t < 1.59999999999999994e-104Initial program 93.0%
Taylor expanded in y around inf 65.4%
*-commutative65.4%
associate-/r*68.4%
Simplified68.4%
if 4.29999999999999998e-231 < t < 2.00000000000000004e-194 or 1.59999999999999994e-104 < t < 7500Initial program 87.0%
Taylor expanded in z around inf 52.4%
unpow252.4%
associate-/r*65.0%
Simplified65.0%
if 7500 < t Initial program 90.2%
associate-/l/98.2%
Simplified98.2%
Taylor expanded in t around inf 88.9%
Final simplification73.5%
NOTE: y and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= t -1.75e-180) (/ x (* (- t z) y)) (if (<= t 4800.0) (* (/ -1.0 (- y z)) (/ x z)) (/ (/ x t) (- y z)))))
assert(y < t);
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -1.75e-180) {
tmp = x / ((t - z) * y);
} else if (t <= 4800.0) {
tmp = (-1.0 / (y - z)) * (x / z);
} else {
tmp = (x / t) / (y - z);
}
return tmp;
}
NOTE: y and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (t <= (-1.75d-180)) then
tmp = x / ((t - z) * y)
else if (t <= 4800.0d0) then
tmp = ((-1.0d0) / (y - z)) * (x / z)
else
tmp = (x / t) / (y - z)
end if
code = tmp
end function
assert y < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= -1.75e-180) {
tmp = x / ((t - z) * y);
} else if (t <= 4800.0) {
tmp = (-1.0 / (y - z)) * (x / z);
} else {
tmp = (x / t) / (y - z);
}
return tmp;
}
[y, t] = sort([y, t]) def code(x, y, z, t): tmp = 0 if t <= -1.75e-180: tmp = x / ((t - z) * y) elif t <= 4800.0: tmp = (-1.0 / (y - z)) * (x / z) else: tmp = (x / t) / (y - z) return tmp
y, t = sort([y, t]) function code(x, y, z, t) tmp = 0.0 if (t <= -1.75e-180) tmp = Float64(x / Float64(Float64(t - z) * y)); elseif (t <= 4800.0) tmp = Float64(Float64(-1.0 / Float64(y - z)) * Float64(x / z)); else tmp = Float64(Float64(x / t) / Float64(y - z)); end return tmp end
y, t = num2cell(sort([y, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (t <= -1.75e-180)
tmp = x / ((t - z) * y);
elseif (t <= 4800.0)
tmp = (-1.0 / (y - z)) * (x / z);
else
tmp = (x / t) / (y - z);
end
tmp_2 = tmp;
end
NOTE: y and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[t, -1.75e-180], N[(x / N[(N[(t - z), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 4800.0], N[(N[(-1.0 / N[(y - z), $MachinePrecision]), $MachinePrecision] * N[(x / z), $MachinePrecision]), $MachinePrecision], N[(N[(x / t), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[y, t] = \mathsf{sort}([y, t])\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.75 \cdot 10^{-180}:\\
\;\;\;\;\frac{x}{\left(t - z\right) \cdot y}\\
\mathbf{elif}\;t \leq 4800:\\
\;\;\;\;\frac{-1}{y - z} \cdot \frac{x}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{t}}{y - z}\\
\end{array}
\end{array}
if t < -1.75e-180Initial program 94.3%
Taylor expanded in y around inf 72.8%
*-commutative72.8%
Simplified72.8%
if -1.75e-180 < t < 4800Initial program 89.9%
Taylor expanded in t around 0 79.6%
associate-*r/79.6%
neg-mul-179.6%
*-commutative79.6%
Simplified79.6%
neg-mul-179.6%
*-commutative79.6%
times-frac87.4%
Applied egg-rr87.4%
if 4800 < t Initial program 90.2%
associate-/l/98.2%
Simplified98.2%
Taylor expanded in t around inf 88.9%
Final simplification82.6%
NOTE: y and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= t -1.35e-253) (/ x (* (- t z) y)) (if (<= t 1e-66) (/ (- x) (* z (- y z))) (/ (/ x t) (- y z)))))
assert(y < t);
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -1.35e-253) {
tmp = x / ((t - z) * y);
} else if (t <= 1e-66) {
tmp = -x / (z * (y - z));
} else {
tmp = (x / t) / (y - z);
}
return tmp;
}
NOTE: y and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (t <= (-1.35d-253)) then
tmp = x / ((t - z) * y)
else if (t <= 1d-66) then
tmp = -x / (z * (y - z))
else
tmp = (x / t) / (y - z)
end if
code = tmp
end function
assert y < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= -1.35e-253) {
tmp = x / ((t - z) * y);
} else if (t <= 1e-66) {
tmp = -x / (z * (y - z));
} else {
tmp = (x / t) / (y - z);
}
return tmp;
}
[y, t] = sort([y, t]) def code(x, y, z, t): tmp = 0 if t <= -1.35e-253: tmp = x / ((t - z) * y) elif t <= 1e-66: tmp = -x / (z * (y - z)) else: tmp = (x / t) / (y - z) return tmp
y, t = sort([y, t]) function code(x, y, z, t) tmp = 0.0 if (t <= -1.35e-253) tmp = Float64(x / Float64(Float64(t - z) * y)); elseif (t <= 1e-66) tmp = Float64(Float64(-x) / Float64(z * Float64(y - z))); else tmp = Float64(Float64(x / t) / Float64(y - z)); end return tmp end
y, t = num2cell(sort([y, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (t <= -1.35e-253)
tmp = x / ((t - z) * y);
elseif (t <= 1e-66)
tmp = -x / (z * (y - z));
else
tmp = (x / t) / (y - z);
end
tmp_2 = tmp;
end
NOTE: y and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[t, -1.35e-253], N[(x / N[(N[(t - z), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1e-66], N[((-x) / N[(z * N[(y - z), $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}\;t \leq -1.35 \cdot 10^{-253}:\\
\;\;\;\;\frac{x}{\left(t - z\right) \cdot y}\\
\mathbf{elif}\;t \leq 10^{-66}:\\
\;\;\;\;\frac{-x}{z \cdot \left(y - z\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{t}}{y - z}\\
\end{array}
\end{array}
if t < -1.35e-253Initial program 93.6%
Taylor expanded in y around inf 70.5%
*-commutative70.5%
Simplified70.5%
if -1.35e-253 < t < 9.9999999999999998e-67Initial program 91.2%
Taylor expanded in t around 0 82.1%
associate-*r/82.1%
neg-mul-182.1%
*-commutative82.1%
Simplified82.1%
if 9.9999999999999998e-67 < t Initial program 89.1%
associate-/l/98.4%
Simplified98.4%
Taylor expanded in t around inf 83.3%
Final simplification77.5%
NOTE: y and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= y -3.1e-65) (/ (/ x (- t z)) y) (if (<= y 1.16e-33) (/ (/ (- x) z) (- t z)) (/ (/ x t) (- y z)))))
assert(y < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -3.1e-65) {
tmp = (x / (t - z)) / y;
} else if (y <= 1.16e-33) {
tmp = (-x / z) / (t - z);
} else {
tmp = (x / t) / (y - z);
}
return tmp;
}
NOTE: y and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= (-3.1d-65)) then
tmp = (x / (t - z)) / y
else if (y <= 1.16d-33) then
tmp = (-x / z) / (t - z)
else
tmp = (x / t) / (y - z)
end if
code = tmp
end function
assert y < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -3.1e-65) {
tmp = (x / (t - z)) / y;
} else if (y <= 1.16e-33) {
tmp = (-x / z) / (t - z);
} else {
tmp = (x / t) / (y - z);
}
return tmp;
}
[y, t] = sort([y, t]) def code(x, y, z, t): tmp = 0 if y <= -3.1e-65: tmp = (x / (t - z)) / y elif y <= 1.16e-33: tmp = (-x / z) / (t - z) else: tmp = (x / t) / (y - z) return tmp
y, t = sort([y, t]) function code(x, y, z, t) tmp = 0.0 if (y <= -3.1e-65) tmp = Float64(Float64(x / Float64(t - z)) / y); elseif (y <= 1.16e-33) tmp = Float64(Float64(Float64(-x) / z) / Float64(t - z)); else tmp = Float64(Float64(x / t) / Float64(y - z)); end return tmp end
y, t = num2cell(sort([y, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (y <= -3.1e-65)
tmp = (x / (t - z)) / y;
elseif (y <= 1.16e-33)
tmp = (-x / z) / (t - z);
else
tmp = (x / t) / (y - z);
end
tmp_2 = tmp;
end
NOTE: y and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[y, -3.1e-65], N[(N[(x / N[(t - z), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision], If[LessEqual[y, 1.16e-33], N[(N[((-x) / z), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], N[(N[(x / t), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[y, t] = \mathsf{sort}([y, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.1 \cdot 10^{-65}:\\
\;\;\;\;\frac{\frac{x}{t - z}}{y}\\
\mathbf{elif}\;y \leq 1.16 \cdot 10^{-33}:\\
\;\;\;\;\frac{\frac{-x}{z}}{t - z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{t}}{y - z}\\
\end{array}
\end{array}
if y < -3.10000000000000016e-65Initial program 89.0%
Taylor expanded in y around inf 78.4%
*-commutative78.4%
associate-/r*84.3%
Simplified84.3%
if -3.10000000000000016e-65 < y < 1.1600000000000001e-33Initial program 93.9%
Taylor expanded in y around 0 73.9%
mul-1-neg73.9%
distribute-frac-neg73.9%
associate-/r*77.8%
Simplified77.8%
if 1.1600000000000001e-33 < y Initial program 91.1%
associate-/l/98.5%
Simplified98.5%
Taylor expanded in t around inf 64.7%
Final simplification76.0%
NOTE: y and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (or (<= z -3.8e+65) (not (<= z 2.7e+102))) (/ (/ x z) z) (/ x (* t (- y z)))))
assert(y < t);
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -3.8e+65) || !(z <= 2.7e+102)) {
tmp = (x / z) / z;
} else {
tmp = x / (t * (y - z));
}
return tmp;
}
NOTE: y and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((z <= (-3.8d+65)) .or. (.not. (z <= 2.7d+102))) then
tmp = (x / z) / z
else
tmp = x / (t * (y - z))
end if
code = tmp
end function
assert y < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -3.8e+65) || !(z <= 2.7e+102)) {
tmp = (x / z) / z;
} else {
tmp = x / (t * (y - z));
}
return tmp;
}
[y, t] = sort([y, t]) def code(x, y, z, t): tmp = 0 if (z <= -3.8e+65) or not (z <= 2.7e+102): tmp = (x / z) / z else: tmp = x / (t * (y - z)) return tmp
y, t = sort([y, t]) function code(x, y, z, t) tmp = 0.0 if ((z <= -3.8e+65) || !(z <= 2.7e+102)) tmp = Float64(Float64(x / z) / z); 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 ((z <= -3.8e+65) || ~((z <= 2.7e+102)))
tmp = (x / z) / z;
else
tmp = x / (t * (y - z));
end
tmp_2 = tmp;
end
NOTE: y and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[Or[LessEqual[z, -3.8e+65], N[Not[LessEqual[z, 2.7e+102]], $MachinePrecision]], N[(N[(x / z), $MachinePrecision] / z), $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}\;z \leq -3.8 \cdot 10^{+65} \lor \neg \left(z \leq 2.7 \cdot 10^{+102}\right):\\
\;\;\;\;\frac{\frac{x}{z}}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{t \cdot \left(y - z\right)}\\
\end{array}
\end{array}
if z < -3.80000000000000011e65 or 2.7000000000000001e102 < z Initial program 83.4%
Taylor expanded in z around inf 75.7%
unpow275.7%
associate-/r*82.7%
Simplified82.7%
if -3.80000000000000011e65 < z < 2.7000000000000001e102Initial program 96.6%
Taylor expanded in t around inf 75.3%
Final simplification78.1%
NOTE: y and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= z 1.5e+110) (/ x (* (- t z) (- y z))) (* (/ -1.0 (- y z)) (/ x z))))
assert(y < t);
double code(double x, double y, double z, double t) {
double tmp;
if (z <= 1.5e+110) {
tmp = x / ((t - z) * (y - z));
} else {
tmp = (-1.0 / (y - z)) * (x / z);
}
return tmp;
}
NOTE: y and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (z <= 1.5d+110) then
tmp = x / ((t - z) * (y - z))
else
tmp = ((-1.0d0) / (y - z)) * (x / z)
end if
code = tmp
end function
assert y < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= 1.5e+110) {
tmp = x / ((t - z) * (y - z));
} else {
tmp = (-1.0 / (y - z)) * (x / z);
}
return tmp;
}
[y, t] = sort([y, t]) def code(x, y, z, t): tmp = 0 if z <= 1.5e+110: tmp = x / ((t - z) * (y - z)) else: tmp = (-1.0 / (y - z)) * (x / z) return tmp
y, t = sort([y, t]) function code(x, y, z, t) tmp = 0.0 if (z <= 1.5e+110) tmp = Float64(x / Float64(Float64(t - z) * Float64(y - z))); else tmp = Float64(Float64(-1.0 / Float64(y - z)) * Float64(x / z)); end return tmp end
y, t = num2cell(sort([y, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (z <= 1.5e+110)
tmp = x / ((t - z) * (y - z));
else
tmp = (-1.0 / (y - z)) * (x / 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, 1.5e+110], N[(x / N[(N[(t - z), $MachinePrecision] * N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(-1.0 / N[(y - z), $MachinePrecision]), $MachinePrecision] * N[(x / z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[y, t] = \mathsf{sort}([y, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq 1.5 \cdot 10^{+110}:\\
\;\;\;\;\frac{x}{\left(t - z\right) \cdot \left(y - z\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{-1}{y - z} \cdot \frac{x}{z}\\
\end{array}
\end{array}
if z < 1.50000000000000004e110Initial program 94.5%
if 1.50000000000000004e110 < z Initial program 75.1%
Taylor expanded in t around 0 75.1%
associate-*r/75.1%
neg-mul-175.1%
*-commutative75.1%
Simplified75.1%
neg-mul-175.1%
*-commutative75.1%
times-frac94.9%
Applied egg-rr94.9%
Final simplification94.6%
NOTE: y and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (or (<= z -9e+107) (not (<= z 1.6e+132))) (/ x (* z y)) (/ x (* t y))))
assert(y < t);
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -9e+107) || !(z <= 1.6e+132)) {
tmp = x / (z * y);
} 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 <= (-9d+107)) .or. (.not. (z <= 1.6d+132))) then
tmp = x / (z * y)
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 <= -9e+107) || !(z <= 1.6e+132)) {
tmp = x / (z * y);
} else {
tmp = x / (t * y);
}
return tmp;
}
[y, t] = sort([y, t]) def code(x, y, z, t): tmp = 0 if (z <= -9e+107) or not (z <= 1.6e+132): tmp = x / (z * y) else: tmp = x / (t * y) return tmp
y, t = sort([y, t]) function code(x, y, z, t) tmp = 0.0 if ((z <= -9e+107) || !(z <= 1.6e+132)) tmp = Float64(x / Float64(z * y)); 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 <= -9e+107) || ~((z <= 1.6e+132)))
tmp = x / (z * y);
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, -9e+107], N[Not[LessEqual[z, 1.6e+132]], $MachinePrecision]], N[(x / N[(z * y), $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 -9 \cdot 10^{+107} \lor \neg \left(z \leq 1.6 \cdot 10^{+132}\right):\\
\;\;\;\;\frac{x}{z \cdot y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{t \cdot y}\\
\end{array}
\end{array}
if z < -9e107 or 1.5999999999999999e132 < z Initial program 81.5%
Taylor expanded in y around inf 50.6%
*-commutative50.6%
associate-/r*61.1%
Simplified61.1%
Taylor expanded in t around 0 58.4%
associate-*r/58.4%
neg-mul-158.4%
Simplified58.4%
expm1-log1p-u58.1%
expm1-udef71.8%
associate-/l/71.8%
add-sqr-sqrt29.6%
sqrt-unprod63.1%
sqr-neg63.1%
sqrt-unprod42.3%
add-sqr-sqrt71.9%
Applied egg-rr71.9%
expm1-def49.2%
expm1-log1p49.4%
*-commutative49.4%
Simplified49.4%
if -9e107 < z < 1.5999999999999999e132Initial program 95.5%
Taylor expanded in z around 0 53.3%
Final simplification52.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.7e+65) (not (<= z 0.28))) (/ x (* z z)) (/ x (* t y))))
assert(y < t);
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -3.7e+65) || !(z <= 0.28)) {
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.7d+65)) .or. (.not. (z <= 0.28d0))) 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.7e+65) || !(z <= 0.28)) {
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.7e+65) or not (z <= 0.28): 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.7e+65) || !(z <= 0.28)) 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 <= -3.7e+65) || ~((z <= 0.28)))
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.7e+65], N[Not[LessEqual[z, 0.28]], $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 -3.7 \cdot 10^{+65} \lor \neg \left(z \leq 0.28\right):\\
\;\;\;\;\frac{x}{z \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{t \cdot y}\\
\end{array}
\end{array}
if z < -3.69999999999999995e65 or 0.28000000000000003 < z Initial program 84.9%
Taylor expanded in z around inf 66.1%
unpow266.1%
Simplified66.1%
if -3.69999999999999995e65 < z < 0.28000000000000003Initial program 97.5%
Taylor expanded in z around 0 64.8%
Final simplification65.4%
NOTE: y and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (or (<= z -3.7e+65) (not (<= z 3.6e+73))) (/ x (* z z)) (/ (/ x t) y)))
assert(y < t);
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -3.7e+65) || !(z <= 3.6e+73)) {
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.7d+65)) .or. (.not. (z <= 3.6d+73))) 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.7e+65) || !(z <= 3.6e+73)) {
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.7e+65) or not (z <= 3.6e+73): 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.7e+65) || !(z <= 3.6e+73)) 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.7e+65) || ~((z <= 3.6e+73)))
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.7e+65], N[Not[LessEqual[z, 3.6e+73]], $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.7 \cdot 10^{+65} \lor \neg \left(z \leq 3.6 \cdot 10^{+73}\right):\\
\;\;\;\;\frac{x}{z \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{t}}{y}\\
\end{array}
\end{array}
if z < -3.69999999999999995e65 or 3.5999999999999999e73 < z Initial program 83.9%
Taylor expanded in z around inf 74.0%
unpow274.0%
Simplified74.0%
if -3.69999999999999995e65 < z < 3.5999999999999999e73Initial program 96.6%
Taylor expanded in y around inf 69.5%
*-commutative69.5%
associate-/r*71.2%
Simplified71.2%
Taylor expanded in t around inf 60.6%
Final simplification65.8%
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+65) (not (<= z 3.6e+73))) (/ (/ 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+65) || !(z <= 3.6e+73)) {
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+65)) .or. (.not. (z <= 3.6d+73))) 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+65) || !(z <= 3.6e+73)) {
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+65) or not (z <= 3.6e+73): 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+65) || !(z <= 3.6e+73)) tmp = Float64(Float64(x / 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+65) || ~((z <= 3.6e+73)))
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+65], N[Not[LessEqual[z, 3.6e+73]], $MachinePrecision]], N[(N[(x / z), $MachinePrecision] / z), $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^{+65} \lor \neg \left(z \leq 3.6 \cdot 10^{+73}\right):\\
\;\;\;\;\frac{\frac{x}{z}}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{t}}{y}\\
\end{array}
\end{array}
if z < -3.8999999999999998e65 or 3.5999999999999999e73 < z Initial program 83.9%
Taylor expanded in z around inf 74.0%
unpow274.0%
associate-/r*80.8%
Simplified80.8%
if -3.8999999999999998e65 < z < 3.5999999999999999e73Initial program 96.6%
Taylor expanded in y around inf 69.5%
*-commutative69.5%
associate-/r*71.2%
Simplified71.2%
Taylor expanded in t around inf 60.6%
Final simplification68.5%
NOTE: y and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (/ x (* 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 91.6%
Taylor expanded in z around 0 44.7%
Final simplification44.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 2023185
(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))))