
(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 90.1%
associate-/l/98.2%
Simplified98.2%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(if (<= z -1.35e+154)
(/ (/ x z) z)
(if (or (<= z -5e-75) (not (<= z 4.7e-42)))
(/ x (* z (- z t)))
(/ (/ x y) t))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.35e+154) {
tmp = (x / z) / z;
} else if ((z <= -5e-75) || !(z <= 4.7e-42)) {
tmp = x / (z * (z - t));
} else {
tmp = (x / y) / t;
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (z <= (-1.35d+154)) then
tmp = (x / z) / z
else if ((z <= (-5d-75)) .or. (.not. (z <= 4.7d-42))) then
tmp = x / (z * (z - t))
else
tmp = (x / y) / t
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.35e+154) {
tmp = (x / z) / z;
} else if ((z <= -5e-75) || !(z <= 4.7e-42)) {
tmp = x / (z * (z - t));
} else {
tmp = (x / y) / t;
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if z <= -1.35e+154: tmp = (x / z) / z elif (z <= -5e-75) or not (z <= 4.7e-42): tmp = x / (z * (z - t)) else: tmp = (x / y) / t return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (z <= -1.35e+154) tmp = Float64(Float64(x / z) / z); elseif ((z <= -5e-75) || !(z <= 4.7e-42)) tmp = Float64(x / Float64(z * Float64(z - t))); else tmp = Float64(Float64(x / y) / t); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (z <= -1.35e+154)
tmp = (x / z) / z;
elseif ((z <= -5e-75) || ~((z <= 4.7e-42)))
tmp = x / (z * (z - t));
else
tmp = (x / y) / t;
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[z, -1.35e+154], N[(N[(x / z), $MachinePrecision] / z), $MachinePrecision], If[Or[LessEqual[z, -5e-75], N[Not[LessEqual[z, 4.7e-42]], $MachinePrecision]], N[(x / N[(z * N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] / t), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.35 \cdot 10^{+154}:\\
\;\;\;\;\frac{\frac{x}{z}}{z}\\
\mathbf{elif}\;z \leq -5 \cdot 10^{-75} \lor \neg \left(z \leq 4.7 \cdot 10^{-42}\right):\\
\;\;\;\;\frac{x}{z \cdot \left(z - t\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{t}\\
\end{array}
\end{array}
if z < -1.35000000000000003e154Initial program 80.7%
Taylor expanded in t around 0 80.7%
mul-1-neg80.7%
associate-/r*95.0%
distribute-neg-frac295.0%
neg-sub095.0%
sub-neg95.0%
+-commutative95.0%
associate--r+95.0%
neg-sub095.0%
remove-double-neg95.0%
Simplified95.0%
Taylor expanded in z around inf 92.5%
if -1.35000000000000003e154 < z < -4.99999999999999979e-75 or 4.7000000000000001e-42 < z Initial program 95.3%
Taylor expanded in y around 0 73.4%
mul-1-neg73.4%
distribute-rgt-neg-in73.4%
sub-neg73.4%
+-commutative73.4%
distribute-neg-in73.4%
remove-double-neg73.4%
unsub-neg73.4%
Simplified73.4%
if -4.99999999999999979e-75 < z < 4.7000000000000001e-42Initial program 87.2%
Taylor expanded in z around 0 68.2%
associate-/r*77.0%
div-inv76.8%
Applied egg-rr76.8%
associate-*l/76.2%
div-inv76.2%
Applied egg-rr76.2%
Final simplification77.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 -1.35e+154)
(/ (/ x z) z)
(if (<= z -4.3e+19)
(/ x (* z (- z t)))
(if (<= z 1.05e-41) (/ (/ 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 (z <= -1.35e+154) {
tmp = (x / z) / z;
} else if (z <= -4.3e+19) {
tmp = x / (z * (z - t));
} else if (z <= 1.05e-41) {
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 (z <= (-1.35d+154)) then
tmp = (x / z) / z
else if (z <= (-4.3d+19)) then
tmp = x / (z * (z - t))
else if (z <= 1.05d-41) 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 (z <= -1.35e+154) {
tmp = (x / z) / z;
} else if (z <= -4.3e+19) {
tmp = x / (z * (z - t));
} else if (z <= 1.05e-41) {
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 z <= -1.35e+154: tmp = (x / z) / z elif z <= -4.3e+19: tmp = x / (z * (z - t)) elif z <= 1.05e-41: 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 (z <= -1.35e+154) tmp = Float64(Float64(x / z) / z); elseif (z <= -4.3e+19) tmp = Float64(x / Float64(z * Float64(z - t))); elseif (z <= 1.05e-41) tmp = Float64(Float64(x / 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 (z <= -1.35e+154)
tmp = (x / z) / z;
elseif (z <= -4.3e+19)
tmp = x / (z * (z - t));
elseif (z <= 1.05e-41)
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[LessEqual[z, -1.35e+154], N[(N[(x / z), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[z, -4.3e+19], N[(x / N[(z * N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.05e-41], N[(N[(x / t), $MachinePrecision] / N[(y - z), $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}\;z \leq -1.35 \cdot 10^{+154}:\\
\;\;\;\;\frac{\frac{x}{z}}{z}\\
\mathbf{elif}\;z \leq -4.3 \cdot 10^{+19}:\\
\;\;\;\;\frac{x}{z \cdot \left(z - t\right)}\\
\mathbf{elif}\;z \leq 1.05 \cdot 10^{-41}:\\
\;\;\;\;\frac{\frac{x}{t}}{y - z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{z \cdot \left(z - y\right)}\\
\end{array}
\end{array}
if z < -1.35000000000000003e154Initial program 80.7%
Taylor expanded in t around 0 80.7%
mul-1-neg80.7%
associate-/r*95.0%
distribute-neg-frac295.0%
neg-sub095.0%
sub-neg95.0%
+-commutative95.0%
associate--r+95.0%
neg-sub095.0%
remove-double-neg95.0%
Simplified95.0%
Taylor expanded in z around inf 92.5%
if -1.35000000000000003e154 < z < -4.3e19Initial program 93.5%
Taylor expanded in y around 0 83.0%
mul-1-neg83.0%
distribute-rgt-neg-in83.0%
sub-neg83.0%
+-commutative83.0%
distribute-neg-in83.0%
remove-double-neg83.0%
unsub-neg83.0%
Simplified83.0%
if -4.3e19 < z < 1.05000000000000006e-41Initial program 89.6%
associate-/l/96.4%
Simplified96.4%
Taylor expanded in t around inf 79.1%
if 1.05000000000000006e-41 < z Initial program 94.9%
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%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(if (<= z -1.35e+154)
(/ (/ x z) z)
(if (<= z -3.6e-74)
(/ x (* z (- z t)))
(if (<= z 1.6e-43) (/ (/ x y) t) (/ x (* z (- z y)))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.35e+154) {
tmp = (x / z) / z;
} else if (z <= -3.6e-74) {
tmp = x / (z * (z - t));
} else if (z <= 1.6e-43) {
tmp = (x / y) / t;
} 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 (z <= (-1.35d+154)) then
tmp = (x / z) / z
else if (z <= (-3.6d-74)) then
tmp = x / (z * (z - t))
else if (z <= 1.6d-43) then
tmp = (x / y) / t
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 (z <= -1.35e+154) {
tmp = (x / z) / z;
} else if (z <= -3.6e-74) {
tmp = x / (z * (z - t));
} else if (z <= 1.6e-43) {
tmp = (x / y) / t;
} 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 z <= -1.35e+154: tmp = (x / z) / z elif z <= -3.6e-74: tmp = x / (z * (z - t)) elif z <= 1.6e-43: tmp = (x / y) / t 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 (z <= -1.35e+154) tmp = Float64(Float64(x / z) / z); elseif (z <= -3.6e-74) tmp = Float64(x / Float64(z * Float64(z - t))); elseif (z <= 1.6e-43) tmp = Float64(Float64(x / y) / t); 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 (z <= -1.35e+154)
tmp = (x / z) / z;
elseif (z <= -3.6e-74)
tmp = x / (z * (z - t));
elseif (z <= 1.6e-43)
tmp = (x / y) / t;
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[LessEqual[z, -1.35e+154], N[(N[(x / z), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[z, -3.6e-74], N[(x / N[(z * N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.6e-43], N[(N[(x / y), $MachinePrecision] / t), $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}\;z \leq -1.35 \cdot 10^{+154}:\\
\;\;\;\;\frac{\frac{x}{z}}{z}\\
\mathbf{elif}\;z \leq -3.6 \cdot 10^{-74}:\\
\;\;\;\;\frac{x}{z \cdot \left(z - t\right)}\\
\mathbf{elif}\;z \leq 1.6 \cdot 10^{-43}:\\
\;\;\;\;\frac{\frac{x}{y}}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{z \cdot \left(z - y\right)}\\
\end{array}
\end{array}
if z < -1.35000000000000003e154Initial program 80.7%
Taylor expanded in t around 0 80.7%
mul-1-neg80.7%
associate-/r*95.0%
distribute-neg-frac295.0%
neg-sub095.0%
sub-neg95.0%
+-commutative95.0%
associate--r+95.0%
neg-sub095.0%
remove-double-neg95.0%
Simplified95.0%
Taylor expanded in z around inf 92.5%
if -1.35000000000000003e154 < z < -3.6000000000000002e-74Initial program 95.5%
Taylor expanded in y around 0 67.7%
mul-1-neg67.7%
distribute-rgt-neg-in67.7%
sub-neg67.7%
+-commutative67.7%
distribute-neg-in67.7%
remove-double-neg67.7%
unsub-neg67.7%
Simplified67.7%
if -3.6000000000000002e-74 < z < 1.59999999999999992e-43Initial program 87.0%
Taylor expanded in z around 0 68.9%
associate-/r*77.7%
div-inv77.6%
Applied egg-rr77.6%
associate-*l/76.9%
div-inv77.0%
Applied egg-rr77.0%
if 1.59999999999999992e-43 < z Initial program 95.1%
Taylor expanded in t around 0 79.0%
mul-1-neg79.0%
distribute-rgt-neg-in79.0%
neg-sub079.0%
sub-neg79.0%
+-commutative79.0%
associate--r+79.0%
neg-sub079.0%
remove-double-neg79.0%
Simplified79.0%
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 -1.3e+22)
t_1
(if (<= z 2.6e-42)
(/ (/ x y) t)
(if (<= z 1.05e+26) (/ x (* z (- 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 <= -1.3e+22) {
tmp = t_1;
} else if (z <= 2.6e-42) {
tmp = (x / y) / t;
} else if (z <= 1.05e+26) {
tmp = x / (z * -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 <= (-1.3d+22)) then
tmp = t_1
else if (z <= 2.6d-42) then
tmp = (x / y) / t
else if (z <= 1.05d+26) then
tmp = x / (z * -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 <= -1.3e+22) {
tmp = t_1;
} else if (z <= 2.6e-42) {
tmp = (x / y) / t;
} else if (z <= 1.05e+26) {
tmp = x / (z * -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 <= -1.3e+22: tmp = t_1 elif z <= 2.6e-42: tmp = (x / y) / t elif z <= 1.05e+26: tmp = x / (z * -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 <= -1.3e+22) tmp = t_1; elseif (z <= 2.6e-42) tmp = Float64(Float64(x / y) / t); elseif (z <= 1.05e+26) tmp = Float64(x / Float64(z * Float64(-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 <= -1.3e+22)
tmp = t_1;
elseif (z <= 2.6e-42)
tmp = (x / y) / t;
elseif (z <= 1.05e+26)
tmp = x / (z * -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, -1.3e+22], t$95$1, If[LessEqual[z, 2.6e-42], N[(N[(x / y), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[z, 1.05e+26], N[(x / N[(z * (-y)), $MachinePrecision]), $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 -1.3 \cdot 10^{+22}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 2.6 \cdot 10^{-42}:\\
\;\;\;\;\frac{\frac{x}{y}}{t}\\
\mathbf{elif}\;z \leq 1.05 \cdot 10^{+26}:\\
\;\;\;\;\frac{x}{z \cdot \left(-y\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.3e22 or 1.05e26 < z Initial program 89.7%
Taylor expanded in t around 0 80.3%
mul-1-neg80.3%
associate-/r*86.1%
distribute-neg-frac286.1%
neg-sub086.1%
sub-neg86.1%
+-commutative86.1%
associate--r+86.1%
neg-sub086.1%
remove-double-neg86.1%
Simplified86.1%
Taylor expanded in z around inf 79.5%
if -1.3e22 < z < 2.6e-42Initial program 89.4%
Taylor expanded in z around 0 64.9%
associate-/r*72.1%
div-inv71.9%
Applied egg-rr71.9%
associate-*l/71.4%
div-inv71.4%
Applied egg-rr71.4%
if 2.6e-42 < z < 1.05e26Initial program 99.6%
Taylor expanded in t around 0 59.4%
mul-1-neg59.4%
associate-/r*59.4%
distribute-neg-frac259.4%
neg-sub059.4%
sub-neg59.4%
+-commutative59.4%
associate--r+59.4%
neg-sub059.4%
remove-double-neg59.4%
Simplified59.4%
Taylor expanded in z around 0 38.3%
associate-*r/38.3%
neg-mul-138.3%
*-commutative38.3%
Simplified38.3%
Final simplification73.6%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= y -1.45e-78) (/ (/ x (- t z)) y) (if (<= y 1.26e-194) (/ (/ x z) (- z t)) (/ (/ x t) (- y z)))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.45e-78) {
tmp = (x / (t - z)) / y;
} else if (y <= 1.26e-194) {
tmp = (x / z) / (z - t);
} else {
tmp = (x / t) / (y - z);
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= (-1.45d-78)) then
tmp = (x / (t - z)) / y
else if (y <= 1.26d-194) then
tmp = (x / z) / (z - t)
else
tmp = (x / t) / (y - z)
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.45e-78) {
tmp = (x / (t - z)) / y;
} else if (y <= 1.26e-194) {
tmp = (x / z) / (z - t);
} else {
tmp = (x / t) / (y - z);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if y <= -1.45e-78: tmp = (x / (t - z)) / y elif y <= 1.26e-194: tmp = (x / z) / (z - t) else: tmp = (x / t) / (y - z) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (y <= -1.45e-78) tmp = Float64(Float64(x / Float64(t - z)) / y); elseif (y <= 1.26e-194) tmp = Float64(Float64(x / z) / Float64(z - t)); 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 (y <= -1.45e-78)
tmp = (x / (t - z)) / y;
elseif (y <= 1.26e-194)
tmp = (x / z) / (z - t);
else
tmp = (x / t) / (y - z);
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[y, -1.45e-78], N[(N[(x / N[(t - z), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision], If[LessEqual[y, 1.26e-194], N[(N[(x / z), $MachinePrecision] / N[(z - t), $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}\;y \leq -1.45 \cdot 10^{-78}:\\
\;\;\;\;\frac{\frac{x}{t - z}}{y}\\
\mathbf{elif}\;y \leq 1.26 \cdot 10^{-194}:\\
\;\;\;\;\frac{\frac{x}{z}}{z - t}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{t}}{y - z}\\
\end{array}
\end{array}
if y < -1.45e-78Initial program 89.8%
associate-/l/96.5%
Simplified96.5%
Taylor expanded in y around inf 88.6%
if -1.45e-78 < y < 1.26e-194Initial program 89.4%
Taylor expanded in y around 0 79.1%
mul-1-neg79.1%
associate-/r*84.4%
distribute-neg-frac284.4%
sub-neg84.4%
+-commutative84.4%
distribute-neg-in84.4%
remove-double-neg84.4%
unsub-neg84.4%
Simplified84.4%
if 1.26e-194 < y Initial program 90.9%
associate-/l/98.5%
Simplified98.5%
Taylor expanded in t around inf 60.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 (<= y -6.8e-78) (/ (/ x y) (- t z)) (if (<= y 7.2e-195) (/ (/ x z) (- z t)) (/ (/ x t) (- y z)))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -6.8e-78) {
tmp = (x / y) / (t - z);
} else if (y <= 7.2e-195) {
tmp = (x / z) / (z - t);
} else {
tmp = (x / t) / (y - z);
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= (-6.8d-78)) then
tmp = (x / y) / (t - z)
else if (y <= 7.2d-195) then
tmp = (x / z) / (z - t)
else
tmp = (x / t) / (y - z)
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -6.8e-78) {
tmp = (x / y) / (t - z);
} else if (y <= 7.2e-195) {
tmp = (x / z) / (z - t);
} else {
tmp = (x / t) / (y - z);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if y <= -6.8e-78: tmp = (x / y) / (t - z) elif y <= 7.2e-195: tmp = (x / z) / (z - t) else: tmp = (x / t) / (y - z) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (y <= -6.8e-78) tmp = Float64(Float64(x / y) / Float64(t - z)); elseif (y <= 7.2e-195) tmp = Float64(Float64(x / z) / Float64(z - t)); 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 (y <= -6.8e-78)
tmp = (x / y) / (t - z);
elseif (y <= 7.2e-195)
tmp = (x / z) / (z - t);
else
tmp = (x / t) / (y - z);
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[y, -6.8e-78], N[(N[(x / y), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 7.2e-195], N[(N[(x / z), $MachinePrecision] / N[(z - t), $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}\;y \leq -6.8 \cdot 10^{-78}:\\
\;\;\;\;\frac{\frac{x}{y}}{t - z}\\
\mathbf{elif}\;y \leq 7.2 \cdot 10^{-195}:\\
\;\;\;\;\frac{\frac{x}{z}}{z - t}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{t}}{y - z}\\
\end{array}
\end{array}
if y < -6.80000000000000023e-78Initial program 89.8%
Taylor expanded in y around inf 83.2%
associate-/r*87.9%
Simplified87.9%
if -6.80000000000000023e-78 < y < 7.2e-195Initial program 89.4%
Taylor expanded in y around 0 79.1%
mul-1-neg79.1%
associate-/r*84.4%
distribute-neg-frac284.4%
sub-neg84.4%
+-commutative84.4%
distribute-neg-in84.4%
remove-double-neg84.4%
unsub-neg84.4%
Simplified84.4%
if 7.2e-195 < y Initial program 90.9%
associate-/l/98.5%
Simplified98.5%
Taylor expanded in t around inf 60.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 (<= y -1.35e-79) (/ (/ x y) (- t z)) (if (<= y 1.26e-194) (/ x (* z (- z t))) (/ (/ x t) (- y z)))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.35e-79) {
tmp = (x / y) / (t - z);
} else if (y <= 1.26e-194) {
tmp = x / (z * (z - t));
} else {
tmp = (x / t) / (y - z);
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= (-1.35d-79)) then
tmp = (x / y) / (t - z)
else if (y <= 1.26d-194) then
tmp = x / (z * (z - t))
else
tmp = (x / t) / (y - z)
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.35e-79) {
tmp = (x / y) / (t - z);
} else if (y <= 1.26e-194) {
tmp = x / (z * (z - t));
} else {
tmp = (x / t) / (y - z);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if y <= -1.35e-79: tmp = (x / y) / (t - z) elif y <= 1.26e-194: tmp = x / (z * (z - t)) else: tmp = (x / t) / (y - z) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (y <= -1.35e-79) tmp = Float64(Float64(x / y) / Float64(t - z)); elseif (y <= 1.26e-194) tmp = Float64(x / Float64(z * Float64(z - t))); 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 (y <= -1.35e-79)
tmp = (x / y) / (t - z);
elseif (y <= 1.26e-194)
tmp = x / (z * (z - t));
else
tmp = (x / t) / (y - z);
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[y, -1.35e-79], N[(N[(x / y), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.26e-194], N[(x / N[(z * N[(z - t), $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}\;y \leq -1.35 \cdot 10^{-79}:\\
\;\;\;\;\frac{\frac{x}{y}}{t - z}\\
\mathbf{elif}\;y \leq 1.26 \cdot 10^{-194}:\\
\;\;\;\;\frac{x}{z \cdot \left(z - t\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{t}}{y - z}\\
\end{array}
\end{array}
if y < -1.3500000000000001e-79Initial program 89.8%
Taylor expanded in y around inf 83.2%
associate-/r*87.9%
Simplified87.9%
if -1.3500000000000001e-79 < y < 1.26e-194Initial program 89.4%
Taylor expanded in y around 0 79.1%
mul-1-neg79.1%
distribute-rgt-neg-in79.1%
sub-neg79.1%
+-commutative79.1%
distribute-neg-in79.1%
remove-double-neg79.1%
unsub-neg79.1%
Simplified79.1%
if 1.26e-194 < y Initial program 90.9%
associate-/l/98.5%
Simplified98.5%
Taylor expanded in t around inf 60.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 -2.2e+20) (not (<= z 7.8e+24))) (/ (/ 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 <= -2.2e+20) || !(z <= 7.8e+24)) {
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 <= (-2.2d+20)) .or. (.not. (z <= 7.8d+24))) 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 <= -2.2e+20) || !(z <= 7.8e+24)) {
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 <= -2.2e+20) or not (z <= 7.8e+24): 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 <= -2.2e+20) || !(z <= 7.8e+24)) 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 <= -2.2e+20) || ~((z <= 7.8e+24)))
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, -2.2e+20], N[Not[LessEqual[z, 7.8e+24]], $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 -2.2 \cdot 10^{+20} \lor \neg \left(z \leq 7.8 \cdot 10^{+24}\right):\\
\;\;\;\;\frac{\frac{x}{z}}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{t}}{y}\\
\end{array}
\end{array}
if z < -2.2e20 or 7.7999999999999995e24 < z Initial program 89.8%
Taylor expanded in t around 0 80.5%
mul-1-neg80.5%
associate-/r*86.2%
distribute-neg-frac286.2%
neg-sub086.2%
sub-neg86.2%
+-commutative86.2%
associate--r+86.2%
neg-sub086.2%
remove-double-neg86.2%
Simplified86.2%
Taylor expanded in z around inf 78.9%
if -2.2e20 < z < 7.7999999999999995e24Initial program 90.5%
associate-/l/96.5%
Simplified96.5%
Taylor expanded in t around inf 76.3%
Taylor expanded in y around inf 68.4%
Final simplification73.6%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (or (<= z -3.6e+22) (not (<= z 2.1e+23))) (/ 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 <= -3.6e+22) || !(z <= 2.1e+23)) {
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 <= (-3.6d+22)) .or. (.not. (z <= 2.1d+23))) 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 <= -3.6e+22) || !(z <= 2.1e+23)) {
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 <= -3.6e+22) or not (z <= 2.1e+23): 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 <= -3.6e+22) || !(z <= 2.1e+23)) tmp = Float64(x / Float64(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 <= -3.6e+22) || ~((z <= 2.1e+23)))
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, -3.6e+22], N[Not[LessEqual[z, 2.1e+23]], $MachinePrecision]], N[(x / N[(z * z), $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 -3.6 \cdot 10^{+22} \lor \neg \left(z \leq 2.1 \cdot 10^{+23}\right):\\
\;\;\;\;\frac{x}{z \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{t}}{y}\\
\end{array}
\end{array}
if z < -3.6e22 or 2.1000000000000001e23 < z Initial program 89.8%
Taylor expanded in y around 0 83.2%
mul-1-neg83.2%
distribute-rgt-neg-in83.2%
sub-neg83.2%
+-commutative83.2%
distribute-neg-in83.2%
remove-double-neg83.2%
unsub-neg83.2%
Simplified83.2%
Taylor expanded in z around inf 75.2%
if -3.6e22 < z < 2.1000000000000001e23Initial program 90.5%
associate-/l/96.5%
Simplified96.5%
Taylor expanded in t around inf 76.3%
Taylor expanded in y around inf 68.4%
Final simplification71.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 (or (<= z -2.2e+21) (not (<= z 4.8e+24))) (/ 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 <= -2.2e+21) || !(z <= 4.8e+24)) {
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 <= (-2.2d+21)) .or. (.not. (z <= 4.8d+24))) 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 <= -2.2e+21) || !(z <= 4.8e+24)) {
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 <= -2.2e+21) or not (z <= 4.8e+24): 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 <= -2.2e+21) || !(z <= 4.8e+24)) tmp = Float64(x / Float64(z * z)); else tmp = Float64(x / Float64(t * y)); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if ((z <= -2.2e+21) || ~((z <= 4.8e+24)))
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, -2.2e+21], N[Not[LessEqual[z, 4.8e+24]], $MachinePrecision]], N[(x / N[(z * z), $MachinePrecision]), $MachinePrecision], N[(x / N[(t * y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.2 \cdot 10^{+21} \lor \neg \left(z \leq 4.8 \cdot 10^{+24}\right):\\
\;\;\;\;\frac{x}{z \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{t \cdot y}\\
\end{array}
\end{array}
if z < -2.2e21 or 4.8000000000000001e24 < z Initial program 89.8%
Taylor expanded in y around 0 83.2%
mul-1-neg83.2%
distribute-rgt-neg-in83.2%
sub-neg83.2%
+-commutative83.2%
distribute-neg-in83.2%
remove-double-neg83.2%
unsub-neg83.2%
Simplified83.2%
Taylor expanded in z around inf 75.2%
if -2.2e21 < z < 4.8000000000000001e24Initial program 90.5%
Taylor expanded in z around 0 61.2%
Final simplification68.2%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (or (<= z -4.6e+69) (not (<= z 5.8e+98))) (/ 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 <= -4.6e+69) || !(z <= 5.8e+98)) {
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 <= (-4.6d+69)) .or. (.not. (z <= 5.8d+98))) 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 <= -4.6e+69) || !(z <= 5.8e+98)) {
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 <= -4.6e+69) or not (z <= 5.8e+98): 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 <= -4.6e+69) || !(z <= 5.8e+98)) 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 <= -4.6e+69) || ~((z <= 5.8e+98)))
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, -4.6e+69], N[Not[LessEqual[z, 5.8e+98]], $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 -4.6 \cdot 10^{+69} \lor \neg \left(z \leq 5.8 \cdot 10^{+98}\right):\\
\;\;\;\;\frac{x}{t \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{t \cdot y}\\
\end{array}
\end{array}
if z < -4.60000000000000033e69 or 5.8000000000000002e98 < z Initial program 87.6%
associate-/l/100.0%
Simplified100.0%
Taylor expanded in t around inf 43.8%
Taylor expanded in y around 0 38.5%
neg-mul-138.5%
Simplified38.5%
add-sqr-sqrt24.5%
div-inv24.5%
sqrt-unprod61.6%
sqr-neg61.6%
sqrt-unprod12.5%
add-sqr-sqrt34.1%
associate-/l*38.9%
Applied egg-rr38.9%
associate-/l/38.9%
associate-*r/38.9%
*-rgt-identity38.9%
*-commutative38.9%
Simplified38.9%
if -4.60000000000000033e69 < z < 5.8000000000000002e98Initial program 91.9%
Taylor expanded in z around 0 57.4%
Final simplification49.9%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= y -1.18e+176) (/ (/ x y) (- t z)) (/ x (* (- t z) (- y z)))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.18e+176) {
tmp = (x / y) / (t - z);
} else {
tmp = x / ((t - z) * (y - z));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= (-1.18d+176)) then
tmp = (x / y) / (t - z)
else
tmp = x / ((t - z) * (y - z))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.18e+176) {
tmp = (x / y) / (t - z);
} else {
tmp = x / ((t - z) * (y - z));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if y <= -1.18e+176: tmp = (x / y) / (t - z) else: tmp = x / ((t - z) * (y - z)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (y <= -1.18e+176) tmp = Float64(Float64(x / y) / Float64(t - z)); else tmp = Float64(x / Float64(Float64(t - z) * Float64(y - z))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (y <= -1.18e+176)
tmp = (x / y) / (t - z);
else
tmp = x / ((t - z) * (y - z));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[y, -1.18e+176], N[(N[(x / y), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], N[(x / N[(N[(t - z), $MachinePrecision] * N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.18 \cdot 10^{+176}:\\
\;\;\;\;\frac{\frac{x}{y}}{t - z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\left(t - z\right) \cdot \left(y - z\right)}\\
\end{array}
\end{array}
if y < -1.18000000000000006e176Initial program 87.6%
Taylor expanded in y around inf 87.6%
associate-/r*96.8%
Simplified96.8%
if -1.18000000000000006e176 < y Initial program 90.5%
Final simplification91.2%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (/ x (* 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 90.1%
Taylor expanded in z around 0 44.8%
(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 2024137
(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))))