
(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 14 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (/ x (* (- y z) (- t z))))
double code(double x, double y, double z, double t) {
return x / ((y - z) * (t - z));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = x / ((y - z) * (t - z))
end function
public static double code(double x, double y, double z, double t) {
return x / ((y - z) * (t - z));
}
def code(x, y, z, t): return x / ((y - z) * (t - z))
function code(x, y, z, t) return Float64(x / Float64(Float64(y - z) * Float64(t - z))) end
function tmp = code(x, y, z, t) tmp = x / ((y - z) * (t - z)); end
code[x_, y_, z_, t_] := N[(x / N[(N[(y - z), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{\left(y - z\right) \cdot \left(t - z\right)}
\end{array}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (/ (/ x (- t z)) (- y z)))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
return (x / (t - z)) / (y - z);
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (x / (t - z)) / (y - z)
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
return (x / (t - z)) / (y - z);
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): return (x / (t - z)) / (y - z)
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) return Float64(Float64(x / Float64(t - z)) / Float64(y - z)) end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
tmp = (x / (t - z)) / (y - z);
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := N[(N[(x / N[(t - z), $MachinePrecision]), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\frac{\frac{x}{t - z}}{y - z}
\end{array}
Initial program 91.5%
associate-/l/98.6%
Simplified98.6%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ x (* z (- z y)))))
(if (<= z -1.8e-44)
t_1
(if (<= z 1.25e+32)
(/ (/ x t) y)
(if (<= z 6.4e+117) t_1 (/ (/ x z) z))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = x / (z * (z - y));
double tmp;
if (z <= -1.8e-44) {
tmp = t_1;
} else if (z <= 1.25e+32) {
tmp = (x / t) / y;
} else if (z <= 6.4e+117) {
tmp = t_1;
} else {
tmp = (x / z) / z;
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = x / (z * (z - y))
if (z <= (-1.8d-44)) then
tmp = t_1
else if (z <= 1.25d+32) then
tmp = (x / t) / y
else if (z <= 6.4d+117) then
tmp = t_1
else
tmp = (x / z) / z
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = x / (z * (z - y));
double tmp;
if (z <= -1.8e-44) {
tmp = t_1;
} else if (z <= 1.25e+32) {
tmp = (x / t) / y;
} else if (z <= 6.4e+117) {
tmp = t_1;
} else {
tmp = (x / z) / z;
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = x / (z * (z - y)) tmp = 0 if z <= -1.8e-44: tmp = t_1 elif z <= 1.25e+32: tmp = (x / t) / y elif z <= 6.4e+117: tmp = t_1 else: tmp = (x / z) / z return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(x / Float64(z * Float64(z - y))) tmp = 0.0 if (z <= -1.8e-44) tmp = t_1; elseif (z <= 1.25e+32) tmp = Float64(Float64(x / t) / y); elseif (z <= 6.4e+117) tmp = t_1; else tmp = Float64(Float64(x / z) / z); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = x / (z * (z - y));
tmp = 0.0;
if (z <= -1.8e-44)
tmp = t_1;
elseif (z <= 1.25e+32)
tmp = (x / t) / y;
elseif (z <= 6.4e+117)
tmp = t_1;
else
tmp = (x / z) / z;
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x / N[(z * N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.8e-44], t$95$1, If[LessEqual[z, 1.25e+32], N[(N[(x / t), $MachinePrecision] / y), $MachinePrecision], If[LessEqual[z, 6.4e+117], t$95$1, N[(N[(x / z), $MachinePrecision] / z), $MachinePrecision]]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \frac{x}{z \cdot \left(z - y\right)}\\
\mathbf{if}\;z \leq -1.8 \cdot 10^{-44}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.25 \cdot 10^{+32}:\\
\;\;\;\;\frac{\frac{x}{t}}{y}\\
\mathbf{elif}\;z \leq 6.4 \cdot 10^{+117}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{z}}{z}\\
\end{array}
\end{array}
if z < -1.7999999999999999e-44 or 1.2499999999999999e32 < z < 6.4000000000000001e117Initial program 92.3%
Taylor expanded in t around 0 70.7%
mul-1-neg70.7%
distribute-rgt-neg-in70.7%
neg-sub070.7%
sub-neg70.7%
+-commutative70.7%
associate--r+70.7%
neg-sub070.7%
remove-double-neg70.7%
Simplified70.7%
if -1.7999999999999999e-44 < z < 1.2499999999999999e32Initial program 92.4%
associate-/l/97.5%
Simplified97.5%
clear-num96.8%
inv-pow96.8%
Applied egg-rr96.8%
unpow-196.8%
Simplified96.8%
Taylor expanded in z around 0 59.4%
associate-/r*65.9%
Simplified65.9%
if 6.4000000000000001e117 < z Initial program 86.9%
Taylor expanded in t around 0 82.3%
mul-1-neg82.3%
associate-/r*93.2%
distribute-neg-frac293.2%
neg-sub093.2%
sub-neg93.2%
+-commutative93.2%
associate--r+93.2%
neg-sub093.2%
remove-double-neg93.2%
Simplified93.2%
Taylor expanded in z around inf 93.3%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(if (<= z -6.6e+203)
(/ x (* t z))
(if (or (<= z -2.7e+25) (not (<= z 1.36e+76)))
(/ x (* z y))
(/ (/ x t) y))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -6.6e+203) {
tmp = x / (t * z);
} else if ((z <= -2.7e+25) || !(z <= 1.36e+76)) {
tmp = x / (z * y);
} else {
tmp = (x / t) / y;
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (z <= (-6.6d+203)) then
tmp = x / (t * z)
else if ((z <= (-2.7d+25)) .or. (.not. (z <= 1.36d+76))) then
tmp = x / (z * y)
else
tmp = (x / t) / y
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -6.6e+203) {
tmp = x / (t * z);
} else if ((z <= -2.7e+25) || !(z <= 1.36e+76)) {
tmp = x / (z * y);
} else {
tmp = (x / t) / y;
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if z <= -6.6e+203: tmp = x / (t * z) elif (z <= -2.7e+25) or not (z <= 1.36e+76): tmp = x / (z * y) else: tmp = (x / t) / y return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (z <= -6.6e+203) tmp = Float64(x / Float64(t * z)); elseif ((z <= -2.7e+25) || !(z <= 1.36e+76)) tmp = Float64(x / Float64(z * y)); else tmp = Float64(Float64(x / t) / y); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (z <= -6.6e+203)
tmp = x / (t * z);
elseif ((z <= -2.7e+25) || ~((z <= 1.36e+76)))
tmp = x / (z * y);
else
tmp = (x / t) / y;
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[z, -6.6e+203], N[(x / N[(t * z), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[z, -2.7e+25], N[Not[LessEqual[z, 1.36e+76]], $MachinePrecision]], N[(x / N[(z * y), $MachinePrecision]), $MachinePrecision], N[(N[(x / t), $MachinePrecision] / y), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6.6 \cdot 10^{+203}:\\
\;\;\;\;\frac{x}{t \cdot z}\\
\mathbf{elif}\;z \leq -2.7 \cdot 10^{+25} \lor \neg \left(z \leq 1.36 \cdot 10^{+76}\right):\\
\;\;\;\;\frac{x}{z \cdot y}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{t}}{y}\\
\end{array}
\end{array}
if z < -6.59999999999999979e203Initial program 97.9%
associate-/l/100.0%
Simplified100.0%
Taylor expanded in t around inf 76.6%
Taylor expanded in y around 0 76.6%
neg-mul-176.6%
Simplified76.6%
add-sqr-sqrt76.6%
sqrt-unprod97.9%
sqr-neg97.9%
sqrt-unprod0.0%
add-sqr-sqrt74.3%
*-un-lft-identity74.3%
associate-/l/81.9%
*-commutative81.9%
Applied egg-rr81.9%
*-lft-identity81.9%
*-commutative81.9%
Simplified81.9%
if -6.59999999999999979e203 < z < -2.7e25 or 1.36000000000000004e76 < z Initial program 87.3%
Taylor expanded in t around 0 77.0%
mul-1-neg77.0%
associate-/r*86.5%
distribute-neg-frac286.5%
neg-sub086.5%
sub-neg86.5%
+-commutative86.5%
associate--r+86.5%
neg-sub086.5%
remove-double-neg86.5%
Simplified86.5%
Taylor expanded in z around 0 46.0%
associate-*r/46.0%
neg-mul-146.0%
*-commutative46.0%
Simplified46.0%
neg-sub046.0%
sub-neg46.0%
add-sqr-sqrt24.4%
sqrt-unprod51.1%
sqr-neg51.1%
sqrt-unprod20.6%
add-sqr-sqrt44.2%
Applied egg-rr44.2%
+-lft-identity44.2%
Simplified44.2%
if -2.7e25 < z < 1.36000000000000004e76Initial program 93.4%
associate-/l/97.8%
Simplified97.8%
clear-num97.2%
inv-pow97.2%
Applied egg-rr97.2%
unpow-197.2%
Simplified97.2%
Taylor expanded in z around 0 52.9%
associate-/r*59.1%
Simplified59.1%
Final simplification55.0%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(if (<= z -6.3e+204)
(/ x (* t z))
(if (or (<= z -2.15e+30) (not (<= z 4.6e+62)))
(/ x (* z y))
(/ x (* t y)))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -6.3e+204) {
tmp = x / (t * z);
} else if ((z <= -2.15e+30) || !(z <= 4.6e+62)) {
tmp = x / (z * y);
} else {
tmp = x / (t * y);
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (z <= (-6.3d+204)) then
tmp = x / (t * z)
else if ((z <= (-2.15d+30)) .or. (.not. (z <= 4.6d+62))) then
tmp = x / (z * y)
else
tmp = x / (t * y)
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -6.3e+204) {
tmp = x / (t * z);
} else if ((z <= -2.15e+30) || !(z <= 4.6e+62)) {
tmp = x / (z * y);
} else {
tmp = x / (t * y);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if z <= -6.3e+204: tmp = x / (t * z) elif (z <= -2.15e+30) or not (z <= 4.6e+62): tmp = x / (z * y) else: tmp = x / (t * y) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (z <= -6.3e+204) tmp = Float64(x / Float64(t * z)); elseif ((z <= -2.15e+30) || !(z <= 4.6e+62)) tmp = Float64(x / Float64(z * y)); else tmp = Float64(x / Float64(t * y)); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (z <= -6.3e+204)
tmp = x / (t * z);
elseif ((z <= -2.15e+30) || ~((z <= 4.6e+62)))
tmp = x / (z * y);
else
tmp = x / (t * y);
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[z, -6.3e+204], N[(x / N[(t * z), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[z, -2.15e+30], N[Not[LessEqual[z, 4.6e+62]], $MachinePrecision]], N[(x / N[(z * y), $MachinePrecision]), $MachinePrecision], N[(x / N[(t * y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6.3 \cdot 10^{+204}:\\
\;\;\;\;\frac{x}{t \cdot z}\\
\mathbf{elif}\;z \leq -2.15 \cdot 10^{+30} \lor \neg \left(z \leq 4.6 \cdot 10^{+62}\right):\\
\;\;\;\;\frac{x}{z \cdot y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{t \cdot y}\\
\end{array}
\end{array}
if z < -6.3000000000000001e204Initial program 97.9%
associate-/l/100.0%
Simplified100.0%
Taylor expanded in t around inf 76.6%
Taylor expanded in y around 0 76.6%
neg-mul-176.6%
Simplified76.6%
add-sqr-sqrt76.6%
sqrt-unprod97.9%
sqr-neg97.9%
sqrt-unprod0.0%
add-sqr-sqrt74.3%
*-un-lft-identity74.3%
associate-/l/81.9%
*-commutative81.9%
Applied egg-rr81.9%
*-lft-identity81.9%
*-commutative81.9%
Simplified81.9%
if -6.3000000000000001e204 < z < -2.15e30 or 4.59999999999999968e62 < z Initial program 87.3%
Taylor expanded in t around 0 77.0%
mul-1-neg77.0%
associate-/r*86.5%
distribute-neg-frac286.5%
neg-sub086.5%
sub-neg86.5%
+-commutative86.5%
associate--r+86.5%
neg-sub086.5%
remove-double-neg86.5%
Simplified86.5%
Taylor expanded in z around 0 46.0%
associate-*r/46.0%
neg-mul-146.0%
*-commutative46.0%
Simplified46.0%
neg-sub046.0%
sub-neg46.0%
add-sqr-sqrt24.4%
sqrt-unprod51.1%
sqr-neg51.1%
sqrt-unprod20.6%
add-sqr-sqrt44.2%
Applied egg-rr44.2%
+-lft-identity44.2%
Simplified44.2%
if -2.15e30 < z < 4.59999999999999968e62Initial program 93.4%
Taylor expanded in z around 0 52.9%
Final simplification51.3%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ (/ x z) z)))
(if (<= z -6.4e+55)
t_1
(if (<= z -3.8e-44)
(/ x (* y (- z)))
(if (<= z 5.6e+33) (/ (/ x t) y) t_1)))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = (x / z) / z;
double tmp;
if (z <= -6.4e+55) {
tmp = t_1;
} else if (z <= -3.8e-44) {
tmp = x / (y * -z);
} else if (z <= 5.6e+33) {
tmp = (x / t) / y;
} else {
tmp = t_1;
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = (x / z) / z
if (z <= (-6.4d+55)) then
tmp = t_1
else if (z <= (-3.8d-44)) then
tmp = x / (y * -z)
else if (z <= 5.6d+33) then
tmp = (x / t) / y
else
tmp = t_1
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = (x / z) / z;
double tmp;
if (z <= -6.4e+55) {
tmp = t_1;
} else if (z <= -3.8e-44) {
tmp = x / (y * -z);
} else if (z <= 5.6e+33) {
tmp = (x / t) / y;
} else {
tmp = t_1;
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = (x / z) / z tmp = 0 if z <= -6.4e+55: tmp = t_1 elif z <= -3.8e-44: tmp = x / (y * -z) elif z <= 5.6e+33: tmp = (x / t) / y else: tmp = t_1 return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(Float64(x / z) / z) tmp = 0.0 if (z <= -6.4e+55) tmp = t_1; elseif (z <= -3.8e-44) tmp = Float64(x / Float64(y * Float64(-z))); elseif (z <= 5.6e+33) tmp = Float64(Float64(x / t) / y); else tmp = t_1; end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = (x / z) / z;
tmp = 0.0;
if (z <= -6.4e+55)
tmp = t_1;
elseif (z <= -3.8e-44)
tmp = x / (y * -z);
elseif (z <= 5.6e+33)
tmp = (x / t) / y;
else
tmp = t_1;
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x / z), $MachinePrecision] / z), $MachinePrecision]}, If[LessEqual[z, -6.4e+55], t$95$1, If[LessEqual[z, -3.8e-44], N[(x / N[(y * (-z)), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 5.6e+33], N[(N[(x / t), $MachinePrecision] / y), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \frac{\frac{x}{z}}{z}\\
\mathbf{if}\;z \leq -6.4 \cdot 10^{+55}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -3.8 \cdot 10^{-44}:\\
\;\;\;\;\frac{x}{y \cdot \left(-z\right)}\\
\mathbf{elif}\;z \leq 5.6 \cdot 10^{+33}:\\
\;\;\;\;\frac{\frac{x}{t}}{y}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -6.4000000000000005e55 or 5.6000000000000002e33 < z Initial program 88.3%
Taylor expanded in t around 0 79.1%
mul-1-neg79.1%
associate-/r*87.0%
distribute-neg-frac287.0%
neg-sub087.0%
sub-neg87.0%
+-commutative87.0%
associate--r+87.0%
neg-sub087.0%
remove-double-neg87.0%
Simplified87.0%
Taylor expanded in z around inf 81.3%
if -6.4000000000000005e55 < z < -3.8000000000000001e-44Initial program 99.9%
Taylor expanded in t around 0 55.6%
mul-1-neg55.6%
associate-/r*55.4%
distribute-neg-frac255.4%
neg-sub055.4%
sub-neg55.4%
+-commutative55.4%
associate--r+55.4%
neg-sub055.4%
remove-double-neg55.4%
Simplified55.4%
Taylor expanded in z around 0 42.4%
associate-*r/42.4%
neg-mul-142.4%
*-commutative42.4%
Simplified42.4%
if -3.8000000000000001e-44 < z < 5.6000000000000002e33Initial program 92.4%
associate-/l/97.5%
Simplified97.5%
clear-num96.8%
inv-pow96.8%
Applied egg-rr96.8%
unpow-196.8%
Simplified96.8%
Taylor expanded in z around 0 59.4%
associate-/r*65.9%
Simplified65.9%
Final simplification69.8%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= t -4.8e-121) (/ (/ x y) (- t z)) (if (<= t 7.8e-72) (/ (/ x z) (- z y)) (/ 1.0 (* (- y z) (/ t x))))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -4.8e-121) {
tmp = (x / y) / (t - z);
} else if (t <= 7.8e-72) {
tmp = (x / z) / (z - y);
} else {
tmp = 1.0 / ((y - z) * (t / x));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (t <= (-4.8d-121)) then
tmp = (x / y) / (t - z)
else if (t <= 7.8d-72) then
tmp = (x / z) / (z - y)
else
tmp = 1.0d0 / ((y - z) * (t / x))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= -4.8e-121) {
tmp = (x / y) / (t - z);
} else if (t <= 7.8e-72) {
tmp = (x / z) / (z - y);
} else {
tmp = 1.0 / ((y - z) * (t / x));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if t <= -4.8e-121: tmp = (x / y) / (t - z) elif t <= 7.8e-72: tmp = (x / z) / (z - y) else: tmp = 1.0 / ((y - z) * (t / x)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (t <= -4.8e-121) tmp = Float64(Float64(x / y) / Float64(t - z)); elseif (t <= 7.8e-72) tmp = Float64(Float64(x / z) / Float64(z - y)); else tmp = Float64(1.0 / Float64(Float64(y - z) * Float64(t / x))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (t <= -4.8e-121)
tmp = (x / y) / (t - z);
elseif (t <= 7.8e-72)
tmp = (x / z) / (z - y);
else
tmp = 1.0 / ((y - z) * (t / x));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[t, -4.8e-121], N[(N[(x / y), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 7.8e-72], N[(N[(x / z), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(N[(y - z), $MachinePrecision] * N[(t / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4.8 \cdot 10^{-121}:\\
\;\;\;\;\frac{\frac{x}{y}}{t - z}\\
\mathbf{elif}\;t \leq 7.8 \cdot 10^{-72}:\\
\;\;\;\;\frac{\frac{x}{z}}{z - y}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\left(y - z\right) \cdot \frac{t}{x}}\\
\end{array}
\end{array}
if t < -4.80000000000000007e-121Initial program 96.3%
Taylor expanded in y around inf 69.4%
associate-/r*67.6%
Simplified67.6%
if -4.80000000000000007e-121 < t < 7.8e-72Initial program 91.0%
Taylor expanded in t around 0 81.0%
mul-1-neg81.0%
associate-/r*87.4%
distribute-neg-frac287.4%
neg-sub087.4%
sub-neg87.4%
+-commutative87.4%
associate--r+87.4%
neg-sub087.4%
remove-double-neg87.4%
Simplified87.4%
if 7.8e-72 < t Initial program 85.7%
associate-/l/99.7%
Simplified99.7%
Taylor expanded in t around inf 87.7%
clear-num88.3%
inv-pow88.3%
div-inv88.2%
clear-num88.4%
Applied egg-rr88.4%
unpow-188.4%
Simplified88.4%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (or (<= t -2.9e-58) (not (<= t 5.5e-88))) (/ x (* t (- y z))) (/ x (* z (- z y)))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -2.9e-58) || !(t <= 5.5e-88)) {
tmp = x / (t * (y - z));
} else {
tmp = x / (z * (z - y));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((t <= (-2.9d-58)) .or. (.not. (t <= 5.5d-88))) then
tmp = x / (t * (y - z))
else
tmp = x / (z * (z - y))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -2.9e-58) || !(t <= 5.5e-88)) {
tmp = x / (t * (y - z));
} else {
tmp = x / (z * (z - y));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if (t <= -2.9e-58) or not (t <= 5.5e-88): tmp = x / (t * (y - z)) else: tmp = x / (z * (z - y)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if ((t <= -2.9e-58) || !(t <= 5.5e-88)) tmp = Float64(x / Float64(t * Float64(y - z))); else tmp = Float64(x / Float64(z * Float64(z - y))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if ((t <= -2.9e-58) || ~((t <= 5.5e-88)))
tmp = x / (t * (y - z));
else
tmp = x / (z * (z - y));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[Or[LessEqual[t, -2.9e-58], N[Not[LessEqual[t, 5.5e-88]], $MachinePrecision]], N[(x / N[(t * N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x / N[(z * N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.9 \cdot 10^{-58} \lor \neg \left(t \leq 5.5 \cdot 10^{-88}\right):\\
\;\;\;\;\frac{x}{t \cdot \left(y - z\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{z \cdot \left(z - y\right)}\\
\end{array}
\end{array}
if t < -2.8999999999999999e-58 or 5.49999999999999971e-88 < t Initial program 90.4%
Taylor expanded in t around inf 80.3%
if -2.8999999999999999e-58 < t < 5.49999999999999971e-88Initial program 93.2%
Taylor expanded in t around 0 81.6%
mul-1-neg81.6%
distribute-rgt-neg-in81.6%
neg-sub081.6%
sub-neg81.6%
+-commutative81.6%
associate--r+81.6%
neg-sub081.6%
remove-double-neg81.6%
Simplified81.6%
Final simplification80.8%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= t -5.8e-121) (/ (/ x y) (- t z)) (if (<= t 1.5e-70) (/ (/ x z) (- z y)) (/ (/ x t) (- y z)))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -5.8e-121) {
tmp = (x / y) / (t - z);
} else if (t <= 1.5e-70) {
tmp = (x / z) / (z - y);
} else {
tmp = (x / t) / (y - z);
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (t <= (-5.8d-121)) then
tmp = (x / y) / (t - z)
else if (t <= 1.5d-70) then
tmp = (x / z) / (z - y)
else
tmp = (x / t) / (y - z)
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= -5.8e-121) {
tmp = (x / y) / (t - z);
} else if (t <= 1.5e-70) {
tmp = (x / z) / (z - y);
} else {
tmp = (x / t) / (y - z);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if t <= -5.8e-121: tmp = (x / y) / (t - z) elif t <= 1.5e-70: tmp = (x / z) / (z - y) else: tmp = (x / t) / (y - z) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (t <= -5.8e-121) tmp = Float64(Float64(x / y) / Float64(t - z)); elseif (t <= 1.5e-70) tmp = Float64(Float64(x / z) / Float64(z - y)); else tmp = Float64(Float64(x / t) / Float64(y - z)); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (t <= -5.8e-121)
tmp = (x / y) / (t - z);
elseif (t <= 1.5e-70)
tmp = (x / z) / (z - y);
else
tmp = (x / t) / (y - z);
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[t, -5.8e-121], N[(N[(x / y), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.5e-70], N[(N[(x / z), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision], N[(N[(x / t), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -5.8 \cdot 10^{-121}:\\
\;\;\;\;\frac{\frac{x}{y}}{t - z}\\
\mathbf{elif}\;t \leq 1.5 \cdot 10^{-70}:\\
\;\;\;\;\frac{\frac{x}{z}}{z - y}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{t}}{y - z}\\
\end{array}
\end{array}
if t < -5.8e-121Initial program 96.3%
Taylor expanded in y around inf 69.4%
associate-/r*67.6%
Simplified67.6%
if -5.8e-121 < t < 1.5000000000000001e-70Initial program 91.0%
Taylor expanded in t around 0 81.0%
mul-1-neg81.0%
associate-/r*87.4%
distribute-neg-frac287.4%
neg-sub087.4%
sub-neg87.4%
+-commutative87.4%
associate--r+87.4%
neg-sub087.4%
remove-double-neg87.4%
Simplified87.4%
if 1.5000000000000001e-70 < t Initial program 85.7%
associate-/l/99.7%
Simplified99.7%
Taylor expanded in t around inf 87.7%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= t -4.5e-121) (/ (/ x y) (- t z)) (if (<= t 4e-91) (/ x (* z (- z y))) (/ (/ x t) (- y z)))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -4.5e-121) {
tmp = (x / y) / (t - z);
} else if (t <= 4e-91) {
tmp = x / (z * (z - y));
} else {
tmp = (x / t) / (y - z);
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (t <= (-4.5d-121)) then
tmp = (x / y) / (t - z)
else if (t <= 4d-91) then
tmp = x / (z * (z - y))
else
tmp = (x / t) / (y - z)
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= -4.5e-121) {
tmp = (x / y) / (t - z);
} else if (t <= 4e-91) {
tmp = x / (z * (z - y));
} else {
tmp = (x / t) / (y - z);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if t <= -4.5e-121: tmp = (x / y) / (t - z) elif t <= 4e-91: tmp = x / (z * (z - y)) else: tmp = (x / t) / (y - z) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (t <= -4.5e-121) tmp = Float64(Float64(x / y) / Float64(t - z)); elseif (t <= 4e-91) tmp = Float64(x / Float64(z * Float64(z - y))); else tmp = Float64(Float64(x / t) / Float64(y - z)); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (t <= -4.5e-121)
tmp = (x / y) / (t - z);
elseif (t <= 4e-91)
tmp = x / (z * (z - y));
else
tmp = (x / t) / (y - z);
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[t, -4.5e-121], N[(N[(x / y), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 4e-91], N[(x / N[(z * N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / t), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4.5 \cdot 10^{-121}:\\
\;\;\;\;\frac{\frac{x}{y}}{t - z}\\
\mathbf{elif}\;t \leq 4 \cdot 10^{-91}:\\
\;\;\;\;\frac{x}{z \cdot \left(z - y\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{t}}{y - z}\\
\end{array}
\end{array}
if t < -4.5000000000000003e-121Initial program 96.3%
Taylor expanded in y around inf 69.4%
associate-/r*67.6%
Simplified67.6%
if -4.5000000000000003e-121 < t < 4.00000000000000009e-91Initial program 92.7%
Taylor expanded in t around 0 83.4%
mul-1-neg83.4%
distribute-rgt-neg-in83.4%
neg-sub083.4%
sub-neg83.4%
+-commutative83.4%
associate--r+83.4%
neg-sub083.4%
remove-double-neg83.4%
Simplified83.4%
if 4.00000000000000009e-91 < t Initial program 84.4%
associate-/l/98.6%
Simplified98.6%
Taylor expanded in t around inf 82.6%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= t -1.6e-57) (/ x (* t (- y z))) (if (<= t 9.5e-92) (/ x (* z (- z y))) (/ (/ x t) (- y z)))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -1.6e-57) {
tmp = x / (t * (y - z));
} else if (t <= 9.5e-92) {
tmp = x / (z * (z - y));
} else {
tmp = (x / t) / (y - z);
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (t <= (-1.6d-57)) then
tmp = x / (t * (y - z))
else if (t <= 9.5d-92) then
tmp = x / (z * (z - y))
else
tmp = (x / t) / (y - z)
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= -1.6e-57) {
tmp = x / (t * (y - z));
} else if (t <= 9.5e-92) {
tmp = x / (z * (z - y));
} else {
tmp = (x / t) / (y - z);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if t <= -1.6e-57: tmp = x / (t * (y - z)) elif t <= 9.5e-92: tmp = x / (z * (z - y)) else: tmp = (x / t) / (y - z) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (t <= -1.6e-57) tmp = Float64(x / Float64(t * Float64(y - z))); elseif (t <= 9.5e-92) tmp = Float64(x / Float64(z * Float64(z - y))); else tmp = Float64(Float64(x / t) / Float64(y - z)); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (t <= -1.6e-57)
tmp = x / (t * (y - z));
elseif (t <= 9.5e-92)
tmp = x / (z * (z - y));
else
tmp = (x / t) / (y - z);
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[t, -1.6e-57], N[(x / N[(t * N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 9.5e-92], N[(x / N[(z * N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / t), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.6 \cdot 10^{-57}:\\
\;\;\;\;\frac{x}{t \cdot \left(y - z\right)}\\
\mathbf{elif}\;t \leq 9.5 \cdot 10^{-92}:\\
\;\;\;\;\frac{x}{z \cdot \left(z - y\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{t}}{y - z}\\
\end{array}
\end{array}
if t < -1.6e-57Initial program 96.3%
Taylor expanded in t around inf 88.4%
if -1.6e-57 < t < 9.49999999999999946e-92Initial program 93.2%
Taylor expanded in t around 0 81.6%
mul-1-neg81.6%
distribute-rgt-neg-in81.6%
neg-sub081.6%
sub-neg81.6%
+-commutative81.6%
associate--r+81.6%
neg-sub081.6%
remove-double-neg81.6%
Simplified81.6%
if 9.49999999999999946e-92 < t Initial program 84.4%
associate-/l/98.6%
Simplified98.6%
Taylor expanded in t around inf 82.6%
Final simplification84.1%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (or (<= z -0.00058) (not (<= z 1.1e+35))) (/ (/ x z) z) (/ (/ x t) y)))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -0.00058) || !(z <= 1.1e+35)) {
tmp = (x / z) / z;
} else {
tmp = (x / t) / y;
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((z <= (-0.00058d0)) .or. (.not. (z <= 1.1d+35))) then
tmp = (x / z) / z
else
tmp = (x / t) / y
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -0.00058) || !(z <= 1.1e+35)) {
tmp = (x / z) / z;
} else {
tmp = (x / t) / y;
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if (z <= -0.00058) or not (z <= 1.1e+35): tmp = (x / z) / z else: tmp = (x / t) / y return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if ((z <= -0.00058) || !(z <= 1.1e+35)) tmp = Float64(Float64(x / z) / z); else tmp = Float64(Float64(x / t) / y); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if ((z <= -0.00058) || ~((z <= 1.1e+35)))
tmp = (x / z) / z;
else
tmp = (x / t) / y;
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[Or[LessEqual[z, -0.00058], N[Not[LessEqual[z, 1.1e+35]], $MachinePrecision]], N[(N[(x / z), $MachinePrecision] / z), $MachinePrecision], N[(N[(x / t), $MachinePrecision] / y), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.00058 \lor \neg \left(z \leq 1.1 \cdot 10^{+35}\right):\\
\;\;\;\;\frac{\frac{x}{z}}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{t}}{y}\\
\end{array}
\end{array}
if z < -5.8e-4 or 1.0999999999999999e35 < z Initial program 89.3%
Taylor expanded in t around 0 79.2%
mul-1-neg79.2%
associate-/r*86.4%
distribute-neg-frac286.4%
neg-sub086.4%
sub-neg86.4%
+-commutative86.4%
associate--r+86.4%
neg-sub086.4%
remove-double-neg86.4%
Simplified86.4%
Taylor expanded in z around inf 77.7%
if -5.8e-4 < z < 1.0999999999999999e35Initial program 93.0%
associate-/l/97.7%
Simplified97.7%
clear-num97.0%
inv-pow97.0%
Applied egg-rr97.0%
unpow-197.0%
Simplified97.0%
Taylor expanded in z around 0 55.5%
associate-/r*62.0%
Simplified62.0%
Final simplification68.7%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (or (<= z -7e-10) (not (<= z 3.3e+125))) (/ x (* t z)) (/ x (* t y))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -7e-10) || !(z <= 3.3e+125)) {
tmp = x / (t * z);
} else {
tmp = x / (t * y);
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((z <= (-7d-10)) .or. (.not. (z <= 3.3d+125))) then
tmp = x / (t * z)
else
tmp = x / (t * y)
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -7e-10) || !(z <= 3.3e+125)) {
tmp = x / (t * z);
} else {
tmp = x / (t * y);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if (z <= -7e-10) or not (z <= 3.3e+125): tmp = x / (t * z) else: tmp = x / (t * y) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if ((z <= -7e-10) || !(z <= 3.3e+125)) tmp = Float64(x / Float64(t * z)); else tmp = Float64(x / Float64(t * y)); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if ((z <= -7e-10) || ~((z <= 3.3e+125)))
tmp = x / (t * z);
else
tmp = x / (t * y);
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[Or[LessEqual[z, -7e-10], N[Not[LessEqual[z, 3.3e+125]], $MachinePrecision]], N[(x / N[(t * z), $MachinePrecision]), $MachinePrecision], N[(x / N[(t * y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -7 \cdot 10^{-10} \lor \neg \left(z \leq 3.3 \cdot 10^{+125}\right):\\
\;\;\;\;\frac{x}{t \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{t \cdot y}\\
\end{array}
\end{array}
if z < -6.99999999999999961e-10 or 3.30000000000000005e125 < z Initial program 87.7%
associate-/l/99.9%
Simplified99.9%
Taylor expanded in t around inf 40.9%
Taylor expanded in y around 0 40.5%
neg-mul-140.5%
Simplified40.5%
add-sqr-sqrt25.1%
sqrt-unprod66.2%
sqr-neg66.2%
sqrt-unprod14.4%
add-sqr-sqrt34.8%
*-un-lft-identity34.8%
associate-/l/35.9%
*-commutative35.9%
Applied egg-rr35.9%
*-lft-identity35.9%
*-commutative35.9%
Simplified35.9%
if -6.99999999999999961e-10 < z < 3.30000000000000005e125Initial program 93.6%
Taylor expanded in z around 0 52.4%
Final simplification46.4%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= t 4.4e+143) (/ x (* (- t z) (- y z))) (/ (/ x t) (- y z))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (t <= 4.4e+143) {
tmp = x / ((t - z) * (y - z));
} else {
tmp = (x / t) / (y - z);
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (t <= 4.4d+143) then
tmp = x / ((t - z) * (y - z))
else
tmp = (x / t) / (y - z)
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= 4.4e+143) {
tmp = x / ((t - z) * (y - z));
} else {
tmp = (x / t) / (y - z);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if t <= 4.4e+143: tmp = x / ((t - z) * (y - z)) else: tmp = (x / t) / (y - z) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (t <= 4.4e+143) tmp = Float64(x / Float64(Float64(t - z) * Float64(y - z))); else tmp = Float64(Float64(x / t) / Float64(y - z)); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (t <= 4.4e+143)
tmp = x / ((t - z) * (y - z));
else
tmp = (x / t) / (y - z);
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[t, 4.4e+143], N[(x / N[(N[(t - z), $MachinePrecision] * N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / t), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq 4.4 \cdot 10^{+143}:\\
\;\;\;\;\frac{x}{\left(t - z\right) \cdot \left(y - z\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{t}}{y - z}\\
\end{array}
\end{array}
if t < 4.40000000000000028e143Initial program 93.6%
if 4.40000000000000028e143 < t Initial program 78.5%
associate-/l/99.8%
Simplified99.8%
Taylor expanded in t around inf 99.8%
Final simplification94.5%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (/ x (* t y)))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
return x / (t * y);
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = x / (t * y)
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
return x / (t * y);
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): return x / (t * y)
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) return Float64(x / Float64(t * y)) end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
tmp = x / (t * y);
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := N[(x / N[(t * y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\frac{x}{t \cdot y}
\end{array}
Initial program 91.5%
Taylor expanded in z around 0 40.3%
(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 2024186
(FPCore (x y z t)
:name "Data.Random.Distribution.Triangular:triangularCDF from random-fu-0.2.6.2, B"
:precision binary64
:alt
(! :herbie-platform default (if (< (/ x (* (- y z) (- t z))) 0) (/ (/ x (- y z)) (- t z)) (* x (/ 1 (* (- y z) (- t z))))))
(/ x (* (- y z) (- t z))))