
(FPCore (x y z t) :precision binary64 (/ x (* (- y z) (- t z))))
double code(double x, double y, double z, double t) {
return x / ((y - z) * (t - z));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = x / ((y - z) * (t - z))
end function
public static double code(double x, double y, double z, double t) {
return x / ((y - z) * (t - z));
}
def code(x, y, z, t): return x / ((y - z) * (t - z))
function code(x, y, z, t) return Float64(x / Float64(Float64(y - z) * Float64(t - z))) end
function tmp = code(x, y, z, t) tmp = x / ((y - z) * (t - z)); end
code[x_, y_, z_, t_] := N[(x / N[(N[(y - z), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{\left(y - z\right) \cdot \left(t - z\right)}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 19 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (/ x (* (- y z) (- t z))))
double code(double x, double y, double z, double t) {
return x / ((y - z) * (t - z));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = x / ((y - z) * (t - z))
end function
public static double code(double x, double y, double z, double t) {
return x / ((y - z) * (t - z));
}
def code(x, y, z, t): return x / ((y - z) * (t - z))
function code(x, y, z, t) return Float64(x / Float64(Float64(y - z) * Float64(t - z))) end
function tmp = code(x, y, z, t) tmp = x / ((y - z) * (t - z)); end
code[x_, y_, z_, t_] := N[(x / N[(N[(y - z), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{\left(y - z\right) \cdot \left(t - z\right)}
\end{array}
NOTE: 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 89.7%
associate-/r*98.1%
div-inv98.1%
Applied egg-rr98.1%
associate-*l/97.2%
div-inv97.2%
Applied egg-rr97.2%
Final simplification97.2%
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)))
(if (<= y -1e+43)
(/ (/ x y) (- t z))
(if (<= y -1.45e-12)
(/ t_1 (- y z))
(if (<= y -3.5e-43)
(/ x (* (- t z) y))
(if (<= y 1.3e-57) (/ t_1 (- t z)) (/ (/ x t) (- y z))))))))assert(y < t);
double code(double x, double y, double z, double t) {
double t_1 = -x / z;
double tmp;
if (y <= -1e+43) {
tmp = (x / y) / (t - z);
} else if (y <= -1.45e-12) {
tmp = t_1 / (y - z);
} else if (y <= -3.5e-43) {
tmp = x / ((t - z) * y);
} else if (y <= 1.3e-57) {
tmp = t_1 / (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) :: t_1
real(8) :: tmp
t_1 = -x / z
if (y <= (-1d+43)) then
tmp = (x / y) / (t - z)
else if (y <= (-1.45d-12)) then
tmp = t_1 / (y - z)
else if (y <= (-3.5d-43)) then
tmp = x / ((t - z) * y)
else if (y <= 1.3d-57) then
tmp = t_1 / (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 t_1 = -x / z;
double tmp;
if (y <= -1e+43) {
tmp = (x / y) / (t - z);
} else if (y <= -1.45e-12) {
tmp = t_1 / (y - z);
} else if (y <= -3.5e-43) {
tmp = x / ((t - z) * y);
} else if (y <= 1.3e-57) {
tmp = t_1 / (t - z);
} else {
tmp = (x / t) / (y - z);
}
return tmp;
}
[y, t] = sort([y, t]) def code(x, y, z, t): t_1 = -x / z tmp = 0 if y <= -1e+43: tmp = (x / y) / (t - z) elif y <= -1.45e-12: tmp = t_1 / (y - z) elif y <= -3.5e-43: tmp = x / ((t - z) * y) elif y <= 1.3e-57: tmp = t_1 / (t - z) 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) tmp = 0.0 if (y <= -1e+43) tmp = Float64(Float64(x / y) / Float64(t - z)); elseif (y <= -1.45e-12) tmp = Float64(t_1 / Float64(y - z)); elseif (y <= -3.5e-43) tmp = Float64(x / Float64(Float64(t - z) * y)); elseif (y <= 1.3e-57) tmp = Float64(t_1 / 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)
t_1 = -x / z;
tmp = 0.0;
if (y <= -1e+43)
tmp = (x / y) / (t - z);
elseif (y <= -1.45e-12)
tmp = t_1 / (y - z);
elseif (y <= -3.5e-43)
tmp = x / ((t - z) * y);
elseif (y <= 1.3e-57)
tmp = t_1 / (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_] := Block[{t$95$1 = N[((-x) / z), $MachinePrecision]}, If[LessEqual[y, -1e+43], N[(N[(x / y), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -1.45e-12], N[(t$95$1 / N[(y - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -3.5e-43], N[(x / N[(N[(t - z), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.3e-57], N[(t$95$1 / 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}
t_1 := \frac{-x}{z}\\
\mathbf{if}\;y \leq -1 \cdot 10^{+43}:\\
\;\;\;\;\frac{\frac{x}{y}}{t - z}\\
\mathbf{elif}\;y \leq -1.45 \cdot 10^{-12}:\\
\;\;\;\;\frac{t_1}{y - z}\\
\mathbf{elif}\;y \leq -3.5 \cdot 10^{-43}:\\
\;\;\;\;\frac{x}{\left(t - z\right) \cdot y}\\
\mathbf{elif}\;y \leq 1.3 \cdot 10^{-57}:\\
\;\;\;\;\frac{t_1}{t - z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{t}}{y - z}\\
\end{array}
\end{array}
if y < -1.00000000000000001e43Initial program 84.0%
associate-/r*97.8%
Simplified97.8%
Taylor expanded in y around inf 91.4%
if -1.00000000000000001e43 < y < -1.4500000000000001e-12Initial program 100.0%
Taylor expanded in t around 0 68.5%
associate-*r/68.5%
neg-mul-168.5%
*-commutative68.5%
associate-/r*68.4%
Simplified68.4%
if -1.4500000000000001e-12 < y < -3.49999999999999997e-43Initial program 99.6%
Taylor expanded in y around inf 99.6%
*-commutative99.6%
Simplified99.6%
if -3.49999999999999997e-43 < y < 1.29999999999999993e-57Initial program 91.3%
Taylor expanded in y around 0 75.4%
mul-1-neg75.4%
distribute-frac-neg75.4%
associate-/r*81.8%
Simplified81.8%
if 1.29999999999999993e-57 < y Initial program 90.5%
Taylor expanded in t around inf 56.6%
associate-/r*61.3%
Simplified61.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
(let* ((t_1 (/ (- x) z)))
(if (<= y -5.8e+42)
(/ 1.0 (/ y (/ x (- t z))))
(if (<= y -3.5e-13)
(/ t_1 (- y z))
(if (<= y -3.5e-43)
(/ x (* (- t z) y))
(if (<= y 2.55e-58) (/ t_1 (- t z)) (/ (/ x t) (- y z))))))))assert(y < t);
double code(double x, double y, double z, double t) {
double t_1 = -x / z;
double tmp;
if (y <= -5.8e+42) {
tmp = 1.0 / (y / (x / (t - z)));
} else if (y <= -3.5e-13) {
tmp = t_1 / (y - z);
} else if (y <= -3.5e-43) {
tmp = x / ((t - z) * y);
} else if (y <= 2.55e-58) {
tmp = t_1 / (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) :: t_1
real(8) :: tmp
t_1 = -x / z
if (y <= (-5.8d+42)) then
tmp = 1.0d0 / (y / (x / (t - z)))
else if (y <= (-3.5d-13)) then
tmp = t_1 / (y - z)
else if (y <= (-3.5d-43)) then
tmp = x / ((t - z) * y)
else if (y <= 2.55d-58) then
tmp = t_1 / (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 t_1 = -x / z;
double tmp;
if (y <= -5.8e+42) {
tmp = 1.0 / (y / (x / (t - z)));
} else if (y <= -3.5e-13) {
tmp = t_1 / (y - z);
} else if (y <= -3.5e-43) {
tmp = x / ((t - z) * y);
} else if (y <= 2.55e-58) {
tmp = t_1 / (t - z);
} else {
tmp = (x / t) / (y - z);
}
return tmp;
}
[y, t] = sort([y, t]) def code(x, y, z, t): t_1 = -x / z tmp = 0 if y <= -5.8e+42: tmp = 1.0 / (y / (x / (t - z))) elif y <= -3.5e-13: tmp = t_1 / (y - z) elif y <= -3.5e-43: tmp = x / ((t - z) * y) elif y <= 2.55e-58: tmp = t_1 / (t - z) 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) tmp = 0.0 if (y <= -5.8e+42) tmp = Float64(1.0 / Float64(y / Float64(x / Float64(t - z)))); elseif (y <= -3.5e-13) tmp = Float64(t_1 / Float64(y - z)); elseif (y <= -3.5e-43) tmp = Float64(x / Float64(Float64(t - z) * y)); elseif (y <= 2.55e-58) tmp = Float64(t_1 / 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)
t_1 = -x / z;
tmp = 0.0;
if (y <= -5.8e+42)
tmp = 1.0 / (y / (x / (t - z)));
elseif (y <= -3.5e-13)
tmp = t_1 / (y - z);
elseif (y <= -3.5e-43)
tmp = x / ((t - z) * y);
elseif (y <= 2.55e-58)
tmp = t_1 / (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_] := Block[{t$95$1 = N[((-x) / z), $MachinePrecision]}, If[LessEqual[y, -5.8e+42], N[(1.0 / N[(y / N[(x / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -3.5e-13], N[(t$95$1 / N[(y - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -3.5e-43], N[(x / N[(N[(t - z), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.55e-58], N[(t$95$1 / 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}
t_1 := \frac{-x}{z}\\
\mathbf{if}\;y \leq -5.8 \cdot 10^{+42}:\\
\;\;\;\;\frac{1}{\frac{y}{\frac{x}{t - z}}}\\
\mathbf{elif}\;y \leq -3.5 \cdot 10^{-13}:\\
\;\;\;\;\frac{t_1}{y - z}\\
\mathbf{elif}\;y \leq -3.5 \cdot 10^{-43}:\\
\;\;\;\;\frac{x}{\left(t - z\right) \cdot y}\\
\mathbf{elif}\;y \leq 2.55 \cdot 10^{-58}:\\
\;\;\;\;\frac{t_1}{t - z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{t}}{y - z}\\
\end{array}
\end{array}
if y < -5.79999999999999961e42Initial program 84.0%
Taylor expanded in y around inf 84.0%
*-commutative84.0%
Simplified84.0%
clear-num83.9%
inv-pow83.9%
*-commutative83.9%
Applied egg-rr83.9%
unpow-183.9%
associate-/l*92.0%
Simplified92.0%
if -5.79999999999999961e42 < y < -3.5000000000000002e-13Initial program 100.0%
Taylor expanded in t around 0 68.5%
associate-*r/68.5%
neg-mul-168.5%
*-commutative68.5%
associate-/r*68.4%
Simplified68.4%
if -3.5000000000000002e-13 < y < -3.49999999999999997e-43Initial program 99.6%
Taylor expanded in y around inf 99.6%
*-commutative99.6%
Simplified99.6%
if -3.49999999999999997e-43 < y < 2.55e-58Initial program 91.3%
Taylor expanded in y around 0 75.4%
mul-1-neg75.4%
distribute-frac-neg75.4%
associate-/r*81.8%
Simplified81.8%
if 2.55e-58 < y Initial program 90.5%
Taylor expanded in t around inf 56.6%
associate-/r*61.3%
Simplified61.3%
Final simplification77.6%
NOTE: y and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ (/ x z) z)))
(if (<= z -1.5e+47)
t_1
(if (<= z -6.5e-12)
(/ (- (/ x y)) z)
(if (<= z 2.8e+65) (/ 1.0 (* t (/ y x))) t_1)))))assert(y < t);
double code(double x, double y, double z, double t) {
double t_1 = (x / z) / z;
double tmp;
if (z <= -1.5e+47) {
tmp = t_1;
} else if (z <= -6.5e-12) {
tmp = -(x / y) / z;
} else if (z <= 2.8e+65) {
tmp = 1.0 / (t * (y / x));
} else {
tmp = t_1;
}
return tmp;
}
NOTE: y and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = (x / z) / z
if (z <= (-1.5d+47)) then
tmp = t_1
else if (z <= (-6.5d-12)) then
tmp = -(x / y) / z
else if (z <= 2.8d+65) then
tmp = 1.0d0 / (t * (y / x))
else
tmp = t_1
end if
code = tmp
end function
assert y < t;
public static double code(double x, double y, double z, double t) {
double t_1 = (x / z) / z;
double tmp;
if (z <= -1.5e+47) {
tmp = t_1;
} else if (z <= -6.5e-12) {
tmp = -(x / y) / z;
} else if (z <= 2.8e+65) {
tmp = 1.0 / (t * (y / x));
} else {
tmp = t_1;
}
return tmp;
}
[y, t] = sort([y, t]) def code(x, y, z, t): t_1 = (x / z) / z tmp = 0 if z <= -1.5e+47: tmp = t_1 elif z <= -6.5e-12: tmp = -(x / y) / z elif z <= 2.8e+65: tmp = 1.0 / (t * (y / x)) else: tmp = t_1 return tmp
y, t = sort([y, t]) function code(x, y, z, t) t_1 = Float64(Float64(x / z) / z) tmp = 0.0 if (z <= -1.5e+47) tmp = t_1; elseif (z <= -6.5e-12) tmp = Float64(Float64(-Float64(x / y)) / z); elseif (z <= 2.8e+65) tmp = Float64(1.0 / Float64(t * Float64(y / x))); else tmp = t_1; end return tmp end
y, t = num2cell(sort([y, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = (x / z) / z;
tmp = 0.0;
if (z <= -1.5e+47)
tmp = t_1;
elseif (z <= -6.5e-12)
tmp = -(x / y) / z;
elseif (z <= 2.8e+65)
tmp = 1.0 / (t * (y / x));
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]}, If[LessEqual[z, -1.5e+47], t$95$1, If[LessEqual[z, -6.5e-12], N[((-N[(x / y), $MachinePrecision]) / z), $MachinePrecision], If[LessEqual[z, 2.8e+65], N[(1.0 / N[(t * N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
[y, t] = \mathsf{sort}([y, t])\\
\\
\begin{array}{l}
t_1 := \frac{\frac{x}{z}}{z}\\
\mathbf{if}\;z \leq -1.5 \cdot 10^{+47}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -6.5 \cdot 10^{-12}:\\
\;\;\;\;\frac{-\frac{x}{y}}{z}\\
\mathbf{elif}\;z \leq 2.8 \cdot 10^{+65}:\\
\;\;\;\;\frac{1}{t \cdot \frac{y}{x}}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -1.5000000000000001e47 or 2.7999999999999999e65 < z Initial program 85.1%
Taylor expanded in z around inf 76.0%
unpow276.0%
associate-/r*79.9%
Simplified79.9%
if -1.5000000000000001e47 < z < -6.5000000000000002e-12Initial program 99.6%
Taylor expanded in y around inf 59.3%
*-commutative59.3%
Simplified59.3%
Taylor expanded in t around 0 52.9%
mul-1-neg52.9%
associate-/r*52.7%
distribute-neg-frac52.7%
Simplified52.7%
if -6.5000000000000002e-12 < z < 2.7999999999999999e65Initial program 92.9%
Taylor expanded in z around 0 57.1%
clear-num56.5%
inv-pow56.5%
Applied egg-rr56.5%
unpow-156.5%
associate-/l*60.3%
Simplified60.3%
associate-/r/61.4%
Applied egg-rr61.4%
Final simplification69.3%
NOTE: y and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ 1.0 (* z (/ z x)))))
(if (<= z -2.1e+49)
t_1
(if (<= z -5.2e-13)
(/ (- (/ x y)) z)
(if (<= z 4.5e+60) (/ 1.0 (* t (/ y x))) t_1)))))assert(y < t);
double code(double x, double y, double z, double t) {
double t_1 = 1.0 / (z * (z / x));
double tmp;
if (z <= -2.1e+49) {
tmp = t_1;
} else if (z <= -5.2e-13) {
tmp = -(x / y) / z;
} else if (z <= 4.5e+60) {
tmp = 1.0 / (t * (y / x));
} else {
tmp = t_1;
}
return tmp;
}
NOTE: y and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = 1.0d0 / (z * (z / x))
if (z <= (-2.1d+49)) then
tmp = t_1
else if (z <= (-5.2d-13)) then
tmp = -(x / y) / z
else if (z <= 4.5d+60) then
tmp = 1.0d0 / (t * (y / x))
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 = 1.0 / (z * (z / x));
double tmp;
if (z <= -2.1e+49) {
tmp = t_1;
} else if (z <= -5.2e-13) {
tmp = -(x / y) / z;
} else if (z <= 4.5e+60) {
tmp = 1.0 / (t * (y / x));
} else {
tmp = t_1;
}
return tmp;
}
[y, t] = sort([y, t]) def code(x, y, z, t): t_1 = 1.0 / (z * (z / x)) tmp = 0 if z <= -2.1e+49: tmp = t_1 elif z <= -5.2e-13: tmp = -(x / y) / z elif z <= 4.5e+60: tmp = 1.0 / (t * (y / x)) else: tmp = t_1 return tmp
y, t = sort([y, t]) function code(x, y, z, t) t_1 = Float64(1.0 / Float64(z * Float64(z / x))) tmp = 0.0 if (z <= -2.1e+49) tmp = t_1; elseif (z <= -5.2e-13) tmp = Float64(Float64(-Float64(x / y)) / z); elseif (z <= 4.5e+60) tmp = Float64(1.0 / Float64(t * Float64(y / x))); else tmp = t_1; end return tmp end
y, t = num2cell(sort([y, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = 1.0 / (z * (z / x));
tmp = 0.0;
if (z <= -2.1e+49)
tmp = t_1;
elseif (z <= -5.2e-13)
tmp = -(x / y) / z;
elseif (z <= 4.5e+60)
tmp = 1.0 / (t * (y / x));
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[(1.0 / N[(z * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.1e+49], t$95$1, If[LessEqual[z, -5.2e-13], N[((-N[(x / y), $MachinePrecision]) / z), $MachinePrecision], If[LessEqual[z, 4.5e+60], N[(1.0 / N[(t * N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
[y, t] = \mathsf{sort}([y, t])\\
\\
\begin{array}{l}
t_1 := \frac{1}{z \cdot \frac{z}{x}}\\
\mathbf{if}\;z \leq -2.1 \cdot 10^{+49}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -5.2 \cdot 10^{-13}:\\
\;\;\;\;\frac{-\frac{x}{y}}{z}\\
\mathbf{elif}\;z \leq 4.5 \cdot 10^{+60}:\\
\;\;\;\;\frac{1}{t \cdot \frac{y}{x}}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -2.10000000000000011e49 or 4.50000000000000013e60 < z Initial program 85.1%
Taylor expanded in z around inf 76.0%
unpow276.0%
Simplified76.0%
clear-num76.4%
inv-pow76.4%
associate-/l*80.4%
Applied egg-rr80.4%
unpow-180.4%
associate-/r/80.4%
Simplified80.4%
if -2.10000000000000011e49 < z < -5.2000000000000001e-13Initial program 99.6%
Taylor expanded in y around inf 59.3%
*-commutative59.3%
Simplified59.3%
Taylor expanded in t around 0 52.9%
mul-1-neg52.9%
associate-/r*52.7%
distribute-neg-frac52.7%
Simplified52.7%
if -5.2000000000000001e-13 < z < 4.50000000000000013e60Initial program 92.9%
Taylor expanded in z around 0 57.1%
clear-num56.5%
inv-pow56.5%
Applied egg-rr56.5%
unpow-156.5%
associate-/l*60.3%
Simplified60.3%
associate-/r/61.4%
Applied egg-rr61.4%
Final simplification69.6%
NOTE: y and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ 1.0 (* z (/ z x)))))
(if (<= z -7.7e+46)
t_1
(if (<= z -2.1e-11)
(/ (- (/ x y)) z)
(if (<= z 6.2e+16) (/ 1.0 (/ y (/ x t))) t_1)))))assert(y < t);
double code(double x, double y, double z, double t) {
double t_1 = 1.0 / (z * (z / x));
double tmp;
if (z <= -7.7e+46) {
tmp = t_1;
} else if (z <= -2.1e-11) {
tmp = -(x / y) / z;
} else if (z <= 6.2e+16) {
tmp = 1.0 / (y / (x / t));
} else {
tmp = t_1;
}
return tmp;
}
NOTE: y and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = 1.0d0 / (z * (z / x))
if (z <= (-7.7d+46)) then
tmp = t_1
else if (z <= (-2.1d-11)) then
tmp = -(x / y) / z
else if (z <= 6.2d+16) then
tmp = 1.0d0 / (y / (x / t))
else
tmp = t_1
end if
code = tmp
end function
assert y < t;
public static double code(double x, double y, double z, double t) {
double t_1 = 1.0 / (z * (z / x));
double tmp;
if (z <= -7.7e+46) {
tmp = t_1;
} else if (z <= -2.1e-11) {
tmp = -(x / y) / z;
} else if (z <= 6.2e+16) {
tmp = 1.0 / (y / (x / t));
} else {
tmp = t_1;
}
return tmp;
}
[y, t] = sort([y, t]) def code(x, y, z, t): t_1 = 1.0 / (z * (z / x)) tmp = 0 if z <= -7.7e+46: tmp = t_1 elif z <= -2.1e-11: tmp = -(x / y) / z elif z <= 6.2e+16: tmp = 1.0 / (y / (x / t)) else: tmp = t_1 return tmp
y, t = sort([y, t]) function code(x, y, z, t) t_1 = Float64(1.0 / Float64(z * Float64(z / x))) tmp = 0.0 if (z <= -7.7e+46) tmp = t_1; elseif (z <= -2.1e-11) tmp = Float64(Float64(-Float64(x / y)) / z); elseif (z <= 6.2e+16) tmp = Float64(1.0 / Float64(y / Float64(x / t))); else tmp = t_1; end return tmp end
y, t = num2cell(sort([y, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = 1.0 / (z * (z / x));
tmp = 0.0;
if (z <= -7.7e+46)
tmp = t_1;
elseif (z <= -2.1e-11)
tmp = -(x / y) / z;
elseif (z <= 6.2e+16)
tmp = 1.0 / (y / (x / t));
else
tmp = t_1;
end
tmp_2 = tmp;
end
NOTE: y and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(1.0 / N[(z * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -7.7e+46], t$95$1, If[LessEqual[z, -2.1e-11], N[((-N[(x / y), $MachinePrecision]) / z), $MachinePrecision], If[LessEqual[z, 6.2e+16], N[(1.0 / N[(y / N[(x / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
[y, t] = \mathsf{sort}([y, t])\\
\\
\begin{array}{l}
t_1 := \frac{1}{z \cdot \frac{z}{x}}\\
\mathbf{if}\;z \leq -7.7 \cdot 10^{+46}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -2.1 \cdot 10^{-11}:\\
\;\;\;\;\frac{-\frac{x}{y}}{z}\\
\mathbf{elif}\;z \leq 6.2 \cdot 10^{+16}:\\
\;\;\;\;\frac{1}{\frac{y}{\frac{x}{t}}}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -7.70000000000000038e46 or 6.2e16 < z Initial program 86.5%
Taylor expanded in z around inf 73.4%
unpow273.4%
Simplified73.4%
clear-num73.7%
inv-pow73.7%
associate-/l*77.4%
Applied egg-rr77.4%
unpow-177.4%
associate-/r/77.4%
Simplified77.4%
if -7.70000000000000038e46 < z < -2.0999999999999999e-11Initial program 99.6%
Taylor expanded in y around inf 59.3%
*-commutative59.3%
Simplified59.3%
Taylor expanded in t around 0 52.9%
mul-1-neg52.9%
associate-/r*52.7%
distribute-neg-frac52.7%
Simplified52.7%
if -2.0999999999999999e-11 < z < 6.2e16Initial program 92.1%
Taylor expanded in z around 0 59.3%
clear-num58.7%
inv-pow58.7%
Applied egg-rr58.7%
unpow-158.7%
associate-/l*62.1%
Simplified62.1%
Final simplification69.2%
NOTE: y and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ 1.0 (* z (/ z x)))))
(if (<= z -2.6e+48)
t_1
(if (<= z -1.8e-11)
(/ (- (/ x y)) z)
(if (<= z 9.2e+29) (/ x (* t (- y z))) t_1)))))assert(y < t);
double code(double x, double y, double z, double t) {
double t_1 = 1.0 / (z * (z / x));
double tmp;
if (z <= -2.6e+48) {
tmp = t_1;
} else if (z <= -1.8e-11) {
tmp = -(x / y) / z;
} else if (z <= 9.2e+29) {
tmp = x / (t * (y - z));
} else {
tmp = t_1;
}
return tmp;
}
NOTE: y and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = 1.0d0 / (z * (z / x))
if (z <= (-2.6d+48)) then
tmp = t_1
else if (z <= (-1.8d-11)) then
tmp = -(x / y) / z
else if (z <= 9.2d+29) then
tmp = x / (t * (y - z))
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 = 1.0 / (z * (z / x));
double tmp;
if (z <= -2.6e+48) {
tmp = t_1;
} else if (z <= -1.8e-11) {
tmp = -(x / y) / z;
} else if (z <= 9.2e+29) {
tmp = x / (t * (y - z));
} else {
tmp = t_1;
}
return tmp;
}
[y, t] = sort([y, t]) def code(x, y, z, t): t_1 = 1.0 / (z * (z / x)) tmp = 0 if z <= -2.6e+48: tmp = t_1 elif z <= -1.8e-11: tmp = -(x / y) / z elif z <= 9.2e+29: tmp = x / (t * (y - z)) else: tmp = t_1 return tmp
y, t = sort([y, t]) function code(x, y, z, t) t_1 = Float64(1.0 / Float64(z * Float64(z / x))) tmp = 0.0 if (z <= -2.6e+48) tmp = t_1; elseif (z <= -1.8e-11) tmp = Float64(Float64(-Float64(x / y)) / z); elseif (z <= 9.2e+29) tmp = Float64(x / Float64(t * Float64(y - z))); else tmp = t_1; end return tmp end
y, t = num2cell(sort([y, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = 1.0 / (z * (z / x));
tmp = 0.0;
if (z <= -2.6e+48)
tmp = t_1;
elseif (z <= -1.8e-11)
tmp = -(x / y) / z;
elseif (z <= 9.2e+29)
tmp = x / (t * (y - z));
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[(1.0 / N[(z * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.6e+48], t$95$1, If[LessEqual[z, -1.8e-11], N[((-N[(x / y), $MachinePrecision]) / z), $MachinePrecision], If[LessEqual[z, 9.2e+29], N[(x / N[(t * N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
[y, t] = \mathsf{sort}([y, t])\\
\\
\begin{array}{l}
t_1 := \frac{1}{z \cdot \frac{z}{x}}\\
\mathbf{if}\;z \leq -2.6 \cdot 10^{+48}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -1.8 \cdot 10^{-11}:\\
\;\;\;\;\frac{-\frac{x}{y}}{z}\\
\mathbf{elif}\;z \leq 9.2 \cdot 10^{+29}:\\
\;\;\;\;\frac{x}{t \cdot \left(y - z\right)}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -2.59999999999999995e48 or 9.2000000000000004e29 < z Initial program 86.2%
Taylor expanded in z around inf 73.5%
unpow273.5%
Simplified73.5%
clear-num73.9%
inv-pow73.9%
associate-/l*77.6%
Applied egg-rr77.6%
unpow-177.6%
associate-/r/77.6%
Simplified77.6%
if -2.59999999999999995e48 < z < -1.79999999999999992e-11Initial program 99.6%
Taylor expanded in y around inf 59.3%
*-commutative59.3%
Simplified59.3%
Taylor expanded in t around 0 52.9%
mul-1-neg52.9%
associate-/r*52.7%
distribute-neg-frac52.7%
Simplified52.7%
if -1.79999999999999992e-11 < z < 9.2000000000000004e29Initial program 92.3%
Taylor expanded in t around inf 68.0%
Final simplification71.8%
NOTE: y and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= y -2.6e-43) (/ (/ x y) (- t z)) (if (<= y 6.1e-58) (/ (/ (- 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 <= -2.6e-43) {
tmp = (x / y) / (t - z);
} else if (y <= 6.1e-58) {
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 <= (-2.6d-43)) then
tmp = (x / y) / (t - z)
else if (y <= 6.1d-58) 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 <= -2.6e-43) {
tmp = (x / y) / (t - z);
} else if (y <= 6.1e-58) {
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 <= -2.6e-43: tmp = (x / y) / (t - z) elif y <= 6.1e-58: 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 <= -2.6e-43) tmp = Float64(Float64(x / y) / Float64(t - z)); elseif (y <= 6.1e-58) 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 <= -2.6e-43)
tmp = (x / y) / (t - z);
elseif (y <= 6.1e-58)
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, -2.6e-43], N[(N[(x / y), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 6.1e-58], 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 -2.6 \cdot 10^{-43}:\\
\;\;\;\;\frac{\frac{x}{y}}{t - z}\\
\mathbf{elif}\;y \leq 6.1 \cdot 10^{-58}:\\
\;\;\;\;\frac{\frac{-x}{z}}{t - z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{t}}{y - z}\\
\end{array}
\end{array}
if y < -2.6e-43Initial program 87.1%
associate-/r*98.2%
Simplified98.2%
Taylor expanded in y around inf 87.2%
if -2.6e-43 < y < 6.1000000000000003e-58Initial program 91.3%
Taylor expanded in y around 0 75.4%
mul-1-neg75.4%
distribute-frac-neg75.4%
associate-/r*81.8%
Simplified81.8%
if 6.1000000000000003e-58 < y Initial program 90.5%
Taylor expanded in t around inf 56.6%
associate-/r*61.3%
Simplified61.3%
Final simplification77.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)))
(if (<= z -1.62e+44)
t_1
(if (<= z -1.65e-17)
(/ x (* y (- z)))
(if (<= z 510000000000.0) (/ x (* t y)) t_1)))))assert(y < t);
double code(double x, double y, double z, double t) {
double t_1 = (x / z) / z;
double tmp;
if (z <= -1.62e+44) {
tmp = t_1;
} else if (z <= -1.65e-17) {
tmp = x / (y * -z);
} else if (z <= 510000000000.0) {
tmp = x / (t * y);
} else {
tmp = t_1;
}
return tmp;
}
NOTE: y and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = (x / z) / z
if (z <= (-1.62d+44)) then
tmp = t_1
else if (z <= (-1.65d-17)) then
tmp = x / (y * -z)
else if (z <= 510000000000.0d0) then
tmp = x / (t * y)
else
tmp = t_1
end if
code = tmp
end function
assert y < t;
public static double code(double x, double y, double z, double t) {
double t_1 = (x / z) / z;
double tmp;
if (z <= -1.62e+44) {
tmp = t_1;
} else if (z <= -1.65e-17) {
tmp = x / (y * -z);
} else if (z <= 510000000000.0) {
tmp = x / (t * y);
} else {
tmp = t_1;
}
return tmp;
}
[y, t] = sort([y, t]) def code(x, y, z, t): t_1 = (x / z) / z tmp = 0 if z <= -1.62e+44: tmp = t_1 elif z <= -1.65e-17: tmp = x / (y * -z) elif z <= 510000000000.0: tmp = x / (t * y) else: tmp = t_1 return tmp
y, t = sort([y, t]) function code(x, y, z, t) t_1 = Float64(Float64(x / z) / z) tmp = 0.0 if (z <= -1.62e+44) tmp = t_1; elseif (z <= -1.65e-17) tmp = Float64(x / Float64(y * Float64(-z))); elseif (z <= 510000000000.0) tmp = Float64(x / Float64(t * y)); else tmp = t_1; end return tmp end
y, t = num2cell(sort([y, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = (x / z) / z;
tmp = 0.0;
if (z <= -1.62e+44)
tmp = t_1;
elseif (z <= -1.65e-17)
tmp = x / (y * -z);
elseif (z <= 510000000000.0)
tmp = x / (t * y);
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]}, If[LessEqual[z, -1.62e+44], t$95$1, If[LessEqual[z, -1.65e-17], N[(x / N[(y * (-z)), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 510000000000.0], N[(x / N[(t * y), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
[y, t] = \mathsf{sort}([y, t])\\
\\
\begin{array}{l}
t_1 := \frac{\frac{x}{z}}{z}\\
\mathbf{if}\;z \leq -1.62 \cdot 10^{+44}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -1.65 \cdot 10^{-17}:\\
\;\;\;\;\frac{x}{y \cdot \left(-z\right)}\\
\mathbf{elif}\;z \leq 510000000000:\\
\;\;\;\;\frac{x}{t \cdot y}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -1.6199999999999999e44 or 5.1e11 < z Initial program 86.5%
Taylor expanded in z around inf 73.4%
unpow273.4%
associate-/r*77.0%
Simplified77.0%
if -1.6199999999999999e44 < z < -1.65e-17Initial program 99.6%
Taylor expanded in y around inf 59.3%
*-commutative59.3%
Simplified59.3%
Taylor expanded in t around 0 52.9%
mul-1-neg52.9%
*-commutative52.9%
distribute-rgt-neg-in52.9%
Simplified52.9%
if -1.65e-17 < z < 5.1e11Initial program 92.1%
Taylor expanded in z around 0 59.3%
Final simplification67.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)))
(if (<= z -5.5e+49)
t_1
(if (<= z -1.1e-13)
(/ (- (/ x y)) z)
(if (<= z 12200000000.0) (/ x (* t y)) t_1)))))assert(y < t);
double code(double x, double y, double z, double t) {
double t_1 = (x / z) / z;
double tmp;
if (z <= -5.5e+49) {
tmp = t_1;
} else if (z <= -1.1e-13) {
tmp = -(x / y) / z;
} else if (z <= 12200000000.0) {
tmp = x / (t * y);
} else {
tmp = t_1;
}
return tmp;
}
NOTE: y and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = (x / z) / z
if (z <= (-5.5d+49)) then
tmp = t_1
else if (z <= (-1.1d-13)) then
tmp = -(x / y) / z
else if (z <= 12200000000.0d0) then
tmp = x / (t * y)
else
tmp = t_1
end if
code = tmp
end function
assert y < t;
public static double code(double x, double y, double z, double t) {
double t_1 = (x / z) / z;
double tmp;
if (z <= -5.5e+49) {
tmp = t_1;
} else if (z <= -1.1e-13) {
tmp = -(x / y) / z;
} else if (z <= 12200000000.0) {
tmp = x / (t * y);
} else {
tmp = t_1;
}
return tmp;
}
[y, t] = sort([y, t]) def code(x, y, z, t): t_1 = (x / z) / z tmp = 0 if z <= -5.5e+49: tmp = t_1 elif z <= -1.1e-13: tmp = -(x / y) / z elif z <= 12200000000.0: tmp = x / (t * y) else: tmp = t_1 return tmp
y, t = sort([y, t]) function code(x, y, z, t) t_1 = Float64(Float64(x / z) / z) tmp = 0.0 if (z <= -5.5e+49) tmp = t_1; elseif (z <= -1.1e-13) tmp = Float64(Float64(-Float64(x / y)) / z); elseif (z <= 12200000000.0) tmp = Float64(x / Float64(t * y)); else tmp = t_1; end return tmp end
y, t = num2cell(sort([y, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = (x / z) / z;
tmp = 0.0;
if (z <= -5.5e+49)
tmp = t_1;
elseif (z <= -1.1e-13)
tmp = -(x / y) / z;
elseif (z <= 12200000000.0)
tmp = x / (t * y);
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]}, If[LessEqual[z, -5.5e+49], t$95$1, If[LessEqual[z, -1.1e-13], N[((-N[(x / y), $MachinePrecision]) / z), $MachinePrecision], If[LessEqual[z, 12200000000.0], N[(x / N[(t * y), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
[y, t] = \mathsf{sort}([y, t])\\
\\
\begin{array}{l}
t_1 := \frac{\frac{x}{z}}{z}\\
\mathbf{if}\;z \leq -5.5 \cdot 10^{+49}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -1.1 \cdot 10^{-13}:\\
\;\;\;\;\frac{-\frac{x}{y}}{z}\\
\mathbf{elif}\;z \leq 12200000000:\\
\;\;\;\;\frac{x}{t \cdot y}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -5.50000000000000042e49 or 1.22e10 < z Initial program 86.5%
Taylor expanded in z around inf 73.4%
unpow273.4%
associate-/r*77.0%
Simplified77.0%
if -5.50000000000000042e49 < z < -1.09999999999999998e-13Initial program 99.6%
Taylor expanded in y around inf 59.3%
*-commutative59.3%
Simplified59.3%
Taylor expanded in t around 0 52.9%
mul-1-neg52.9%
associate-/r*52.7%
distribute-neg-frac52.7%
Simplified52.7%
if -1.09999999999999998e-13 < z < 1.22e10Initial program 92.1%
Taylor expanded in z around 0 59.3%
Final simplification67.8%
NOTE: y and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= y -2.4e-43) (/ x (* (- t z) y)) (if (<= y 6.1e-307) (/ 1.0 (* z (/ z x))) (/ x (* t (- y z))))))
assert(y < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -2.4e-43) {
tmp = x / ((t - z) * y);
} else if (y <= 6.1e-307) {
tmp = 1.0 / (z * (z / x));
} else {
tmp = x / (t * (y - z));
}
return tmp;
}
NOTE: y and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= (-2.4d-43)) then
tmp = x / ((t - z) * y)
else if (y <= 6.1d-307) then
tmp = 1.0d0 / (z * (z / x))
else
tmp = x / (t * (y - z))
end if
code = tmp
end function
assert y < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -2.4e-43) {
tmp = x / ((t - z) * y);
} else if (y <= 6.1e-307) {
tmp = 1.0 / (z * (z / x));
} else {
tmp = x / (t * (y - z));
}
return tmp;
}
[y, t] = sort([y, t]) def code(x, y, z, t): tmp = 0 if y <= -2.4e-43: tmp = x / ((t - z) * y) elif y <= 6.1e-307: tmp = 1.0 / (z * (z / x)) else: tmp = x / (t * (y - z)) return tmp
y, t = sort([y, t]) function code(x, y, z, t) tmp = 0.0 if (y <= -2.4e-43) tmp = Float64(x / Float64(Float64(t - z) * y)); elseif (y <= 6.1e-307) tmp = Float64(1.0 / Float64(z * Float64(z / x))); else tmp = Float64(x / Float64(t * Float64(y - z))); end return tmp end
y, t = num2cell(sort([y, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (y <= -2.4e-43)
tmp = x / ((t - z) * y);
elseif (y <= 6.1e-307)
tmp = 1.0 / (z * (z / x));
else
tmp = x / (t * (y - z));
end
tmp_2 = tmp;
end
NOTE: y and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[y, -2.4e-43], N[(x / N[(N[(t - z), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 6.1e-307], N[(1.0 / N[(z * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x / N[(t * N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[y, t] = \mathsf{sort}([y, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.4 \cdot 10^{-43}:\\
\;\;\;\;\frac{x}{\left(t - z\right) \cdot y}\\
\mathbf{elif}\;y \leq 6.1 \cdot 10^{-307}:\\
\;\;\;\;\frac{1}{z \cdot \frac{z}{x}}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{t \cdot \left(y - z\right)}\\
\end{array}
\end{array}
if y < -2.4000000000000002e-43Initial program 87.1%
Taylor expanded in y around inf 81.3%
*-commutative81.3%
Simplified81.3%
if -2.4000000000000002e-43 < y < 6.09999999999999974e-307Initial program 93.9%
Taylor expanded in z around inf 71.3%
unpow271.3%
Simplified71.3%
clear-num72.3%
inv-pow72.3%
associate-/l*76.3%
Applied egg-rr76.3%
unpow-176.3%
associate-/r/76.3%
Simplified76.3%
if 6.09999999999999974e-307 < y Initial program 89.8%
Taylor expanded in t around inf 58.3%
Final simplification69.0%
NOTE: y and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= y -3.05e-43) (/ x (* (- t z) y)) (if (<= y 4.7e-58) (/ x (* z (- z t))) (/ x (* t (- y z))))))
assert(y < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -3.05e-43) {
tmp = x / ((t - z) * y);
} else if (y <= 4.7e-58) {
tmp = x / (z * (z - t));
} else {
tmp = x / (t * (y - z));
}
return tmp;
}
NOTE: y and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= (-3.05d-43)) then
tmp = x / ((t - z) * y)
else if (y <= 4.7d-58) then
tmp = x / (z * (z - t))
else
tmp = x / (t * (y - z))
end if
code = tmp
end function
assert y < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -3.05e-43) {
tmp = x / ((t - z) * y);
} else if (y <= 4.7e-58) {
tmp = x / (z * (z - t));
} else {
tmp = x / (t * (y - z));
}
return tmp;
}
[y, t] = sort([y, t]) def code(x, y, z, t): tmp = 0 if y <= -3.05e-43: tmp = x / ((t - z) * y) elif y <= 4.7e-58: tmp = x / (z * (z - t)) else: tmp = x / (t * (y - z)) return tmp
y, t = sort([y, t]) function code(x, y, z, t) tmp = 0.0 if (y <= -3.05e-43) tmp = Float64(x / Float64(Float64(t - z) * y)); elseif (y <= 4.7e-58) tmp = Float64(x / Float64(z * Float64(z - t))); else tmp = Float64(x / Float64(t * Float64(y - z))); end return tmp end
y, t = num2cell(sort([y, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (y <= -3.05e-43)
tmp = x / ((t - z) * y);
elseif (y <= 4.7e-58)
tmp = x / (z * (z - t));
else
tmp = x / (t * (y - z));
end
tmp_2 = tmp;
end
NOTE: y and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[y, -3.05e-43], N[(x / N[(N[(t - z), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4.7e-58], N[(x / N[(z * N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x / N[(t * N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[y, t] = \mathsf{sort}([y, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.05 \cdot 10^{-43}:\\
\;\;\;\;\frac{x}{\left(t - z\right) \cdot y}\\
\mathbf{elif}\;y \leq 4.7 \cdot 10^{-58}:\\
\;\;\;\;\frac{x}{z \cdot \left(z - t\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{t \cdot \left(y - z\right)}\\
\end{array}
\end{array}
if y < -3.05000000000000019e-43Initial program 87.1%
Taylor expanded in y around inf 81.3%
*-commutative81.3%
Simplified81.3%
if -3.05000000000000019e-43 < y < 4.69999999999999994e-58Initial program 91.3%
frac-2neg91.3%
div-inv90.3%
distribute-rgt-neg-in90.3%
Applied egg-rr90.3%
associate-/r*90.3%
Simplified90.3%
Taylor expanded in y around 0 75.4%
if 4.69999999999999994e-58 < y Initial program 90.5%
Taylor expanded in t around inf 56.6%
Final simplification71.4%
NOTE: y and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= y -2.35e-43) (/ x (* (- t z) y)) (if (<= y 2e-57) (/ x (* z (- z t))) (/ (/ x t) (- y z)))))
assert(y < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -2.35e-43) {
tmp = x / ((t - z) * y);
} else if (y <= 2e-57) {
tmp = x / (z * (z - t));
} else {
tmp = (x / t) / (y - z);
}
return tmp;
}
NOTE: y and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= (-2.35d-43)) then
tmp = x / ((t - z) * y)
else if (y <= 2d-57) then
tmp = x / (z * (z - t))
else
tmp = (x / t) / (y - z)
end if
code = tmp
end function
assert y < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -2.35e-43) {
tmp = x / ((t - z) * y);
} else if (y <= 2e-57) {
tmp = x / (z * (z - t));
} else {
tmp = (x / t) / (y - z);
}
return tmp;
}
[y, t] = sort([y, t]) def code(x, y, z, t): tmp = 0 if y <= -2.35e-43: tmp = x / ((t - z) * y) elif y <= 2e-57: tmp = x / (z * (z - t)) else: tmp = (x / t) / (y - z) return tmp
y, t = sort([y, t]) function code(x, y, z, t) tmp = 0.0 if (y <= -2.35e-43) tmp = Float64(x / Float64(Float64(t - z) * y)); elseif (y <= 2e-57) tmp = Float64(x / Float64(z * Float64(z - t))); else tmp = Float64(Float64(x / t) / Float64(y - z)); end return tmp end
y, t = num2cell(sort([y, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (y <= -2.35e-43)
tmp = x / ((t - z) * y);
elseif (y <= 2e-57)
tmp = x / (z * (z - t));
else
tmp = (x / t) / (y - z);
end
tmp_2 = tmp;
end
NOTE: y and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[y, -2.35e-43], N[(x / N[(N[(t - z), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2e-57], N[(x / N[(z * N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / t), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[y, t] = \mathsf{sort}([y, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.35 \cdot 10^{-43}:\\
\;\;\;\;\frac{x}{\left(t - z\right) \cdot y}\\
\mathbf{elif}\;y \leq 2 \cdot 10^{-57}:\\
\;\;\;\;\frac{x}{z \cdot \left(z - t\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{t}}{y - z}\\
\end{array}
\end{array}
if y < -2.35e-43Initial program 87.1%
Taylor expanded in y around inf 81.3%
*-commutative81.3%
Simplified81.3%
if -2.35e-43 < y < 1.99999999999999991e-57Initial program 91.3%
frac-2neg91.3%
div-inv90.3%
distribute-rgt-neg-in90.3%
Applied egg-rr90.3%
associate-/r*90.3%
Simplified90.3%
Taylor expanded in y around 0 75.4%
if 1.99999999999999991e-57 < y Initial program 90.5%
Taylor expanded in t around inf 56.6%
associate-/r*61.3%
Simplified61.3%
Final simplification72.9%
NOTE: y and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= y -4.8e-43) (/ (/ x y) (- t z)) (if (<= y 1.7e-57) (/ x (* z (- z t))) (/ (/ x t) (- y z)))))
assert(y < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -4.8e-43) {
tmp = (x / y) / (t - z);
} else if (y <= 1.7e-57) {
tmp = x / (z * (z - t));
} else {
tmp = (x / t) / (y - z);
}
return tmp;
}
NOTE: y and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= (-4.8d-43)) then
tmp = (x / y) / (t - z)
else if (y <= 1.7d-57) then
tmp = x / (z * (z - t))
else
tmp = (x / t) / (y - z)
end if
code = tmp
end function
assert y < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -4.8e-43) {
tmp = (x / y) / (t - z);
} else if (y <= 1.7e-57) {
tmp = x / (z * (z - t));
} else {
tmp = (x / t) / (y - z);
}
return tmp;
}
[y, t] = sort([y, t]) def code(x, y, z, t): tmp = 0 if y <= -4.8e-43: tmp = (x / y) / (t - z) elif y <= 1.7e-57: tmp = x / (z * (z - t)) else: tmp = (x / t) / (y - z) return tmp
y, t = sort([y, t]) function code(x, y, z, t) tmp = 0.0 if (y <= -4.8e-43) tmp = Float64(Float64(x / y) / Float64(t - z)); elseif (y <= 1.7e-57) tmp = Float64(x / Float64(z * Float64(z - t))); else tmp = Float64(Float64(x / t) / Float64(y - z)); end return tmp end
y, t = num2cell(sort([y, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (y <= -4.8e-43)
tmp = (x / y) / (t - z);
elseif (y <= 1.7e-57)
tmp = x / (z * (z - t));
else
tmp = (x / t) / (y - z);
end
tmp_2 = tmp;
end
NOTE: y and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[y, -4.8e-43], N[(N[(x / y), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.7e-57], N[(x / N[(z * N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / t), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[y, t] = \mathsf{sort}([y, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.8 \cdot 10^{-43}:\\
\;\;\;\;\frac{\frac{x}{y}}{t - z}\\
\mathbf{elif}\;y \leq 1.7 \cdot 10^{-57}:\\
\;\;\;\;\frac{x}{z \cdot \left(z - t\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{t}}{y - z}\\
\end{array}
\end{array}
if y < -4.8000000000000004e-43Initial program 87.1%
associate-/r*98.2%
Simplified98.2%
Taylor expanded in y around inf 87.2%
if -4.8000000000000004e-43 < y < 1.70000000000000008e-57Initial program 91.3%
frac-2neg91.3%
div-inv90.3%
distribute-rgt-neg-in90.3%
Applied egg-rr90.3%
associate-/r*90.3%
Simplified90.3%
Taylor expanded in y around 0 75.4%
if 1.70000000000000008e-57 < y Initial program 90.5%
Taylor expanded in t around inf 56.6%
associate-/r*61.3%
Simplified61.3%
Final simplification74.7%
NOTE: y and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= y -1.4e+161) (/ 1.0 (/ y (/ x (- t z)))) (/ x (* (- t z) (- y z)))))
assert(y < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.4e+161) {
tmp = 1.0 / (y / (x / (t - z)));
} else {
tmp = x / ((t - z) * (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 <= (-1.4d+161)) then
tmp = 1.0d0 / (y / (x / (t - z)))
else
tmp = x / ((t - z) * (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 <= -1.4e+161) {
tmp = 1.0 / (y / (x / (t - z)));
} else {
tmp = x / ((t - z) * (y - z));
}
return tmp;
}
[y, t] = sort([y, t]) def code(x, y, z, t): tmp = 0 if y <= -1.4e+161: tmp = 1.0 / (y / (x / (t - z))) else: tmp = x / ((t - z) * (y - z)) return tmp
y, t = sort([y, t]) function code(x, y, z, t) tmp = 0.0 if (y <= -1.4e+161) tmp = Float64(1.0 / Float64(y / Float64(x / Float64(t - z)))); else tmp = Float64(x / Float64(Float64(t - z) * 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 <= -1.4e+161)
tmp = 1.0 / (y / (x / (t - z)));
else
tmp = x / ((t - z) * (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, -1.4e+161], N[(1.0 / N[(y / N[(x / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x / N[(N[(t - z), $MachinePrecision] * N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[y, t] = \mathsf{sort}([y, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.4 \cdot 10^{+161}:\\
\;\;\;\;\frac{1}{\frac{y}{\frac{x}{t - z}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\left(t - z\right) \cdot \left(y - z\right)}\\
\end{array}
\end{array}
if y < -1.4000000000000001e161Initial program 77.1%
Taylor expanded in y around inf 77.1%
*-commutative77.1%
Simplified77.1%
clear-num77.0%
inv-pow77.0%
*-commutative77.0%
Applied egg-rr77.0%
unpow-177.0%
associate-/l*98.8%
Simplified98.8%
if -1.4000000000000001e161 < y Initial program 91.6%
Final simplification92.5%
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.5e+26) (not (<= z 6.4e+57))) (/ x (* z y)) (/ x (* t y))))
assert(y < t);
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -3.5e+26) || !(z <= 6.4e+57)) {
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 <= (-3.5d+26)) .or. (.not. (z <= 6.4d+57))) 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 <= -3.5e+26) || !(z <= 6.4e+57)) {
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 <= -3.5e+26) or not (z <= 6.4e+57): 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 <= -3.5e+26) || !(z <= 6.4e+57)) 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 <= -3.5e+26) || ~((z <= 6.4e+57)))
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, -3.5e+26], N[Not[LessEqual[z, 6.4e+57]], $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 -3.5 \cdot 10^{+26} \lor \neg \left(z \leq 6.4 \cdot 10^{+57}\right):\\
\;\;\;\;\frac{x}{z \cdot y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{t \cdot y}\\
\end{array}
\end{array}
if z < -3.4999999999999999e26 or 6.40000000000000059e57 < z Initial program 86.0%
Taylor expanded in y around inf 47.9%
*-commutative47.9%
Simplified47.9%
Taylor expanded in t around 0 43.6%
mul-1-neg43.6%
*-commutative43.6%
distribute-rgt-neg-in43.6%
Simplified43.6%
expm1-log1p-u42.5%
expm1-udef63.2%
add-sqr-sqrt31.9%
sqrt-unprod56.5%
sqr-neg56.5%
sqrt-unprod30.9%
add-sqr-sqrt63.0%
Applied egg-rr63.0%
expm1-def40.3%
expm1-log1p40.6%
*-commutative40.6%
Simplified40.6%
if -3.4999999999999999e26 < z < 6.40000000000000059e57Initial program 93.3%
Taylor expanded in z around 0 55.3%
Final simplification48.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 -4.2e-9) (not (<= z 4e+16))) (/ x (* z z)) (/ x (* t y))))
assert(y < t);
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -4.2e-9) || !(z <= 4e+16)) {
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 <= (-4.2d-9)) .or. (.not. (z <= 4d+16))) 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 <= -4.2e-9) || !(z <= 4e+16)) {
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 <= -4.2e-9) or not (z <= 4e+16): 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 <= -4.2e-9) || !(z <= 4e+16)) 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 <= -4.2e-9) || ~((z <= 4e+16)))
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, -4.2e-9], N[Not[LessEqual[z, 4e+16]], $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 -4.2 \cdot 10^{-9} \lor \neg \left(z \leq 4 \cdot 10^{+16}\right):\\
\;\;\;\;\frac{x}{z \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{t \cdot y}\\
\end{array}
\end{array}
if z < -4.20000000000000039e-9 or 4e16 < z Initial program 87.8%
Taylor expanded in z around inf 69.7%
unpow269.7%
Simplified69.7%
if -4.20000000000000039e-9 < z < 4e16Initial program 92.2%
Taylor expanded in z around 0 58.9%
Final simplification64.9%
NOTE: y and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (or (<= z -1.45e-9) (not (<= z 34500000000000.0))) (/ (/ x z) z) (/ x (* t y))))
assert(y < t);
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.45e-9) || !(z <= 34500000000000.0)) {
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 <= (-1.45d-9)) .or. (.not. (z <= 34500000000000.0d0))) 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 <= -1.45e-9) || !(z <= 34500000000000.0)) {
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 <= -1.45e-9) or not (z <= 34500000000000.0): 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 <= -1.45e-9) || !(z <= 34500000000000.0)) tmp = Float64(Float64(x / 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 <= -1.45e-9) || ~((z <= 34500000000000.0)))
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, -1.45e-9], N[Not[LessEqual[z, 34500000000000.0]], $MachinePrecision]], N[(N[(x / z), $MachinePrecision] / z), $MachinePrecision], N[(x / N[(t * y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[y, t] = \mathsf{sort}([y, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.45 \cdot 10^{-9} \lor \neg \left(z \leq 34500000000000\right):\\
\;\;\;\;\frac{\frac{x}{z}}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{t \cdot y}\\
\end{array}
\end{array}
if z < -1.44999999999999996e-9 or 3.45e13 < z Initial program 87.8%
Taylor expanded in z around inf 69.7%
unpow269.7%
associate-/r*72.9%
Simplified72.9%
if -1.44999999999999996e-9 < z < 3.45e13Initial program 92.2%
Taylor expanded in z around 0 58.9%
Final simplification66.7%
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 89.7%
Taylor expanded in z around 0 41.0%
Final simplification41.0%
(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 2023279
(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))))