
(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 18 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
(let* ((t_1 (* (- y z) (- t z))))
(if (<= t_1 -2e+212)
(/ (* (/ 1.0 (- y z)) x) (- t z))
(if (<= t_1 1e+137) (/ x t_1) (/ (/ x (- y z)) (- t z))))))assert(y < t);
double code(double x, double y, double z, double t) {
double t_1 = (y - z) * (t - z);
double tmp;
if (t_1 <= -2e+212) {
tmp = ((1.0 / (y - z)) * x) / (t - z);
} else if (t_1 <= 1e+137) {
tmp = x / t_1;
} else {
tmp = (x / (y - z)) / (t - 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 = (y - z) * (t - z)
if (t_1 <= (-2d+212)) then
tmp = ((1.0d0 / (y - z)) * x) / (t - z)
else if (t_1 <= 1d+137) then
tmp = x / t_1
else
tmp = (x / (y - z)) / (t - 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 = (y - z) * (t - z);
double tmp;
if (t_1 <= -2e+212) {
tmp = ((1.0 / (y - z)) * x) / (t - z);
} else if (t_1 <= 1e+137) {
tmp = x / t_1;
} else {
tmp = (x / (y - z)) / (t - z);
}
return tmp;
}
[y, t] = sort([y, t]) def code(x, y, z, t): t_1 = (y - z) * (t - z) tmp = 0 if t_1 <= -2e+212: tmp = ((1.0 / (y - z)) * x) / (t - z) elif t_1 <= 1e+137: tmp = x / t_1 else: tmp = (x / (y - z)) / (t - z) return tmp
y, t = sort([y, t]) function code(x, y, z, t) t_1 = Float64(Float64(y - z) * Float64(t - z)) tmp = 0.0 if (t_1 <= -2e+212) tmp = Float64(Float64(Float64(1.0 / Float64(y - z)) * x) / Float64(t - z)); elseif (t_1 <= 1e+137) tmp = Float64(x / t_1); else tmp = Float64(Float64(x / Float64(y - z)) / Float64(t - z)); end return tmp end
y, t = num2cell(sort([y, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = (y - z) * (t - z);
tmp = 0.0;
if (t_1 <= -2e+212)
tmp = ((1.0 / (y - z)) * x) / (t - z);
elseif (t_1 <= 1e+137)
tmp = x / t_1;
else
tmp = (x / (y - z)) / (t - z);
end
tmp_2 = tmp;
end
NOTE: y and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(y - z), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -2e+212], N[(N[(N[(1.0 / N[(y - z), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e+137], N[(x / t$95$1), $MachinePrecision], N[(N[(x / N[(y - z), $MachinePrecision]), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[y, t] = \mathsf{sort}([y, t])\\
\\
\begin{array}{l}
t_1 := \left(y - z\right) \cdot \left(t - z\right)\\
\mathbf{if}\;t_1 \leq -2 \cdot 10^{+212}:\\
\;\;\;\;\frac{\frac{1}{y - z} \cdot x}{t - z}\\
\mathbf{elif}\;t_1 \leq 10^{+137}:\\
\;\;\;\;\frac{x}{t_1}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y - z}}{t - z}\\
\end{array}
\end{array}
if (*.f64 (-.f64 y z) (-.f64 t z)) < -1.9999999999999998e212Initial program 76.2%
associate-/r*99.7%
Simplified99.7%
clear-num99.8%
associate-/r/99.7%
Applied egg-rr99.7%
if -1.9999999999999998e212 < (*.f64 (-.f64 y z) (-.f64 t z)) < 1e137Initial program 98.9%
if 1e137 < (*.f64 (-.f64 y z) (-.f64 t z)) Initial program 87.9%
associate-/r*99.0%
Simplified99.0%
Final simplification99.0%
NOTE: y and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* (- y z) (- t z))))
(if (<= t_1 -2e+212)
(* (/ x (- y z)) (/ 1.0 t))
(if (<= t_1 1.1e+306) (/ x t_1) (* (/ -1.0 z) (/ x (- t z)))))))assert(y < t);
double code(double x, double y, double z, double t) {
double t_1 = (y - z) * (t - z);
double tmp;
if (t_1 <= -2e+212) {
tmp = (x / (y - z)) * (1.0 / t);
} else if (t_1 <= 1.1e+306) {
tmp = x / t_1;
} else {
tmp = (-1.0 / z) * (x / (t - 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 = (y - z) * (t - z)
if (t_1 <= (-2d+212)) then
tmp = (x / (y - z)) * (1.0d0 / t)
else if (t_1 <= 1.1d+306) then
tmp = x / t_1
else
tmp = ((-1.0d0) / z) * (x / (t - 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 = (y - z) * (t - z);
double tmp;
if (t_1 <= -2e+212) {
tmp = (x / (y - z)) * (1.0 / t);
} else if (t_1 <= 1.1e+306) {
tmp = x / t_1;
} else {
tmp = (-1.0 / z) * (x / (t - z));
}
return tmp;
}
[y, t] = sort([y, t]) def code(x, y, z, t): t_1 = (y - z) * (t - z) tmp = 0 if t_1 <= -2e+212: tmp = (x / (y - z)) * (1.0 / t) elif t_1 <= 1.1e+306: tmp = x / t_1 else: tmp = (-1.0 / z) * (x / (t - z)) return tmp
y, t = sort([y, t]) function code(x, y, z, t) t_1 = Float64(Float64(y - z) * Float64(t - z)) tmp = 0.0 if (t_1 <= -2e+212) tmp = Float64(Float64(x / Float64(y - z)) * Float64(1.0 / t)); elseif (t_1 <= 1.1e+306) tmp = Float64(x / t_1); else tmp = Float64(Float64(-1.0 / z) * Float64(x / Float64(t - z))); end return tmp end
y, t = num2cell(sort([y, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = (y - z) * (t - z);
tmp = 0.0;
if (t_1 <= -2e+212)
tmp = (x / (y - z)) * (1.0 / t);
elseif (t_1 <= 1.1e+306)
tmp = x / t_1;
else
tmp = (-1.0 / z) * (x / (t - z));
end
tmp_2 = tmp;
end
NOTE: y and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(y - z), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -2e+212], N[(N[(x / N[(y - z), $MachinePrecision]), $MachinePrecision] * N[(1.0 / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1.1e+306], N[(x / t$95$1), $MachinePrecision], N[(N[(-1.0 / z), $MachinePrecision] * N[(x / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[y, t] = \mathsf{sort}([y, t])\\
\\
\begin{array}{l}
t_1 := \left(y - z\right) \cdot \left(t - z\right)\\
\mathbf{if}\;t_1 \leq -2 \cdot 10^{+212}:\\
\;\;\;\;\frac{x}{y - z} \cdot \frac{1}{t}\\
\mathbf{elif}\;t_1 \leq 1.1 \cdot 10^{+306}:\\
\;\;\;\;\frac{x}{t_1}\\
\mathbf{else}:\\
\;\;\;\;\frac{-1}{z} \cdot \frac{x}{t - z}\\
\end{array}
\end{array}
if (*.f64 (-.f64 y z) (-.f64 t z)) < -1.9999999999999998e212Initial program 76.2%
associate-/r*99.7%
div-inv99.8%
Applied egg-rr99.8%
Taylor expanded in t around inf 87.8%
if -1.9999999999999998e212 < (*.f64 (-.f64 y z) (-.f64 t z)) < 1.1e306Initial program 99.1%
if 1.1e306 < (*.f64 (-.f64 y z) (-.f64 t z)) Initial program 80.6%
*-un-lft-identity80.6%
times-frac99.9%
Applied egg-rr99.9%
Taylor expanded in y around 0 86.5%
Final simplification94.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 (* (- y z) (- t z))) (t_2 (/ x (- y z))))
(if (<= t_1 -2e+212)
(* t_2 (/ 1.0 t))
(if (<= t_1 1e+137) (/ x t_1) (/ t_2 (- t z))))))assert(y < t);
double code(double x, double y, double z, double t) {
double t_1 = (y - z) * (t - z);
double t_2 = x / (y - z);
double tmp;
if (t_1 <= -2e+212) {
tmp = t_2 * (1.0 / t);
} else if (t_1 <= 1e+137) {
tmp = x / t_1;
} else {
tmp = t_2 / (t - z);
}
return tmp;
}
NOTE: y and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (y - z) * (t - z)
t_2 = x / (y - z)
if (t_1 <= (-2d+212)) then
tmp = t_2 * (1.0d0 / t)
else if (t_1 <= 1d+137) then
tmp = x / t_1
else
tmp = t_2 / (t - 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 = (y - z) * (t - z);
double t_2 = x / (y - z);
double tmp;
if (t_1 <= -2e+212) {
tmp = t_2 * (1.0 / t);
} else if (t_1 <= 1e+137) {
tmp = x / t_1;
} else {
tmp = t_2 / (t - z);
}
return tmp;
}
[y, t] = sort([y, t]) def code(x, y, z, t): t_1 = (y - z) * (t - z) t_2 = x / (y - z) tmp = 0 if t_1 <= -2e+212: tmp = t_2 * (1.0 / t) elif t_1 <= 1e+137: tmp = x / t_1 else: tmp = t_2 / (t - z) return tmp
y, t = sort([y, t]) function code(x, y, z, t) t_1 = Float64(Float64(y - z) * Float64(t - z)) t_2 = Float64(x / Float64(y - z)) tmp = 0.0 if (t_1 <= -2e+212) tmp = Float64(t_2 * Float64(1.0 / t)); elseif (t_1 <= 1e+137) tmp = Float64(x / t_1); else tmp = Float64(t_2 / Float64(t - z)); end return tmp end
y, t = num2cell(sort([y, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = (y - z) * (t - z);
t_2 = x / (y - z);
tmp = 0.0;
if (t_1 <= -2e+212)
tmp = t_2 * (1.0 / t);
elseif (t_1 <= 1e+137)
tmp = x / t_1;
else
tmp = t_2 / (t - z);
end
tmp_2 = tmp;
end
NOTE: y and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(y - z), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x / N[(y - z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -2e+212], N[(t$95$2 * N[(1.0 / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e+137], N[(x / t$95$1), $MachinePrecision], N[(t$95$2 / N[(t - z), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[y, t] = \mathsf{sort}([y, t])\\
\\
\begin{array}{l}
t_1 := \left(y - z\right) \cdot \left(t - z\right)\\
t_2 := \frac{x}{y - z}\\
\mathbf{if}\;t_1 \leq -2 \cdot 10^{+212}:\\
\;\;\;\;t_2 \cdot \frac{1}{t}\\
\mathbf{elif}\;t_1 \leq 10^{+137}:\\
\;\;\;\;\frac{x}{t_1}\\
\mathbf{else}:\\
\;\;\;\;\frac{t_2}{t - z}\\
\end{array}
\end{array}
if (*.f64 (-.f64 y z) (-.f64 t z)) < -1.9999999999999998e212Initial program 76.2%
associate-/r*99.7%
div-inv99.8%
Applied egg-rr99.8%
Taylor expanded in t around inf 87.8%
if -1.9999999999999998e212 < (*.f64 (-.f64 y z) (-.f64 t z)) < 1e137Initial program 98.9%
if 1e137 < (*.f64 (-.f64 y z) (-.f64 t z)) Initial program 87.9%
associate-/r*99.0%
Simplified99.0%
Final simplification97.9%
NOTE: y and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ (/ x (- y z)) t)))
(if (<= z -2e+157)
(* (/ x z) (/ 1.0 z))
(if (<= z -7.6e-134)
t_1
(if (<= z 4.1e-7)
(/ x (* y (- t z)))
(if (<= z 1.65e+71)
t_1
(if (<= z 9.2e+82) (/ (/ x y) (- t z)) (/ (/ x z) z))))))))assert(y < t);
double code(double x, double y, double z, double t) {
double t_1 = (x / (y - z)) / t;
double tmp;
if (z <= -2e+157) {
tmp = (x / z) * (1.0 / z);
} else if (z <= -7.6e-134) {
tmp = t_1;
} else if (z <= 4.1e-7) {
tmp = x / (y * (t - z));
} else if (z <= 1.65e+71) {
tmp = t_1;
} else if (z <= 9.2e+82) {
tmp = (x / y) / (t - z);
} else {
tmp = (x / z) / 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 / (y - z)) / t
if (z <= (-2d+157)) then
tmp = (x / z) * (1.0d0 / z)
else if (z <= (-7.6d-134)) then
tmp = t_1
else if (z <= 4.1d-7) then
tmp = x / (y * (t - z))
else if (z <= 1.65d+71) then
tmp = t_1
else if (z <= 9.2d+82) then
tmp = (x / y) / (t - z)
else
tmp = (x / z) / z
end if
code = tmp
end function
assert y < t;
public static double code(double x, double y, double z, double t) {
double t_1 = (x / (y - z)) / t;
double tmp;
if (z <= -2e+157) {
tmp = (x / z) * (1.0 / z);
} else if (z <= -7.6e-134) {
tmp = t_1;
} else if (z <= 4.1e-7) {
tmp = x / (y * (t - z));
} else if (z <= 1.65e+71) {
tmp = t_1;
} else if (z <= 9.2e+82) {
tmp = (x / y) / (t - z);
} else {
tmp = (x / z) / z;
}
return tmp;
}
[y, t] = sort([y, t]) def code(x, y, z, t): t_1 = (x / (y - z)) / t tmp = 0 if z <= -2e+157: tmp = (x / z) * (1.0 / z) elif z <= -7.6e-134: tmp = t_1 elif z <= 4.1e-7: tmp = x / (y * (t - z)) elif z <= 1.65e+71: tmp = t_1 elif z <= 9.2e+82: tmp = (x / y) / (t - z) else: tmp = (x / z) / z return tmp
y, t = sort([y, t]) function code(x, y, z, t) t_1 = Float64(Float64(x / Float64(y - z)) / t) tmp = 0.0 if (z <= -2e+157) tmp = Float64(Float64(x / z) * Float64(1.0 / z)); elseif (z <= -7.6e-134) tmp = t_1; elseif (z <= 4.1e-7) tmp = Float64(x / Float64(y * Float64(t - z))); elseif (z <= 1.65e+71) tmp = t_1; elseif (z <= 9.2e+82) tmp = Float64(Float64(x / y) / Float64(t - z)); else tmp = Float64(Float64(x / z) / z); end return tmp end
y, t = num2cell(sort([y, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = (x / (y - z)) / t;
tmp = 0.0;
if (z <= -2e+157)
tmp = (x / z) * (1.0 / z);
elseif (z <= -7.6e-134)
tmp = t_1;
elseif (z <= 4.1e-7)
tmp = x / (y * (t - z));
elseif (z <= 1.65e+71)
tmp = t_1;
elseif (z <= 9.2e+82)
tmp = (x / y) / (t - z);
else
tmp = (x / z) / z;
end
tmp_2 = tmp;
end
NOTE: y and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x / N[(y - z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]}, If[LessEqual[z, -2e+157], N[(N[(x / z), $MachinePrecision] * N[(1.0 / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -7.6e-134], t$95$1, If[LessEqual[z, 4.1e-7], N[(x / N[(y * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.65e+71], t$95$1, If[LessEqual[z, 9.2e+82], N[(N[(x / y), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], N[(N[(x / z), $MachinePrecision] / z), $MachinePrecision]]]]]]]
\begin{array}{l}
[y, t] = \mathsf{sort}([y, t])\\
\\
\begin{array}{l}
t_1 := \frac{\frac{x}{y - z}}{t}\\
\mathbf{if}\;z \leq -2 \cdot 10^{+157}:\\
\;\;\;\;\frac{x}{z} \cdot \frac{1}{z}\\
\mathbf{elif}\;z \leq -7.6 \cdot 10^{-134}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 4.1 \cdot 10^{-7}:\\
\;\;\;\;\frac{x}{y \cdot \left(t - z\right)}\\
\mathbf{elif}\;z \leq 1.65 \cdot 10^{+71}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 9.2 \cdot 10^{+82}:\\
\;\;\;\;\frac{\frac{x}{y}}{t - z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{z}}{z}\\
\end{array}
\end{array}
if z < -1.99999999999999997e157Initial program 89.4%
Taylor expanded in z around inf 89.4%
unpow289.4%
Simplified89.4%
associate-/r*96.3%
div-inv96.4%
Applied egg-rr96.4%
if -1.99999999999999997e157 < z < -7.60000000000000006e-134 or 4.0999999999999999e-7 < z < 1.6499999999999999e71Initial program 93.1%
Taylor expanded in t around inf 56.0%
*-commutative56.0%
associate-/r*68.9%
Simplified68.9%
if -7.60000000000000006e-134 < z < 4.0999999999999999e-7Initial program 97.0%
Taylor expanded in y around inf 75.9%
*-commutative75.9%
Simplified75.9%
if 1.6499999999999999e71 < z < 9.19999999999999953e82Initial program 73.7%
Taylor expanded in y around inf 72.5%
associate-/r*99.0%
Simplified99.0%
if 9.19999999999999953e82 < z Initial program 82.5%
*-un-lft-identity82.5%
times-frac99.8%
Applied egg-rr99.8%
associate-*l/99.8%
associate-/l*98.8%
Applied egg-rr98.8%
Taylor expanded in z around inf 82.4%
*-rgt-identity82.4%
unpow282.4%
times-frac94.4%
associate-*r/94.4%
*-rgt-identity94.4%
Simplified94.4%
Final simplification80.0%
NOTE: y and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(if (<= z -2e+157)
(* (/ x z) (/ 1.0 z))
(if (<= z -1.3e-133)
(/ (/ x (- y z)) t)
(if (<= z 5e-121)
(/ x (* y (- t z)))
(if (<= z 2.05e+161) (/ (- x) (* z (- y z))) (/ (/ x z) z))))))assert(y < t);
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -2e+157) {
tmp = (x / z) * (1.0 / z);
} else if (z <= -1.3e-133) {
tmp = (x / (y - z)) / t;
} else if (z <= 5e-121) {
tmp = x / (y * (t - z));
} else if (z <= 2.05e+161) {
tmp = -x / (z * (y - z));
} else {
tmp = (x / z) / z;
}
return tmp;
}
NOTE: y and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (z <= (-2d+157)) then
tmp = (x / z) * (1.0d0 / z)
else if (z <= (-1.3d-133)) then
tmp = (x / (y - z)) / t
else if (z <= 5d-121) then
tmp = x / (y * (t - z))
else if (z <= 2.05d+161) then
tmp = -x / (z * (y - z))
else
tmp = (x / z) / z
end if
code = tmp
end function
assert y < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -2e+157) {
tmp = (x / z) * (1.0 / z);
} else if (z <= -1.3e-133) {
tmp = (x / (y - z)) / t;
} else if (z <= 5e-121) {
tmp = x / (y * (t - z));
} else if (z <= 2.05e+161) {
tmp = -x / (z * (y - z));
} else {
tmp = (x / z) / z;
}
return tmp;
}
[y, t] = sort([y, t]) def code(x, y, z, t): tmp = 0 if z <= -2e+157: tmp = (x / z) * (1.0 / z) elif z <= -1.3e-133: tmp = (x / (y - z)) / t elif z <= 5e-121: tmp = x / (y * (t - z)) elif z <= 2.05e+161: tmp = -x / (z * (y - z)) else: tmp = (x / z) / z return tmp
y, t = sort([y, t]) function code(x, y, z, t) tmp = 0.0 if (z <= -2e+157) tmp = Float64(Float64(x / z) * Float64(1.0 / z)); elseif (z <= -1.3e-133) tmp = Float64(Float64(x / Float64(y - z)) / t); elseif (z <= 5e-121) tmp = Float64(x / Float64(y * Float64(t - z))); elseif (z <= 2.05e+161) tmp = Float64(Float64(-x) / Float64(z * Float64(y - z))); else tmp = Float64(Float64(x / z) / z); end return tmp end
y, t = num2cell(sort([y, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (z <= -2e+157)
tmp = (x / z) * (1.0 / z);
elseif (z <= -1.3e-133)
tmp = (x / (y - z)) / t;
elseif (z <= 5e-121)
tmp = x / (y * (t - z));
elseif (z <= 2.05e+161)
tmp = -x / (z * (y - z));
else
tmp = (x / z) / z;
end
tmp_2 = tmp;
end
NOTE: y and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[z, -2e+157], N[(N[(x / z), $MachinePrecision] * N[(1.0 / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -1.3e-133], N[(N[(x / N[(y - z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[z, 5e-121], N[(x / N[(y * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.05e+161], N[((-x) / N[(z * N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / z), $MachinePrecision] / z), $MachinePrecision]]]]]
\begin{array}{l}
[y, t] = \mathsf{sort}([y, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2 \cdot 10^{+157}:\\
\;\;\;\;\frac{x}{z} \cdot \frac{1}{z}\\
\mathbf{elif}\;z \leq -1.3 \cdot 10^{-133}:\\
\;\;\;\;\frac{\frac{x}{y - z}}{t}\\
\mathbf{elif}\;z \leq 5 \cdot 10^{-121}:\\
\;\;\;\;\frac{x}{y \cdot \left(t - z\right)}\\
\mathbf{elif}\;z \leq 2.05 \cdot 10^{+161}:\\
\;\;\;\;\frac{-x}{z \cdot \left(y - z\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{z}}{z}\\
\end{array}
\end{array}
if z < -1.99999999999999997e157Initial program 89.4%
Taylor expanded in z around inf 89.4%
unpow289.4%
Simplified89.4%
associate-/r*96.3%
div-inv96.4%
Applied egg-rr96.4%
if -1.99999999999999997e157 < z < -1.3e-133Initial program 91.5%
Taylor expanded in t around inf 58.0%
*-commutative58.0%
associate-/r*72.7%
Simplified72.7%
if -1.3e-133 < z < 4.99999999999999989e-121Initial program 96.0%
Taylor expanded in y around inf 82.0%
*-commutative82.0%
Simplified82.0%
if 4.99999999999999989e-121 < z < 2.0500000000000001e161Initial program 95.6%
Taylor expanded in t around 0 73.0%
associate-*r/73.0%
neg-mul-173.0%
Simplified73.0%
if 2.0500000000000001e161 < z Initial program 76.8%
*-un-lft-identity76.8%
times-frac99.9%
Applied egg-rr99.9%
associate-*l/99.9%
associate-/l*98.1%
Applied egg-rr98.1%
Taylor expanded in z around inf 76.8%
*-rgt-identity76.8%
unpow276.8%
times-frac96.9%
associate-*r/97.0%
*-rgt-identity97.0%
Simplified97.0%
Final simplification80.9%
NOTE: y and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ (/ x z) z)) (t_2 (/ x (* (- y z) t))))
(if (<= z -4.6e+77)
t_1
(if (<= z -4.3e-131)
t_2
(if (<= z 3.5e-89) (/ x (* y (- t z))) (if (<= z 9e+82) t_2 t_1))))))assert(y < t);
double code(double x, double y, double z, double t) {
double t_1 = (x / z) / z;
double t_2 = x / ((y - z) * t);
double tmp;
if (z <= -4.6e+77) {
tmp = t_1;
} else if (z <= -4.3e-131) {
tmp = t_2;
} else if (z <= 3.5e-89) {
tmp = x / (y * (t - z));
} else if (z <= 9e+82) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
NOTE: y and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (x / z) / z
t_2 = x / ((y - z) * t)
if (z <= (-4.6d+77)) then
tmp = t_1
else if (z <= (-4.3d-131)) then
tmp = t_2
else if (z <= 3.5d-89) then
tmp = x / (y * (t - z))
else if (z <= 9d+82) then
tmp = t_2
else
tmp = t_1
end if
code = tmp
end function
assert y < t;
public static double code(double x, double y, double z, double t) {
double t_1 = (x / z) / z;
double t_2 = x / ((y - z) * t);
double tmp;
if (z <= -4.6e+77) {
tmp = t_1;
} else if (z <= -4.3e-131) {
tmp = t_2;
} else if (z <= 3.5e-89) {
tmp = x / (y * (t - z));
} else if (z <= 9e+82) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
[y, t] = sort([y, t]) def code(x, y, z, t): t_1 = (x / z) / z t_2 = x / ((y - z) * t) tmp = 0 if z <= -4.6e+77: tmp = t_1 elif z <= -4.3e-131: tmp = t_2 elif z <= 3.5e-89: tmp = x / (y * (t - z)) elif z <= 9e+82: tmp = t_2 else: tmp = t_1 return tmp
y, t = sort([y, t]) function code(x, y, z, t) t_1 = Float64(Float64(x / z) / z) t_2 = Float64(x / Float64(Float64(y - z) * t)) tmp = 0.0 if (z <= -4.6e+77) tmp = t_1; elseif (z <= -4.3e-131) tmp = t_2; elseif (z <= 3.5e-89) tmp = Float64(x / Float64(y * Float64(t - z))); elseif (z <= 9e+82) tmp = t_2; else tmp = t_1; end return tmp end
y, t = num2cell(sort([y, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = (x / z) / z;
t_2 = x / ((y - z) * t);
tmp = 0.0;
if (z <= -4.6e+77)
tmp = t_1;
elseif (z <= -4.3e-131)
tmp = t_2;
elseif (z <= 3.5e-89)
tmp = x / (y * (t - z));
elseif (z <= 9e+82)
tmp = t_2;
else
tmp = t_1;
end
tmp_2 = tmp;
end
NOTE: y and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x / z), $MachinePrecision] / z), $MachinePrecision]}, Block[{t$95$2 = N[(x / N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -4.6e+77], t$95$1, If[LessEqual[z, -4.3e-131], t$95$2, If[LessEqual[z, 3.5e-89], N[(x / N[(y * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 9e+82], t$95$2, t$95$1]]]]]]
\begin{array}{l}
[y, t] = \mathsf{sort}([y, t])\\
\\
\begin{array}{l}
t_1 := \frac{\frac{x}{z}}{z}\\
t_2 := \frac{x}{\left(y - z\right) \cdot t}\\
\mathbf{if}\;z \leq -4.6 \cdot 10^{+77}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -4.3 \cdot 10^{-131}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq 3.5 \cdot 10^{-89}:\\
\;\;\;\;\frac{x}{y \cdot \left(t - z\right)}\\
\mathbf{elif}\;z \leq 9 \cdot 10^{+82}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -4.5999999999999999e77 or 8.9999999999999993e82 < z Initial program 84.9%
*-un-lft-identity84.9%
times-frac99.8%
Applied egg-rr99.8%
associate-*l/99.9%
associate-/l*99.2%
Applied egg-rr99.2%
Taylor expanded in z around inf 82.6%
*-rgt-identity82.6%
unpow282.6%
times-frac91.4%
associate-*r/91.4%
*-rgt-identity91.4%
Simplified91.4%
if -4.5999999999999999e77 < z < -4.30000000000000019e-131 or 3.4999999999999997e-89 < z < 8.9999999999999993e82Initial program 95.1%
Taylor expanded in t around inf 54.9%
if -4.30000000000000019e-131 < z < 3.4999999999999997e-89Initial program 96.4%
Taylor expanded in y around inf 79.4%
*-commutative79.4%
Simplified79.4%
Final simplification76.1%
NOTE: y and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(if (<= z -1.42e-13)
(/ (- (/ x z)) (- t z))
(if (<= z -1.12e-138)
(/ (/ x (- y z)) t)
(if (<= z 1.6e-93) (/ x (* y (- t z))) (* (/ -1.0 z) (/ x (- t z)))))))assert(y < t);
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.42e-13) {
tmp = -(x / z) / (t - z);
} else if (z <= -1.12e-138) {
tmp = (x / (y - z)) / t;
} else if (z <= 1.6e-93) {
tmp = x / (y * (t - z));
} else {
tmp = (-1.0 / z) * (x / (t - z));
}
return tmp;
}
NOTE: y and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (z <= (-1.42d-13)) then
tmp = -(x / z) / (t - z)
else if (z <= (-1.12d-138)) then
tmp = (x / (y - z)) / t
else if (z <= 1.6d-93) then
tmp = x / (y * (t - z))
else
tmp = ((-1.0d0) / z) * (x / (t - z))
end if
code = tmp
end function
assert y < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.42e-13) {
tmp = -(x / z) / (t - z);
} else if (z <= -1.12e-138) {
tmp = (x / (y - z)) / t;
} else if (z <= 1.6e-93) {
tmp = x / (y * (t - z));
} else {
tmp = (-1.0 / z) * (x / (t - z));
}
return tmp;
}
[y, t] = sort([y, t]) def code(x, y, z, t): tmp = 0 if z <= -1.42e-13: tmp = -(x / z) / (t - z) elif z <= -1.12e-138: tmp = (x / (y - z)) / t elif z <= 1.6e-93: tmp = x / (y * (t - z)) else: tmp = (-1.0 / z) * (x / (t - z)) return tmp
y, t = sort([y, t]) function code(x, y, z, t) tmp = 0.0 if (z <= -1.42e-13) tmp = Float64(Float64(-Float64(x / z)) / Float64(t - z)); elseif (z <= -1.12e-138) tmp = Float64(Float64(x / Float64(y - z)) / t); elseif (z <= 1.6e-93) tmp = Float64(x / Float64(y * Float64(t - z))); else tmp = Float64(Float64(-1.0 / z) * Float64(x / Float64(t - z))); end return tmp end
y, t = num2cell(sort([y, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (z <= -1.42e-13)
tmp = -(x / z) / (t - z);
elseif (z <= -1.12e-138)
tmp = (x / (y - z)) / t;
elseif (z <= 1.6e-93)
tmp = x / (y * (t - z));
else
tmp = (-1.0 / z) * (x / (t - z));
end
tmp_2 = tmp;
end
NOTE: y and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[z, -1.42e-13], N[((-N[(x / z), $MachinePrecision]) / N[(t - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -1.12e-138], N[(N[(x / N[(y - z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[z, 1.6e-93], N[(x / N[(y * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(-1.0 / z), $MachinePrecision] * N[(x / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[y, t] = \mathsf{sort}([y, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.42 \cdot 10^{-13}:\\
\;\;\;\;\frac{-\frac{x}{z}}{t - z}\\
\mathbf{elif}\;z \leq -1.12 \cdot 10^{-138}:\\
\;\;\;\;\frac{\frac{x}{y - z}}{t}\\
\mathbf{elif}\;z \leq 1.6 \cdot 10^{-93}:\\
\;\;\;\;\frac{x}{y \cdot \left(t - z\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{-1}{z} \cdot \frac{x}{t - z}\\
\end{array}
\end{array}
if z < -1.42e-13Initial program 91.7%
Taylor expanded in y around 0 78.0%
mul-1-neg78.0%
distribute-frac-neg78.0%
associate-/r*79.6%
Simplified79.6%
if -1.42e-13 < z < -1.1199999999999999e-138Initial program 89.1%
Taylor expanded in t around inf 78.4%
*-commutative78.4%
associate-/r*88.9%
Simplified88.9%
if -1.1199999999999999e-138 < z < 1.5999999999999999e-93Initial program 96.3%
Taylor expanded in y around inf 79.8%
*-commutative79.8%
Simplified79.8%
if 1.5999999999999999e-93 < z Initial program 88.9%
*-un-lft-identity88.9%
times-frac97.6%
Applied egg-rr97.6%
Taylor expanded in y around 0 80.7%
Final simplification81.0%
NOTE: y and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(if (<= z -1.55e-13)
(/ (- (/ x z)) (- t z))
(if (<= z -9.5e-139)
(* (/ x (- y z)) (/ 1.0 t))
(if (<= z 7.2e-92) (/ x (* y (- t z))) (* (/ -1.0 z) (/ x (- t z)))))))assert(y < t);
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.55e-13) {
tmp = -(x / z) / (t - z);
} else if (z <= -9.5e-139) {
tmp = (x / (y - z)) * (1.0 / t);
} else if (z <= 7.2e-92) {
tmp = x / (y * (t - z));
} else {
tmp = (-1.0 / z) * (x / (t - z));
}
return tmp;
}
NOTE: y and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (z <= (-1.55d-13)) then
tmp = -(x / z) / (t - z)
else if (z <= (-9.5d-139)) then
tmp = (x / (y - z)) * (1.0d0 / t)
else if (z <= 7.2d-92) then
tmp = x / (y * (t - z))
else
tmp = ((-1.0d0) / z) * (x / (t - z))
end if
code = tmp
end function
assert y < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.55e-13) {
tmp = -(x / z) / (t - z);
} else if (z <= -9.5e-139) {
tmp = (x / (y - z)) * (1.0 / t);
} else if (z <= 7.2e-92) {
tmp = x / (y * (t - z));
} else {
tmp = (-1.0 / z) * (x / (t - z));
}
return tmp;
}
[y, t] = sort([y, t]) def code(x, y, z, t): tmp = 0 if z <= -1.55e-13: tmp = -(x / z) / (t - z) elif z <= -9.5e-139: tmp = (x / (y - z)) * (1.0 / t) elif z <= 7.2e-92: tmp = x / (y * (t - z)) else: tmp = (-1.0 / z) * (x / (t - z)) return tmp
y, t = sort([y, t]) function code(x, y, z, t) tmp = 0.0 if (z <= -1.55e-13) tmp = Float64(Float64(-Float64(x / z)) / Float64(t - z)); elseif (z <= -9.5e-139) tmp = Float64(Float64(x / Float64(y - z)) * Float64(1.0 / t)); elseif (z <= 7.2e-92) tmp = Float64(x / Float64(y * Float64(t - z))); else tmp = Float64(Float64(-1.0 / z) * Float64(x / Float64(t - z))); end return tmp end
y, t = num2cell(sort([y, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (z <= -1.55e-13)
tmp = -(x / z) / (t - z);
elseif (z <= -9.5e-139)
tmp = (x / (y - z)) * (1.0 / t);
elseif (z <= 7.2e-92)
tmp = x / (y * (t - z));
else
tmp = (-1.0 / z) * (x / (t - z));
end
tmp_2 = tmp;
end
NOTE: y and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[z, -1.55e-13], N[((-N[(x / z), $MachinePrecision]) / N[(t - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -9.5e-139], N[(N[(x / N[(y - z), $MachinePrecision]), $MachinePrecision] * N[(1.0 / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 7.2e-92], N[(x / N[(y * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(-1.0 / z), $MachinePrecision] * N[(x / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[y, t] = \mathsf{sort}([y, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.55 \cdot 10^{-13}:\\
\;\;\;\;\frac{-\frac{x}{z}}{t - z}\\
\mathbf{elif}\;z \leq -9.5 \cdot 10^{-139}:\\
\;\;\;\;\frac{x}{y - z} \cdot \frac{1}{t}\\
\mathbf{elif}\;z \leq 7.2 \cdot 10^{-92}:\\
\;\;\;\;\frac{x}{y \cdot \left(t - z\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{-1}{z} \cdot \frac{x}{t - z}\\
\end{array}
\end{array}
if z < -1.55e-13Initial program 91.7%
Taylor expanded in y around 0 78.0%
mul-1-neg78.0%
distribute-frac-neg78.0%
associate-/r*79.6%
Simplified79.6%
if -1.55e-13 < z < -9.5000000000000006e-139Initial program 89.1%
associate-/r*96.1%
div-inv96.3%
Applied egg-rr96.3%
Taylor expanded in t around inf 89.1%
if -9.5000000000000006e-139 < z < 7.20000000000000032e-92Initial program 96.3%
Taylor expanded in y around inf 79.8%
*-commutative79.8%
Simplified79.8%
if 7.20000000000000032e-92 < z Initial program 88.9%
*-un-lft-identity88.9%
times-frac97.6%
Applied egg-rr97.6%
Taylor expanded in y around 0 80.7%
Final simplification81.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)) (- t z))))
(if (<= z -2.3e-12)
t_1
(if (<= z -9e-134)
(/ (/ x (- y z)) t)
(if (<= z 1.02e-92) (/ x (* y (- t z))) t_1)))))assert(y < t);
double code(double x, double y, double z, double t) {
double t_1 = -(x / z) / (t - z);
double tmp;
if (z <= -2.3e-12) {
tmp = t_1;
} else if (z <= -9e-134) {
tmp = (x / (y - z)) / t;
} else if (z <= 1.02e-92) {
tmp = x / (y * (t - 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 = -(x / z) / (t - z)
if (z <= (-2.3d-12)) then
tmp = t_1
else if (z <= (-9d-134)) then
tmp = (x / (y - z)) / t
else if (z <= 1.02d-92) then
tmp = x / (y * (t - 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 = -(x / z) / (t - z);
double tmp;
if (z <= -2.3e-12) {
tmp = t_1;
} else if (z <= -9e-134) {
tmp = (x / (y - z)) / t;
} else if (z <= 1.02e-92) {
tmp = x / (y * (t - z));
} else {
tmp = t_1;
}
return tmp;
}
[y, t] = sort([y, t]) def code(x, y, z, t): t_1 = -(x / z) / (t - z) tmp = 0 if z <= -2.3e-12: tmp = t_1 elif z <= -9e-134: tmp = (x / (y - z)) / t elif z <= 1.02e-92: tmp = x / (y * (t - z)) else: tmp = t_1 return tmp
y, t = sort([y, t]) function code(x, y, z, t) t_1 = Float64(Float64(-Float64(x / z)) / Float64(t - z)) tmp = 0.0 if (z <= -2.3e-12) tmp = t_1; elseif (z <= -9e-134) tmp = Float64(Float64(x / Float64(y - z)) / t); elseif (z <= 1.02e-92) tmp = Float64(x / Float64(y * Float64(t - 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 = -(x / z) / (t - z);
tmp = 0.0;
if (z <= -2.3e-12)
tmp = t_1;
elseif (z <= -9e-134)
tmp = (x / (y - z)) / t;
elseif (z <= 1.02e-92)
tmp = x / (y * (t - 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[((-N[(x / z), $MachinePrecision]) / N[(t - z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.3e-12], t$95$1, If[LessEqual[z, -9e-134], N[(N[(x / N[(y - z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[z, 1.02e-92], N[(x / N[(y * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
[y, t] = \mathsf{sort}([y, t])\\
\\
\begin{array}{l}
t_1 := \frac{-\frac{x}{z}}{t - z}\\
\mathbf{if}\;z \leq -2.3 \cdot 10^{-12}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -9 \cdot 10^{-134}:\\
\;\;\;\;\frac{\frac{x}{y - z}}{t}\\
\mathbf{elif}\;z \leq 1.02 \cdot 10^{-92}:\\
\;\;\;\;\frac{x}{y \cdot \left(t - z\right)}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -2.29999999999999989e-12 or 1.02000000000000005e-92 < z Initial program 89.9%
Taylor expanded in y around 0 75.5%
mul-1-neg75.5%
distribute-frac-neg75.5%
associate-/r*80.3%
Simplified80.3%
if -2.29999999999999989e-12 < z < -9.000000000000001e-134Initial program 89.1%
Taylor expanded in t around inf 78.4%
*-commutative78.4%
associate-/r*88.9%
Simplified88.9%
if -9.000000000000001e-134 < z < 1.02000000000000005e-92Initial program 96.3%
Taylor expanded in y around inf 79.8%
*-commutative79.8%
Simplified79.8%
Final simplification81.0%
NOTE: y and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(if (<= z -1.85e+139)
(* (/ x z) (/ 1.0 z))
(if (<= z -2.1e-134)
(/ (/ x t) (- y z))
(if (<= z 9.2e+82) (/ x (* y (- t z))) (/ (/ x z) z)))))assert(y < t);
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.85e+139) {
tmp = (x / z) * (1.0 / z);
} else if (z <= -2.1e-134) {
tmp = (x / t) / (y - z);
} else if (z <= 9.2e+82) {
tmp = x / (y * (t - z));
} else {
tmp = (x / z) / z;
}
return tmp;
}
NOTE: y and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (z <= (-1.85d+139)) then
tmp = (x / z) * (1.0d0 / z)
else if (z <= (-2.1d-134)) then
tmp = (x / t) / (y - z)
else if (z <= 9.2d+82) then
tmp = x / (y * (t - z))
else
tmp = (x / z) / z
end if
code = tmp
end function
assert y < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.85e+139) {
tmp = (x / z) * (1.0 / z);
} else if (z <= -2.1e-134) {
tmp = (x / t) / (y - z);
} else if (z <= 9.2e+82) {
tmp = x / (y * (t - z));
} else {
tmp = (x / z) / z;
}
return tmp;
}
[y, t] = sort([y, t]) def code(x, y, z, t): tmp = 0 if z <= -1.85e+139: tmp = (x / z) * (1.0 / z) elif z <= -2.1e-134: tmp = (x / t) / (y - z) elif z <= 9.2e+82: tmp = x / (y * (t - z)) else: tmp = (x / z) / z return tmp
y, t = sort([y, t]) function code(x, y, z, t) tmp = 0.0 if (z <= -1.85e+139) tmp = Float64(Float64(x / z) * Float64(1.0 / z)); elseif (z <= -2.1e-134) tmp = Float64(Float64(x / t) / Float64(y - z)); elseif (z <= 9.2e+82) tmp = Float64(x / Float64(y * Float64(t - z))); else tmp = Float64(Float64(x / z) / z); end return tmp end
y, t = num2cell(sort([y, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (z <= -1.85e+139)
tmp = (x / z) * (1.0 / z);
elseif (z <= -2.1e-134)
tmp = (x / t) / (y - z);
elseif (z <= 9.2e+82)
tmp = x / (y * (t - z));
else
tmp = (x / z) / z;
end
tmp_2 = tmp;
end
NOTE: y and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[z, -1.85e+139], N[(N[(x / z), $MachinePrecision] * N[(1.0 / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -2.1e-134], N[(N[(x / t), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 9.2e+82], N[(x / N[(y * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / z), $MachinePrecision] / z), $MachinePrecision]]]]
\begin{array}{l}
[y, t] = \mathsf{sort}([y, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.85 \cdot 10^{+139}:\\
\;\;\;\;\frac{x}{z} \cdot \frac{1}{z}\\
\mathbf{elif}\;z \leq -2.1 \cdot 10^{-134}:\\
\;\;\;\;\frac{\frac{x}{t}}{y - z}\\
\mathbf{elif}\;z \leq 9.2 \cdot 10^{+82}:\\
\;\;\;\;\frac{x}{y \cdot \left(t - z\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{z}}{z}\\
\end{array}
\end{array}
if z < -1.84999999999999996e139Initial program 88.4%
Taylor expanded in z around inf 88.4%
unpow288.4%
Simplified88.4%
associate-/r*94.0%
div-inv94.1%
Applied egg-rr94.1%
if -1.84999999999999996e139 < z < -2.0999999999999999e-134Initial program 92.3%
Taylor expanded in t around inf 60.3%
associate-/r*65.9%
Simplified65.9%
if -2.0999999999999999e-134 < z < 9.19999999999999953e82Initial program 96.7%
Taylor expanded in y around inf 71.8%
*-commutative71.8%
Simplified71.8%
if 9.19999999999999953e82 < z Initial program 82.5%
*-un-lft-identity82.5%
times-frac99.8%
Applied egg-rr99.8%
associate-*l/99.8%
associate-/l*98.8%
Applied egg-rr98.8%
Taylor expanded in z around inf 82.4%
*-rgt-identity82.4%
unpow282.4%
times-frac94.4%
associate-*r/94.4%
*-rgt-identity94.4%
Simplified94.4%
Final simplification78.0%
NOTE: y and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ (/ x z) z)))
(if (<= z -7e-15)
t_1
(if (<= z 9e-98) (/ (/ x t) y) (if (<= z 9e+82) (/ (- x) (* z t)) t_1)))))assert(y < t);
double code(double x, double y, double z, double t) {
double t_1 = (x / z) / z;
double tmp;
if (z <= -7e-15) {
tmp = t_1;
} else if (z <= 9e-98) {
tmp = (x / t) / y;
} else if (z <= 9e+82) {
tmp = -x / (z * t);
} else {
tmp = t_1;
}
return tmp;
}
NOTE: y and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = (x / z) / z
if (z <= (-7d-15)) then
tmp = t_1
else if (z <= 9d-98) then
tmp = (x / t) / y
else if (z <= 9d+82) then
tmp = -x / (z * t)
else
tmp = t_1
end if
code = tmp
end function
assert y < t;
public static double code(double x, double y, double z, double t) {
double t_1 = (x / z) / z;
double tmp;
if (z <= -7e-15) {
tmp = t_1;
} else if (z <= 9e-98) {
tmp = (x / t) / y;
} else if (z <= 9e+82) {
tmp = -x / (z * t);
} else {
tmp = t_1;
}
return tmp;
}
[y, t] = sort([y, t]) def code(x, y, z, t): t_1 = (x / z) / z tmp = 0 if z <= -7e-15: tmp = t_1 elif z <= 9e-98: tmp = (x / t) / y elif z <= 9e+82: tmp = -x / (z * t) else: tmp = t_1 return tmp
y, t = sort([y, t]) function code(x, y, z, t) t_1 = Float64(Float64(x / z) / z) tmp = 0.0 if (z <= -7e-15) tmp = t_1; elseif (z <= 9e-98) tmp = Float64(Float64(x / t) / y); elseif (z <= 9e+82) tmp = Float64(Float64(-x) / Float64(z * t)); else tmp = t_1; end return tmp end
y, t = num2cell(sort([y, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = (x / z) / z;
tmp = 0.0;
if (z <= -7e-15)
tmp = t_1;
elseif (z <= 9e-98)
tmp = (x / t) / y;
elseif (z <= 9e+82)
tmp = -x / (z * t);
else
tmp = t_1;
end
tmp_2 = tmp;
end
NOTE: y and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x / z), $MachinePrecision] / z), $MachinePrecision]}, If[LessEqual[z, -7e-15], t$95$1, If[LessEqual[z, 9e-98], N[(N[(x / t), $MachinePrecision] / y), $MachinePrecision], If[LessEqual[z, 9e+82], N[((-x) / N[(z * t), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
[y, t] = \mathsf{sort}([y, t])\\
\\
\begin{array}{l}
t_1 := \frac{\frac{x}{z}}{z}\\
\mathbf{if}\;z \leq -7 \cdot 10^{-15}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 9 \cdot 10^{-98}:\\
\;\;\;\;\frac{\frac{x}{t}}{y}\\
\mathbf{elif}\;z \leq 9 \cdot 10^{+82}:\\
\;\;\;\;\frac{-x}{z \cdot t}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -7.0000000000000001e-15 or 8.9999999999999993e82 < z Initial program 87.2%
*-un-lft-identity87.2%
times-frac99.8%
Applied egg-rr99.8%
associate-*l/99.8%
associate-/l*98.7%
Applied egg-rr98.7%
Taylor expanded in z around inf 75.8%
*-rgt-identity75.8%
unpow275.8%
times-frac83.1%
associate-*r/83.1%
*-rgt-identity83.1%
Simplified83.1%
if -7.0000000000000001e-15 < z < 8.99999999999999994e-98Initial program 94.4%
Taylor expanded in z around 0 71.2%
associate-/r*71.0%
Simplified71.0%
if 8.99999999999999994e-98 < z < 8.9999999999999993e82Initial program 97.7%
*-un-lft-identity97.7%
times-frac93.0%
Applied egg-rr93.0%
Taylor expanded in y around 0 57.4%
Taylor expanded in z around 0 36.0%
associate-*r/36.0%
neg-mul-136.0%
*-commutative36.0%
Simplified36.0%
Final simplification70.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) z)))
(if (<= z -1.3e-11)
t_1
(if (<= z 5e-121)
(/ (/ x t) y)
(if (<= z 9e+82) (/ (- x) (* y z)) 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.3e-11) {
tmp = t_1;
} else if (z <= 5e-121) {
tmp = (x / t) / y;
} else if (z <= 9e+82) {
tmp = -x / (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 = (x / z) / z
if (z <= (-1.3d-11)) then
tmp = t_1
else if (z <= 5d-121) then
tmp = (x / t) / y
else if (z <= 9d+82) then
tmp = -x / (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 = (x / z) / z;
double tmp;
if (z <= -1.3e-11) {
tmp = t_1;
} else if (z <= 5e-121) {
tmp = (x / t) / y;
} else if (z <= 9e+82) {
tmp = -x / (y * z);
} 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.3e-11: tmp = t_1 elif z <= 5e-121: tmp = (x / t) / y elif z <= 9e+82: tmp = -x / (y * z) 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.3e-11) tmp = t_1; elseif (z <= 5e-121) tmp = Float64(Float64(x / t) / y); elseif (z <= 9e+82) tmp = Float64(Float64(-x) / 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 = (x / z) / z;
tmp = 0.0;
if (z <= -1.3e-11)
tmp = t_1;
elseif (z <= 5e-121)
tmp = (x / t) / y;
elseif (z <= 9e+82)
tmp = -x / (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[(N[(x / z), $MachinePrecision] / z), $MachinePrecision]}, If[LessEqual[z, -1.3e-11], t$95$1, If[LessEqual[z, 5e-121], N[(N[(x / t), $MachinePrecision] / y), $MachinePrecision], If[LessEqual[z, 9e+82], N[((-x) / N[(y * z), $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.3 \cdot 10^{-11}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 5 \cdot 10^{-121}:\\
\;\;\;\;\frac{\frac{x}{t}}{y}\\
\mathbf{elif}\;z \leq 9 \cdot 10^{+82}:\\
\;\;\;\;\frac{-x}{y \cdot z}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -1.3e-11 or 8.9999999999999993e82 < z Initial program 87.2%
*-un-lft-identity87.2%
times-frac99.8%
Applied egg-rr99.8%
associate-*l/99.8%
associate-/l*98.7%
Applied egg-rr98.7%
Taylor expanded in z around inf 75.8%
*-rgt-identity75.8%
unpow275.8%
times-frac83.1%
associate-*r/83.1%
*-rgt-identity83.1%
Simplified83.1%
if -1.3e-11 < z < 4.99999999999999989e-121Initial program 94.2%
Taylor expanded in z around 0 72.2%
associate-/r*72.0%
Simplified72.0%
if 4.99999999999999989e-121 < z < 8.9999999999999993e82Initial program 97.8%
Taylor expanded in t around 0 64.5%
associate-*r/64.5%
neg-mul-164.5%
Simplified64.5%
Taylor expanded in z around 0 44.3%
*-commutative44.3%
Simplified44.3%
Final simplification72.0%
NOTE: y and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (or (<= z -1.15e+80) (not (<= z 9e+82))) (/ (/ x z) z) (/ x (* (- y z) t))))
assert(y < t);
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.15e+80) || !(z <= 9e+82)) {
tmp = (x / z) / z;
} else {
tmp = x / ((y - z) * t);
}
return tmp;
}
NOTE: y and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((z <= (-1.15d+80)) .or. (.not. (z <= 9d+82))) then
tmp = (x / z) / z
else
tmp = x / ((y - z) * t)
end if
code = tmp
end function
assert y < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.15e+80) || !(z <= 9e+82)) {
tmp = (x / z) / z;
} else {
tmp = x / ((y - z) * t);
}
return tmp;
}
[y, t] = sort([y, t]) def code(x, y, z, t): tmp = 0 if (z <= -1.15e+80) or not (z <= 9e+82): tmp = (x / z) / z else: tmp = x / ((y - z) * t) return tmp
y, t = sort([y, t]) function code(x, y, z, t) tmp = 0.0 if ((z <= -1.15e+80) || !(z <= 9e+82)) tmp = Float64(Float64(x / z) / z); else tmp = Float64(x / Float64(Float64(y - z) * t)); end return tmp end
y, t = num2cell(sort([y, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if ((z <= -1.15e+80) || ~((z <= 9e+82)))
tmp = (x / z) / z;
else
tmp = x / ((y - z) * t);
end
tmp_2 = tmp;
end
NOTE: y and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[Or[LessEqual[z, -1.15e+80], N[Not[LessEqual[z, 9e+82]], $MachinePrecision]], N[(N[(x / z), $MachinePrecision] / z), $MachinePrecision], N[(x / N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[y, t] = \mathsf{sort}([y, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.15 \cdot 10^{+80} \lor \neg \left(z \leq 9 \cdot 10^{+82}\right):\\
\;\;\;\;\frac{\frac{x}{z}}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\left(y - z\right) \cdot t}\\
\end{array}
\end{array}
if z < -1.15000000000000002e80 or 8.9999999999999993e82 < z Initial program 84.9%
*-un-lft-identity84.9%
times-frac99.8%
Applied egg-rr99.8%
associate-*l/99.9%
associate-/l*99.2%
Applied egg-rr99.2%
Taylor expanded in z around inf 82.6%
*-rgt-identity82.6%
unpow282.6%
times-frac91.4%
associate-*r/91.4%
*-rgt-identity91.4%
Simplified91.4%
if -1.15000000000000002e80 < z < 8.9999999999999993e82Initial program 95.8%
Taylor expanded in t around inf 71.7%
Final simplification78.7%
NOTE: y and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (or (<= z -3.6e+121) (not (<= z 4.3e+67))) (/ x (* y z)) (/ x (* y t))))
assert(y < t);
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -3.6e+121) || !(z <= 4.3e+67)) {
tmp = x / (y * z);
} else {
tmp = x / (y * t);
}
return tmp;
}
NOTE: y and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((z <= (-3.6d+121)) .or. (.not. (z <= 4.3d+67))) then
tmp = x / (y * z)
else
tmp = x / (y * t)
end if
code = tmp
end function
assert y < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -3.6e+121) || !(z <= 4.3e+67)) {
tmp = x / (y * z);
} else {
tmp = x / (y * t);
}
return tmp;
}
[y, t] = sort([y, t]) def code(x, y, z, t): tmp = 0 if (z <= -3.6e+121) or not (z <= 4.3e+67): tmp = x / (y * z) else: tmp = x / (y * t) return tmp
y, t = sort([y, t]) function code(x, y, z, t) tmp = 0.0 if ((z <= -3.6e+121) || !(z <= 4.3e+67)) tmp = Float64(x / Float64(y * z)); else tmp = Float64(x / Float64(y * t)); end return tmp end
y, t = num2cell(sort([y, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if ((z <= -3.6e+121) || ~((z <= 4.3e+67)))
tmp = x / (y * z);
else
tmp = x / (y * t);
end
tmp_2 = tmp;
end
NOTE: y and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[Or[LessEqual[z, -3.6e+121], N[Not[LessEqual[z, 4.3e+67]], $MachinePrecision]], N[(x / N[(y * z), $MachinePrecision]), $MachinePrecision], N[(x / N[(y * t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[y, t] = \mathsf{sort}([y, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.6 \cdot 10^{+121} \lor \neg \left(z \leq 4.3 \cdot 10^{+67}\right):\\
\;\;\;\;\frac{x}{y \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y \cdot t}\\
\end{array}
\end{array}
if z < -3.59999999999999981e121 or 4.3000000000000001e67 < z Initial program 83.6%
Taylor expanded in t around 0 82.6%
associate-*r/82.6%
neg-mul-182.6%
Simplified82.6%
Taylor expanded in z around 0 42.0%
*-commutative42.0%
Simplified42.0%
expm1-log1p-u41.7%
expm1-udef63.1%
add-sqr-sqrt32.0%
sqrt-unprod61.5%
sqr-neg61.5%
sqrt-unprod31.3%
add-sqr-sqrt63.3%
associate-/r*63.3%
Applied egg-rr63.3%
expm1-def48.5%
expm1-log1p48.7%
associate-/l/40.9%
Simplified40.9%
if -3.59999999999999981e121 < z < 4.3000000000000001e67Initial program 96.3%
Taylor expanded in z around 0 53.7%
Final simplification49.3%
NOTE: y and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (or (<= z -3e-17) (not (<= z 3.3e-95))) (/ x (* z z)) (/ x (* y t))))
assert(y < t);
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -3e-17) || !(z <= 3.3e-95)) {
tmp = x / (z * z);
} else {
tmp = x / (y * t);
}
return tmp;
}
NOTE: y and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((z <= (-3d-17)) .or. (.not. (z <= 3.3d-95))) then
tmp = x / (z * z)
else
tmp = x / (y * t)
end if
code = tmp
end function
assert y < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -3e-17) || !(z <= 3.3e-95)) {
tmp = x / (z * z);
} else {
tmp = x / (y * t);
}
return tmp;
}
[y, t] = sort([y, t]) def code(x, y, z, t): tmp = 0 if (z <= -3e-17) or not (z <= 3.3e-95): tmp = x / (z * z) else: tmp = x / (y * t) return tmp
y, t = sort([y, t]) function code(x, y, z, t) tmp = 0.0 if ((z <= -3e-17) || !(z <= 3.3e-95)) tmp = Float64(x / Float64(z * z)); else tmp = Float64(x / Float64(y * t)); end return tmp end
y, t = num2cell(sort([y, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if ((z <= -3e-17) || ~((z <= 3.3e-95)))
tmp = x / (z * z);
else
tmp = x / (y * t);
end
tmp_2 = tmp;
end
NOTE: y and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[Or[LessEqual[z, -3e-17], N[Not[LessEqual[z, 3.3e-95]], $MachinePrecision]], N[(x / N[(z * z), $MachinePrecision]), $MachinePrecision], N[(x / N[(y * t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[y, t] = \mathsf{sort}([y, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3 \cdot 10^{-17} \lor \neg \left(z \leq 3.3 \cdot 10^{-95}\right):\\
\;\;\;\;\frac{x}{z \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y \cdot t}\\
\end{array}
\end{array}
if z < -3.00000000000000006e-17 or 3.3e-95 < z Initial program 90.0%
Taylor expanded in z around inf 63.3%
unpow263.3%
Simplified63.3%
if -3.00000000000000006e-17 < z < 3.3e-95Initial program 94.5%
Taylor expanded in z around 0 70.0%
Final simplification66.1%
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.02e-11) (not (<= z 3.3e-95))) (/ x (* z z)) (/ (/ x t) y)))
assert(y < t);
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.02e-11) || !(z <= 3.3e-95)) {
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.02d-11)) .or. (.not. (z <= 3.3d-95))) 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.02e-11) || !(z <= 3.3e-95)) {
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.02e-11) or not (z <= 3.3e-95): 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.02e-11) || !(z <= 3.3e-95)) tmp = Float64(x / Float64(z * z)); else tmp = Float64(Float64(x / t) / y); end return tmp end
y, t = num2cell(sort([y, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if ((z <= -1.02e-11) || ~((z <= 3.3e-95)))
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.02e-11], N[Not[LessEqual[z, 3.3e-95]], $MachinePrecision]], N[(x / N[(z * z), $MachinePrecision]), $MachinePrecision], N[(N[(x / t), $MachinePrecision] / y), $MachinePrecision]]
\begin{array}{l}
[y, t] = \mathsf{sort}([y, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.02 \cdot 10^{-11} \lor \neg \left(z \leq 3.3 \cdot 10^{-95}\right):\\
\;\;\;\;\frac{x}{z \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{t}}{y}\\
\end{array}
\end{array}
if z < -1.01999999999999994e-11 or 3.3e-95 < z Initial program 90.0%
Taylor expanded in z around inf 63.3%
unpow263.3%
Simplified63.3%
if -1.01999999999999994e-11 < z < 3.3e-95Initial program 94.5%
Taylor expanded in z around 0 70.0%
associate-/r*69.8%
Simplified69.8%
Final simplification66.1%
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.6e-13) (not (<= z 3.3e-95))) (/ (/ x z) z) (/ (/ x t) y)))
assert(y < t);
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -4.6e-13) || !(z <= 3.3e-95)) {
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.6d-13)) .or. (.not. (z <= 3.3d-95))) 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.6e-13) || !(z <= 3.3e-95)) {
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.6e-13) or not (z <= 3.3e-95): 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.6e-13) || !(z <= 3.3e-95)) tmp = Float64(Float64(x / z) / z); else tmp = Float64(Float64(x / t) / y); end return tmp end
y, t = num2cell(sort([y, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if ((z <= -4.6e-13) || ~((z <= 3.3e-95)))
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.6e-13], N[Not[LessEqual[z, 3.3e-95]], $MachinePrecision]], N[(N[(x / z), $MachinePrecision] / z), $MachinePrecision], N[(N[(x / t), $MachinePrecision] / y), $MachinePrecision]]
\begin{array}{l}
[y, t] = \mathsf{sort}([y, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.6 \cdot 10^{-13} \lor \neg \left(z \leq 3.3 \cdot 10^{-95}\right):\\
\;\;\;\;\frac{\frac{x}{z}}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{t}}{y}\\
\end{array}
\end{array}
if z < -4.59999999999999958e-13 or 3.3e-95 < z Initial program 90.0%
*-un-lft-identity90.0%
times-frac97.9%
Applied egg-rr97.9%
associate-*l/98.0%
associate-/l*97.1%
Applied egg-rr97.1%
Taylor expanded in z around inf 63.3%
*-rgt-identity63.3%
unpow263.3%
times-frac68.7%
associate-*r/68.7%
*-rgt-identity68.7%
Simplified68.7%
if -4.59999999999999958e-13 < z < 3.3e-95Initial program 94.5%
Taylor expanded in z around 0 70.0%
associate-/r*69.8%
Simplified69.8%
Final simplification69.2%
NOTE: y and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (/ x (* y t)))
assert(y < t);
double code(double x, double y, double z, double t) {
return x / (y * t);
}
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 / (y * t)
end function
assert y < t;
public static double code(double x, double y, double z, double t) {
return x / (y * t);
}
[y, t] = sort([y, t]) def code(x, y, z, t): return x / (y * t)
y, t = sort([y, t]) function code(x, y, z, t) return Float64(x / Float64(y * t)) end
y, t = num2cell(sort([y, t])){:}
function tmp = code(x, y, z, t)
tmp = x / (y * t);
end
NOTE: y and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := N[(x / N[(y * t), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[y, t] = \mathsf{sort}([y, t])\\
\\
\frac{x}{y \cdot t}
\end{array}
Initial program 91.9%
Taylor expanded in z around 0 39.7%
Final simplification39.7%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (* (- y z) (- t z)))) (if (< (/ x t_1) 0.0) (/ (/ x (- y z)) (- t z)) (* x (/ 1.0 t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = (y - z) * (t - z);
double tmp;
if ((x / t_1) < 0.0) {
tmp = (x / (y - z)) / (t - z);
} else {
tmp = x * (1.0 / t_1);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = (y - z) * (t - z)
if ((x / t_1) < 0.0d0) then
tmp = (x / (y - z)) / (t - z)
else
tmp = x * (1.0d0 / t_1)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (y - z) * (t - z);
double tmp;
if ((x / t_1) < 0.0) {
tmp = (x / (y - z)) / (t - z);
} else {
tmp = x * (1.0 / t_1);
}
return tmp;
}
def code(x, y, z, t): t_1 = (y - z) * (t - z) tmp = 0 if (x / t_1) < 0.0: tmp = (x / (y - z)) / (t - z) else: tmp = x * (1.0 / t_1) return tmp
function code(x, y, z, t) t_1 = Float64(Float64(y - z) * Float64(t - z)) tmp = 0.0 if (Float64(x / t_1) < 0.0) tmp = Float64(Float64(x / Float64(y - z)) / Float64(t - z)); else tmp = Float64(x * Float64(1.0 / t_1)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (y - z) * (t - z); tmp = 0.0; if ((x / t_1) < 0.0) tmp = (x / (y - z)) / (t - z); else tmp = x * (1.0 / t_1); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(y - z), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision]}, If[Less[N[(x / t$95$1), $MachinePrecision], 0.0], N[(N[(x / N[(y - z), $MachinePrecision]), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], N[(x * N[(1.0 / t$95$1), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(y - z\right) \cdot \left(t - z\right)\\
\mathbf{if}\;\frac{x}{t_1} < 0:\\
\;\;\;\;\frac{\frac{x}{y - z}}{t - z}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{1}{t_1}\\
\end{array}
\end{array}
herbie shell --seed 2023271
(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))))