
(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 (/ (/ x (- y z)) (- t z)))
assert(y < t);
double code(double x, double y, double z, double t) {
return (x / (y - z)) / (t - 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 / (y - z)) / (t - z)
end function
assert y < t;
public static double code(double x, double y, double z, double t) {
return (x / (y - z)) / (t - z);
}
[y, t] = sort([y, t]) def code(x, y, z, t): return (x / (y - z)) / (t - z)
y, t = sort([y, t]) function code(x, y, z, t) return Float64(Float64(x / Float64(y - z)) / Float64(t - z)) end
y, t = num2cell(sort([y, t])){:}
function tmp = code(x, y, z, t)
tmp = (x / (y - z)) / (t - 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[(y - z), $MachinePrecision]), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[y, t] = \mathsf{sort}([y, t])\\
\\
\frac{\frac{x}{y - z}}{t - z}
\end{array}
Initial program 90.2%
associate-/r*97.1%
Simplified97.1%
Final simplification97.1%
NOTE: y and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ (- x) (* z (- y z)))))
(if (<= t -2.8e-184)
(/ (/ x y) (- t z))
(if (<= t 1.68e-49)
t_1
(if (<= t 6.8e+31)
(/ x (* (- y z) t))
(if (<= t 4e+51) t_1 (/ (/ x t) (- y z))))))))assert(y < t);
double code(double x, double y, double z, double t) {
double t_1 = -x / (z * (y - z));
double tmp;
if (t <= -2.8e-184) {
tmp = (x / y) / (t - z);
} else if (t <= 1.68e-49) {
tmp = t_1;
} else if (t <= 6.8e+31) {
tmp = x / ((y - z) * t);
} else if (t <= 4e+51) {
tmp = t_1;
} else {
tmp = (x / t) / (y - z);
}
return tmp;
}
NOTE: y and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = -x / (z * (y - z))
if (t <= (-2.8d-184)) then
tmp = (x / y) / (t - z)
else if (t <= 1.68d-49) then
tmp = t_1
else if (t <= 6.8d+31) then
tmp = x / ((y - z) * t)
else if (t <= 4d+51) then
tmp = t_1
else
tmp = (x / t) / (y - z)
end if
code = tmp
end function
assert y < t;
public static double code(double x, double y, double z, double t) {
double t_1 = -x / (z * (y - z));
double tmp;
if (t <= -2.8e-184) {
tmp = (x / y) / (t - z);
} else if (t <= 1.68e-49) {
tmp = t_1;
} else if (t <= 6.8e+31) {
tmp = x / ((y - z) * t);
} else if (t <= 4e+51) {
tmp = t_1;
} else {
tmp = (x / t) / (y - z);
}
return tmp;
}
[y, t] = sort([y, t]) def code(x, y, z, t): t_1 = -x / (z * (y - z)) tmp = 0 if t <= -2.8e-184: tmp = (x / y) / (t - z) elif t <= 1.68e-49: tmp = t_1 elif t <= 6.8e+31: tmp = x / ((y - z) * t) elif t <= 4e+51: tmp = t_1 else: tmp = (x / t) / (y - z) return tmp
y, t = sort([y, t]) function code(x, y, z, t) t_1 = Float64(Float64(-x) / Float64(z * Float64(y - z))) tmp = 0.0 if (t <= -2.8e-184) tmp = Float64(Float64(x / y) / Float64(t - z)); elseif (t <= 1.68e-49) tmp = t_1; elseif (t <= 6.8e+31) tmp = Float64(x / Float64(Float64(y - z) * t)); elseif (t <= 4e+51) tmp = t_1; else tmp = Float64(Float64(x / t) / Float64(y - z)); end return tmp end
y, t = num2cell(sort([y, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = -x / (z * (y - z));
tmp = 0.0;
if (t <= -2.8e-184)
tmp = (x / y) / (t - z);
elseif (t <= 1.68e-49)
tmp = t_1;
elseif (t <= 6.8e+31)
tmp = x / ((y - z) * t);
elseif (t <= 4e+51)
tmp = t_1;
else
tmp = (x / t) / (y - z);
end
tmp_2 = tmp;
end
NOTE: y and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[((-x) / N[(z * N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -2.8e-184], N[(N[(x / y), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.68e-49], t$95$1, If[LessEqual[t, 6.8e+31], N[(x / N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 4e+51], t$95$1, N[(N[(x / t), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
[y, t] = \mathsf{sort}([y, t])\\
\\
\begin{array}{l}
t_1 := \frac{-x}{z \cdot \left(y - z\right)}\\
\mathbf{if}\;t \leq -2.8 \cdot 10^{-184}:\\
\;\;\;\;\frac{\frac{x}{y}}{t - z}\\
\mathbf{elif}\;t \leq 1.68 \cdot 10^{-49}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 6.8 \cdot 10^{+31}:\\
\;\;\;\;\frac{x}{\left(y - z\right) \cdot t}\\
\mathbf{elif}\;t \leq 4 \cdot 10^{+51}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{t}}{y - z}\\
\end{array}
\end{array}
if t < -2.7999999999999998e-184Initial program 91.7%
associate-/r*97.0%
Simplified97.0%
Taylor expanded in y around inf 63.2%
if -2.7999999999999998e-184 < t < 1.6800000000000001e-49 or 6.7999999999999996e31 < t < 4e51Initial program 87.5%
Taylor expanded in t around 0 73.5%
associate-*r/73.5%
neg-mul-173.5%
*-commutative73.5%
Simplified73.5%
if 1.6800000000000001e-49 < t < 6.7999999999999996e31Initial program 99.9%
Taylor expanded in t around inf 52.5%
if 4e51 < t Initial program 89.5%
associate-/l/99.9%
Simplified99.9%
Taylor expanded in t around inf 86.5%
Final simplification71.1%
NOTE: y and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(if (<= t -4e-253)
(/ x (* y (- t z)))
(if (<= t 5.4e-49)
(/ (/ x (- y z)) (- z))
(if (<= t 5.5e+31)
(/ x (* (- y z) t))
(if (<= t 4.4e+51) (/ (- x) (* z (- y z))) (/ (/ x t) (- y z)))))))assert(y < t);
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -4e-253) {
tmp = x / (y * (t - z));
} else if (t <= 5.4e-49) {
tmp = (x / (y - z)) / -z;
} else if (t <= 5.5e+31) {
tmp = x / ((y - z) * t);
} else if (t <= 4.4e+51) {
tmp = -x / (z * (y - z));
} else {
tmp = (x / t) / (y - z);
}
return tmp;
}
NOTE: y and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (t <= (-4d-253)) then
tmp = x / (y * (t - z))
else if (t <= 5.4d-49) then
tmp = (x / (y - z)) / -z
else if (t <= 5.5d+31) then
tmp = x / ((y - z) * t)
else if (t <= 4.4d+51) then
tmp = -x / (z * (y - z))
else
tmp = (x / t) / (y - z)
end if
code = tmp
end function
assert y < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= -4e-253) {
tmp = x / (y * (t - z));
} else if (t <= 5.4e-49) {
tmp = (x / (y - z)) / -z;
} else if (t <= 5.5e+31) {
tmp = x / ((y - z) * t);
} else if (t <= 4.4e+51) {
tmp = -x / (z * (y - z));
} else {
tmp = (x / t) / (y - z);
}
return tmp;
}
[y, t] = sort([y, t]) def code(x, y, z, t): tmp = 0 if t <= -4e-253: tmp = x / (y * (t - z)) elif t <= 5.4e-49: tmp = (x / (y - z)) / -z elif t <= 5.5e+31: tmp = x / ((y - z) * t) elif t <= 4.4e+51: tmp = -x / (z * (y - z)) else: tmp = (x / t) / (y - z) return tmp
y, t = sort([y, t]) function code(x, y, z, t) tmp = 0.0 if (t <= -4e-253) tmp = Float64(x / Float64(y * Float64(t - z))); elseif (t <= 5.4e-49) tmp = Float64(Float64(x / Float64(y - z)) / Float64(-z)); elseif (t <= 5.5e+31) tmp = Float64(x / Float64(Float64(y - z) * t)); elseif (t <= 4.4e+51) tmp = Float64(Float64(-x) / Float64(z * Float64(y - z))); else tmp = Float64(Float64(x / t) / Float64(y - z)); end return tmp end
y, t = num2cell(sort([y, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (t <= -4e-253)
tmp = x / (y * (t - z));
elseif (t <= 5.4e-49)
tmp = (x / (y - z)) / -z;
elseif (t <= 5.5e+31)
tmp = x / ((y - z) * t);
elseif (t <= 4.4e+51)
tmp = -x / (z * (y - z));
else
tmp = (x / t) / (y - z);
end
tmp_2 = tmp;
end
NOTE: y and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[t, -4e-253], N[(x / N[(y * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 5.4e-49], N[(N[(x / N[(y - z), $MachinePrecision]), $MachinePrecision] / (-z)), $MachinePrecision], If[LessEqual[t, 5.5e+31], N[(x / N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 4.4e+51], N[((-x) / N[(z * N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / t), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[y, t] = \mathsf{sort}([y, t])\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4 \cdot 10^{-253}:\\
\;\;\;\;\frac{x}{y \cdot \left(t - z\right)}\\
\mathbf{elif}\;t \leq 5.4 \cdot 10^{-49}:\\
\;\;\;\;\frac{\frac{x}{y - z}}{-z}\\
\mathbf{elif}\;t \leq 5.5 \cdot 10^{+31}:\\
\;\;\;\;\frac{x}{\left(y - z\right) \cdot t}\\
\mathbf{elif}\;t \leq 4.4 \cdot 10^{+51}:\\
\;\;\;\;\frac{-x}{z \cdot \left(y - z\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{t}}{y - z}\\
\end{array}
\end{array}
if t < -4.0000000000000003e-253Initial program 90.9%
Taylor expanded in y around inf 63.6%
*-commutative63.6%
Simplified63.6%
if -4.0000000000000003e-253 < t < 5.3999999999999999e-49Initial program 88.6%
Taylor expanded in t around 0 71.7%
associate-*r/71.7%
neg-mul-171.7%
*-commutative71.7%
Simplified71.7%
neg-mul-171.7%
times-frac79.7%
Applied egg-rr79.7%
*-commutative79.7%
frac-2neg79.7%
metadata-eval79.7%
un-div-inv79.8%
Applied egg-rr79.8%
if 5.3999999999999999e-49 < t < 5.50000000000000002e31Initial program 99.9%
Taylor expanded in t around inf 52.5%
if 5.50000000000000002e31 < t < 4.39999999999999984e51Initial program 81.5%
Taylor expanded in t around 0 71.9%
associate-*r/71.9%
neg-mul-171.9%
*-commutative71.9%
Simplified71.9%
if 4.39999999999999984e51 < t Initial program 89.5%
associate-/l/99.9%
Simplified99.9%
Taylor expanded in t around inf 86.5%
Final simplification72.4%
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 (- t z)))))
(if (<= z -1.5e+46)
(/ (/ x z) z)
(if (<= z 4.75e-85)
t_1
(if (<= z 4.4e+29)
(/ x (* (- y z) t))
(if (<= z 2.7e+62) t_1 (/ 1.0 (* z (/ z x)))))))))assert(y < t);
double code(double x, double y, double z, double t) {
double t_1 = x / (y * (t - z));
double tmp;
if (z <= -1.5e+46) {
tmp = (x / z) / z;
} else if (z <= 4.75e-85) {
tmp = t_1;
} else if (z <= 4.4e+29) {
tmp = x / ((y - z) * t);
} else if (z <= 2.7e+62) {
tmp = t_1;
} else {
tmp = 1.0 / (z * (z / x));
}
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 * (t - z))
if (z <= (-1.5d+46)) then
tmp = (x / z) / z
else if (z <= 4.75d-85) then
tmp = t_1
else if (z <= 4.4d+29) then
tmp = x / ((y - z) * t)
else if (z <= 2.7d+62) then
tmp = t_1
else
tmp = 1.0d0 / (z * (z / x))
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 * (t - z));
double tmp;
if (z <= -1.5e+46) {
tmp = (x / z) / z;
} else if (z <= 4.75e-85) {
tmp = t_1;
} else if (z <= 4.4e+29) {
tmp = x / ((y - z) * t);
} else if (z <= 2.7e+62) {
tmp = t_1;
} else {
tmp = 1.0 / (z * (z / x));
}
return tmp;
}
[y, t] = sort([y, t]) def code(x, y, z, t): t_1 = x / (y * (t - z)) tmp = 0 if z <= -1.5e+46: tmp = (x / z) / z elif z <= 4.75e-85: tmp = t_1 elif z <= 4.4e+29: tmp = x / ((y - z) * t) elif z <= 2.7e+62: tmp = t_1 else: tmp = 1.0 / (z * (z / x)) return tmp
y, t = sort([y, t]) function code(x, y, z, t) t_1 = Float64(x / Float64(y * Float64(t - z))) tmp = 0.0 if (z <= -1.5e+46) tmp = Float64(Float64(x / z) / z); elseif (z <= 4.75e-85) tmp = t_1; elseif (z <= 4.4e+29) tmp = Float64(x / Float64(Float64(y - z) * t)); elseif (z <= 2.7e+62) tmp = t_1; else tmp = Float64(1.0 / Float64(z * Float64(z / x))); end return tmp end
y, t = num2cell(sort([y, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = x / (y * (t - z));
tmp = 0.0;
if (z <= -1.5e+46)
tmp = (x / z) / z;
elseif (z <= 4.75e-85)
tmp = t_1;
elseif (z <= 4.4e+29)
tmp = x / ((y - z) * t);
elseif (z <= 2.7e+62)
tmp = t_1;
else
tmp = 1.0 / (z * (z / x));
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 / N[(y * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.5e+46], N[(N[(x / z), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[z, 4.75e-85], t$95$1, If[LessEqual[z, 4.4e+29], N[(x / N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.7e+62], t$95$1, N[(1.0 / N[(z * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
[y, t] = \mathsf{sort}([y, t])\\
\\
\begin{array}{l}
t_1 := \frac{x}{y \cdot \left(t - z\right)}\\
\mathbf{if}\;z \leq -1.5 \cdot 10^{+46}:\\
\;\;\;\;\frac{\frac{x}{z}}{z}\\
\mathbf{elif}\;z \leq 4.75 \cdot 10^{-85}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 4.4 \cdot 10^{+29}:\\
\;\;\;\;\frac{x}{\left(y - z\right) \cdot t}\\
\mathbf{elif}\;z \leq 2.7 \cdot 10^{+62}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{z \cdot \frac{z}{x}}\\
\end{array}
\end{array}
if z < -1.50000000000000012e46Initial program 81.8%
Taylor expanded in z around inf 67.2%
unpow267.2%
associate-/r*77.9%
Simplified77.9%
if -1.50000000000000012e46 < z < 4.74999999999999982e-85 or 4.4000000000000003e29 < z < 2.7e62Initial program 95.0%
Taylor expanded in y around inf 75.3%
*-commutative75.3%
Simplified75.3%
if 4.74999999999999982e-85 < z < 4.4000000000000003e29Initial program 95.3%
Taylor expanded in t around inf 48.4%
if 2.7e62 < z Initial program 86.8%
Taylor expanded in z around inf 79.7%
unpow279.7%
Simplified79.7%
associate-/r*84.6%
div-inv84.6%
Applied egg-rr84.6%
clear-num84.6%
frac-times85.0%
metadata-eval85.0%
Applied egg-rr85.0%
Final simplification75.7%
NOTE: y and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(if (<= z -1.36e-17)
(/ (/ (- x) z) (- t z))
(if (<= z 3e-146)
(/ x (* y (- t z)))
(if (<= z 1.2e+29) (/ (/ x (- t z)) y) (/ (/ x (- y z)) (- z))))))assert(y < t);
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.36e-17) {
tmp = (-x / z) / (t - z);
} else if (z <= 3e-146) {
tmp = x / (y * (t - z));
} else if (z <= 1.2e+29) {
tmp = (x / (t - z)) / y;
} else {
tmp = (x / (y - 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.36d-17)) then
tmp = (-x / z) / (t - z)
else if (z <= 3d-146) then
tmp = x / (y * (t - z))
else if (z <= 1.2d+29) then
tmp = (x / (t - z)) / y
else
tmp = (x / (y - 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.36e-17) {
tmp = (-x / z) / (t - z);
} else if (z <= 3e-146) {
tmp = x / (y * (t - z));
} else if (z <= 1.2e+29) {
tmp = (x / (t - z)) / y;
} else {
tmp = (x / (y - z)) / -z;
}
return tmp;
}
[y, t] = sort([y, t]) def code(x, y, z, t): tmp = 0 if z <= -1.36e-17: tmp = (-x / z) / (t - z) elif z <= 3e-146: tmp = x / (y * (t - z)) elif z <= 1.2e+29: tmp = (x / (t - z)) / y else: tmp = (x / (y - z)) / -z return tmp
y, t = sort([y, t]) function code(x, y, z, t) tmp = 0.0 if (z <= -1.36e-17) tmp = Float64(Float64(Float64(-x) / z) / Float64(t - z)); elseif (z <= 3e-146) tmp = Float64(x / Float64(y * Float64(t - z))); elseif (z <= 1.2e+29) tmp = Float64(Float64(x / Float64(t - z)) / y); else tmp = Float64(Float64(x / Float64(y - z)) / Float64(-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.36e-17)
tmp = (-x / z) / (t - z);
elseif (z <= 3e-146)
tmp = x / (y * (t - z));
elseif (z <= 1.2e+29)
tmp = (x / (t - z)) / y;
else
tmp = (x / (y - 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.36e-17], N[(N[((-x) / z), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3e-146], N[(x / N[(y * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.2e+29], N[(N[(x / N[(t - z), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision], N[(N[(x / N[(y - z), $MachinePrecision]), $MachinePrecision] / (-z)), $MachinePrecision]]]]
\begin{array}{l}
[y, t] = \mathsf{sort}([y, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.36 \cdot 10^{-17}:\\
\;\;\;\;\frac{\frac{-x}{z}}{t - z}\\
\mathbf{elif}\;z \leq 3 \cdot 10^{-146}:\\
\;\;\;\;\frac{x}{y \cdot \left(t - z\right)}\\
\mathbf{elif}\;z \leq 1.2 \cdot 10^{+29}:\\
\;\;\;\;\frac{\frac{x}{t - z}}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y - z}}{-z}\\
\end{array}
\end{array}
if z < -1.36e-17Initial program 84.5%
Taylor expanded in y around 0 72.9%
mul-1-neg72.9%
distribute-frac-neg72.9%
associate-/r*83.3%
Simplified83.3%
if -1.36e-17 < z < 3.00000000000000019e-146Initial program 97.7%
Taylor expanded in y around inf 81.9%
*-commutative81.9%
Simplified81.9%
if 3.00000000000000019e-146 < z < 1.2e29Initial program 84.8%
Taylor expanded in y around inf 54.1%
*-commutative54.1%
associate-/r*75.0%
Simplified75.0%
if 1.2e29 < z Initial program 88.4%
Taylor expanded in t around 0 83.2%
associate-*r/83.2%
neg-mul-183.2%
*-commutative83.2%
Simplified83.2%
neg-mul-183.2%
times-frac91.8%
Applied egg-rr91.8%
*-commutative91.8%
frac-2neg91.8%
metadata-eval91.8%
un-div-inv91.9%
Applied egg-rr91.9%
Final simplification83.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)))
(if (<= z -1.15e-10)
(/ t_1 (- t z))
(if (<= z 5e-149)
(/ x (* y (- t z)))
(if (<= z 1.46e+29) (/ (/ x (- t z)) y) (/ t_1 (- y z)))))))assert(y < t);
double code(double x, double y, double z, double t) {
double t_1 = -x / z;
double tmp;
if (z <= -1.15e-10) {
tmp = t_1 / (t - z);
} else if (z <= 5e-149) {
tmp = x / (y * (t - z));
} else if (z <= 1.46e+29) {
tmp = (x / (t - z)) / y;
} else {
tmp = t_1 / (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 (z <= (-1.15d-10)) then
tmp = t_1 / (t - z)
else if (z <= 5d-149) then
tmp = x / (y * (t - z))
else if (z <= 1.46d+29) then
tmp = (x / (t - z)) / y
else
tmp = t_1 / (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 (z <= -1.15e-10) {
tmp = t_1 / (t - z);
} else if (z <= 5e-149) {
tmp = x / (y * (t - z));
} else if (z <= 1.46e+29) {
tmp = (x / (t - z)) / y;
} else {
tmp = t_1 / (y - z);
}
return tmp;
}
[y, t] = sort([y, t]) def code(x, y, z, t): t_1 = -x / z tmp = 0 if z <= -1.15e-10: tmp = t_1 / (t - z) elif z <= 5e-149: tmp = x / (y * (t - z)) elif z <= 1.46e+29: tmp = (x / (t - z)) / y else: tmp = t_1 / (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 (z <= -1.15e-10) tmp = Float64(t_1 / Float64(t - z)); elseif (z <= 5e-149) tmp = Float64(x / Float64(y * Float64(t - z))); elseif (z <= 1.46e+29) tmp = Float64(Float64(x / Float64(t - z)) / y); else tmp = Float64(t_1 / 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 (z <= -1.15e-10)
tmp = t_1 / (t - z);
elseif (z <= 5e-149)
tmp = x / (y * (t - z));
elseif (z <= 1.46e+29)
tmp = (x / (t - z)) / y;
else
tmp = t_1 / (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[z, -1.15e-10], N[(t$95$1 / N[(t - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 5e-149], N[(x / N[(y * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.46e+29], N[(N[(x / N[(t - z), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision], N[(t$95$1 / N[(y - z), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[y, t] = \mathsf{sort}([y, t])\\
\\
\begin{array}{l}
t_1 := \frac{-x}{z}\\
\mathbf{if}\;z \leq -1.15 \cdot 10^{-10}:\\
\;\;\;\;\frac{t_1}{t - z}\\
\mathbf{elif}\;z \leq 5 \cdot 10^{-149}:\\
\;\;\;\;\frac{x}{y \cdot \left(t - z\right)}\\
\mathbf{elif}\;z \leq 1.46 \cdot 10^{+29}:\\
\;\;\;\;\frac{\frac{x}{t - z}}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{t_1}{y - z}\\
\end{array}
\end{array}
if z < -1.15000000000000004e-10Initial program 84.5%
Taylor expanded in y around 0 72.9%
mul-1-neg72.9%
distribute-frac-neg72.9%
associate-/r*83.3%
Simplified83.3%
if -1.15000000000000004e-10 < z < 4.99999999999999968e-149Initial program 97.7%
Taylor expanded in y around inf 81.9%
*-commutative81.9%
Simplified81.9%
if 4.99999999999999968e-149 < z < 1.46e29Initial program 84.8%
Taylor expanded in y around inf 54.1%
*-commutative54.1%
associate-/r*75.0%
Simplified75.0%
if 1.46e29 < z Initial program 88.4%
Taylor expanded in t around 0 83.2%
associate-*r/83.2%
neg-mul-183.2%
*-commutative83.2%
associate-/r*91.8%
Simplified91.8%
Final simplification83.9%
NOTE: y and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(if (<= z -23000000000000.0)
(/ (/ x z) z)
(if (<= z -1.25e-129)
(/ (- x) (* z t))
(if (<= z 9.5e+28) (/ (/ x t) y) (/ 1.0 (* z (/ z x)))))))assert(y < t);
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -23000000000000.0) {
tmp = (x / z) / z;
} else if (z <= -1.25e-129) {
tmp = -x / (z * t);
} else if (z <= 9.5e+28) {
tmp = (x / t) / y;
} else {
tmp = 1.0 / (z * (z / x));
}
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 <= (-23000000000000.0d0)) then
tmp = (x / z) / z
else if (z <= (-1.25d-129)) then
tmp = -x / (z * t)
else if (z <= 9.5d+28) then
tmp = (x / t) / y
else
tmp = 1.0d0 / (z * (z / x))
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 <= -23000000000000.0) {
tmp = (x / z) / z;
} else if (z <= -1.25e-129) {
tmp = -x / (z * t);
} else if (z <= 9.5e+28) {
tmp = (x / t) / y;
} else {
tmp = 1.0 / (z * (z / x));
}
return tmp;
}
[y, t] = sort([y, t]) def code(x, y, z, t): tmp = 0 if z <= -23000000000000.0: tmp = (x / z) / z elif z <= -1.25e-129: tmp = -x / (z * t) elif z <= 9.5e+28: tmp = (x / t) / y else: tmp = 1.0 / (z * (z / x)) return tmp
y, t = sort([y, t]) function code(x, y, z, t) tmp = 0.0 if (z <= -23000000000000.0) tmp = Float64(Float64(x / z) / z); elseif (z <= -1.25e-129) tmp = Float64(Float64(-x) / Float64(z * t)); elseif (z <= 9.5e+28) tmp = Float64(Float64(x / t) / y); else tmp = Float64(1.0 / Float64(z * Float64(z / x))); end return tmp end
y, t = num2cell(sort([y, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (z <= -23000000000000.0)
tmp = (x / z) / z;
elseif (z <= -1.25e-129)
tmp = -x / (z * t);
elseif (z <= 9.5e+28)
tmp = (x / t) / y;
else
tmp = 1.0 / (z * (z / x));
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, -23000000000000.0], N[(N[(x / z), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[z, -1.25e-129], N[((-x) / N[(z * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 9.5e+28], N[(N[(x / t), $MachinePrecision] / y), $MachinePrecision], N[(1.0 / N[(z * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[y, t] = \mathsf{sort}([y, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -23000000000000:\\
\;\;\;\;\frac{\frac{x}{z}}{z}\\
\mathbf{elif}\;z \leq -1.25 \cdot 10^{-129}:\\
\;\;\;\;\frac{-x}{z \cdot t}\\
\mathbf{elif}\;z \leq 9.5 \cdot 10^{+28}:\\
\;\;\;\;\frac{\frac{x}{t}}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{z \cdot \frac{z}{x}}\\
\end{array}
\end{array}
if z < -2.3e13Initial program 83.2%
Taylor expanded in z around inf 63.7%
unpow263.7%
associate-/r*73.5%
Simplified73.5%
if -2.3e13 < z < -1.25000000000000007e-129Initial program 99.7%
associate-/l/95.8%
Simplified95.8%
Taylor expanded in t around inf 66.3%
Taylor expanded in y around 0 45.3%
mul-1-neg45.3%
*-commutative45.3%
Simplified45.3%
if -1.25000000000000007e-129 < z < 9.49999999999999927e28Initial program 93.5%
clear-num93.3%
associate-/r/93.4%
*-commutative93.4%
associate-/r*93.6%
Applied egg-rr93.6%
div-inv93.6%
associate-*l*94.2%
associate-/r/94.3%
*-un-lft-identity94.3%
times-frac94.5%
clear-num94.5%
/-rgt-identity94.5%
Applied egg-rr94.5%
Taylor expanded in z around 0 63.4%
*-lft-identity63.4%
times-frac68.7%
associate-*l/68.8%
*-lft-identity68.8%
Simplified68.8%
if 9.49999999999999927e28 < z Initial program 88.4%
Taylor expanded in z around inf 75.1%
unpow275.1%
Simplified75.1%
associate-/r*79.5%
div-inv79.5%
Applied egg-rr79.5%
clear-num79.4%
frac-times79.8%
metadata-eval79.8%
Applied egg-rr79.8%
Final simplification70.6%
NOTE: y and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(if (<= z -4.6e+47)
(/ (/ x z) z)
(if (<= z 8.2e-145)
(/ x (* y (- t z)))
(if (<= z 3.5e+28) (/ (/ x t) (- y z)) (/ 1.0 (* z (/ z x)))))))assert(y < t);
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -4.6e+47) {
tmp = (x / z) / z;
} else if (z <= 8.2e-145) {
tmp = x / (y * (t - z));
} else if (z <= 3.5e+28) {
tmp = (x / t) / (y - z);
} else {
tmp = 1.0 / (z * (z / x));
}
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+47)) then
tmp = (x / z) / z
else if (z <= 8.2d-145) then
tmp = x / (y * (t - z))
else if (z <= 3.5d+28) then
tmp = (x / t) / (y - z)
else
tmp = 1.0d0 / (z * (z / x))
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+47) {
tmp = (x / z) / z;
} else if (z <= 8.2e-145) {
tmp = x / (y * (t - z));
} else if (z <= 3.5e+28) {
tmp = (x / t) / (y - z);
} else {
tmp = 1.0 / (z * (z / x));
}
return tmp;
}
[y, t] = sort([y, t]) def code(x, y, z, t): tmp = 0 if z <= -4.6e+47: tmp = (x / z) / z elif z <= 8.2e-145: tmp = x / (y * (t - z)) elif z <= 3.5e+28: tmp = (x / t) / (y - z) else: tmp = 1.0 / (z * (z / x)) return tmp
y, t = sort([y, t]) function code(x, y, z, t) tmp = 0.0 if (z <= -4.6e+47) tmp = Float64(Float64(x / z) / z); elseif (z <= 8.2e-145) tmp = Float64(x / Float64(y * Float64(t - z))); elseif (z <= 3.5e+28) tmp = Float64(Float64(x / t) / Float64(y - z)); else tmp = Float64(1.0 / Float64(z * Float64(z / x))); 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+47)
tmp = (x / z) / z;
elseif (z <= 8.2e-145)
tmp = x / (y * (t - z));
elseif (z <= 3.5e+28)
tmp = (x / t) / (y - z);
else
tmp = 1.0 / (z * (z / x));
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, -4.6e+47], N[(N[(x / z), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[z, 8.2e-145], N[(x / N[(y * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.5e+28], N[(N[(x / t), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(z * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[y, t] = \mathsf{sort}([y, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.6 \cdot 10^{+47}:\\
\;\;\;\;\frac{\frac{x}{z}}{z}\\
\mathbf{elif}\;z \leq 8.2 \cdot 10^{-145}:\\
\;\;\;\;\frac{x}{y \cdot \left(t - z\right)}\\
\mathbf{elif}\;z \leq 3.5 \cdot 10^{+28}:\\
\;\;\;\;\frac{\frac{x}{t}}{y - z}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{z \cdot \frac{z}{x}}\\
\end{array}
\end{array}
if z < -4.5999999999999997e47Initial program 81.8%
Taylor expanded in z around inf 67.2%
unpow267.2%
associate-/r*77.9%
Simplified77.9%
if -4.5999999999999997e47 < z < 8.1999999999999995e-145Initial program 97.9%
Taylor expanded in y around inf 79.0%
*-commutative79.0%
Simplified79.0%
if 8.1999999999999995e-145 < z < 3.5e28Initial program 84.8%
associate-/l/99.8%
Simplified99.8%
Taylor expanded in t around inf 70.6%
if 3.5e28 < z Initial program 88.4%
Taylor expanded in z around inf 75.1%
unpow275.1%
Simplified75.1%
associate-/r*79.5%
div-inv79.5%
Applied egg-rr79.5%
clear-num79.4%
frac-times79.8%
metadata-eval79.8%
Applied egg-rr79.8%
Final simplification77.9%
NOTE: y and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(if (<= z -3.6e+46)
(/ (/ x z) z)
(if (<= z 2.7e-145)
(/ x (* y (- t z)))
(if (<= z 1.3e+182) (/ (/ x (- t z)) y) (/ 1.0 (* z (/ z x)))))))assert(y < t);
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -3.6e+46) {
tmp = (x / z) / z;
} else if (z <= 2.7e-145) {
tmp = x / (y * (t - z));
} else if (z <= 1.3e+182) {
tmp = (x / (t - z)) / y;
} else {
tmp = 1.0 / (z * (z / x));
}
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+46)) then
tmp = (x / z) / z
else if (z <= 2.7d-145) then
tmp = x / (y * (t - z))
else if (z <= 1.3d+182) then
tmp = (x / (t - z)) / y
else
tmp = 1.0d0 / (z * (z / x))
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+46) {
tmp = (x / z) / z;
} else if (z <= 2.7e-145) {
tmp = x / (y * (t - z));
} else if (z <= 1.3e+182) {
tmp = (x / (t - z)) / y;
} else {
tmp = 1.0 / (z * (z / x));
}
return tmp;
}
[y, t] = sort([y, t]) def code(x, y, z, t): tmp = 0 if z <= -3.6e+46: tmp = (x / z) / z elif z <= 2.7e-145: tmp = x / (y * (t - z)) elif z <= 1.3e+182: tmp = (x / (t - z)) / y else: tmp = 1.0 / (z * (z / x)) return tmp
y, t = sort([y, t]) function code(x, y, z, t) tmp = 0.0 if (z <= -3.6e+46) tmp = Float64(Float64(x / z) / z); elseif (z <= 2.7e-145) tmp = Float64(x / Float64(y * Float64(t - z))); elseif (z <= 1.3e+182) tmp = Float64(Float64(x / Float64(t - z)) / y); else tmp = Float64(1.0 / Float64(z * Float64(z / x))); 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+46)
tmp = (x / z) / z;
elseif (z <= 2.7e-145)
tmp = x / (y * (t - z));
elseif (z <= 1.3e+182)
tmp = (x / (t - z)) / y;
else
tmp = 1.0 / (z * (z / x));
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, -3.6e+46], N[(N[(x / z), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[z, 2.7e-145], N[(x / N[(y * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.3e+182], N[(N[(x / N[(t - z), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision], N[(1.0 / N[(z * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[y, t] = \mathsf{sort}([y, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.6 \cdot 10^{+46}:\\
\;\;\;\;\frac{\frac{x}{z}}{z}\\
\mathbf{elif}\;z \leq 2.7 \cdot 10^{-145}:\\
\;\;\;\;\frac{x}{y \cdot \left(t - z\right)}\\
\mathbf{elif}\;z \leq 1.3 \cdot 10^{+182}:\\
\;\;\;\;\frac{\frac{x}{t - z}}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{z \cdot \frac{z}{x}}\\
\end{array}
\end{array}
if z < -3.5999999999999999e46Initial program 81.8%
Taylor expanded in z around inf 67.2%
unpow267.2%
associate-/r*77.9%
Simplified77.9%
if -3.5999999999999999e46 < z < 2.7e-145Initial program 97.9%
Taylor expanded in y around inf 79.0%
*-commutative79.0%
Simplified79.0%
if 2.7e-145 < z < 1.3e182Initial program 85.1%
Taylor expanded in y around inf 51.0%
*-commutative51.0%
associate-/r*70.2%
Simplified70.2%
if 1.3e182 < z Initial program 91.3%
Taylor expanded in z around inf 91.3%
unpow291.3%
Simplified91.3%
associate-/r*99.5%
div-inv99.5%
Applied egg-rr99.5%
clear-num99.4%
frac-times100.0%
metadata-eval100.0%
Applied egg-rr100.0%
Final simplification79.1%
NOTE: y and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= z -3.4e+110) (/ (/ x (- y z)) (- z)) (if (<= z 4.2e+131) (/ x (* (- y z) (- t z))) (/ (/ (- x) z) (- t z)))))
assert(y < t);
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -3.4e+110) {
tmp = (x / (y - z)) / -z;
} else if (z <= 4.2e+131) {
tmp = x / ((y - z) * (t - z));
} else {
tmp = (-x / 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) :: tmp
if (z <= (-3.4d+110)) then
tmp = (x / (y - z)) / -z
else if (z <= 4.2d+131) then
tmp = x / ((y - z) * (t - z))
else
tmp = (-x / 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 tmp;
if (z <= -3.4e+110) {
tmp = (x / (y - z)) / -z;
} else if (z <= 4.2e+131) {
tmp = x / ((y - z) * (t - z));
} else {
tmp = (-x / z) / (t - z);
}
return tmp;
}
[y, t] = sort([y, t]) def code(x, y, z, t): tmp = 0 if z <= -3.4e+110: tmp = (x / (y - z)) / -z elif z <= 4.2e+131: tmp = x / ((y - z) * (t - z)) else: tmp = (-x / z) / (t - z) return tmp
y, t = sort([y, t]) function code(x, y, z, t) tmp = 0.0 if (z <= -3.4e+110) tmp = Float64(Float64(x / Float64(y - z)) / Float64(-z)); elseif (z <= 4.2e+131) tmp = Float64(x / Float64(Float64(y - z) * Float64(t - z))); else tmp = Float64(Float64(Float64(-x) / z) / 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 <= -3.4e+110)
tmp = (x / (y - z)) / -z;
elseif (z <= 4.2e+131)
tmp = x / ((y - z) * (t - z));
else
tmp = (-x / 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_] := If[LessEqual[z, -3.4e+110], N[(N[(x / N[(y - z), $MachinePrecision]), $MachinePrecision] / (-z)), $MachinePrecision], If[LessEqual[z, 4.2e+131], N[(x / N[(N[(y - z), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[((-x) / z), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[y, t] = \mathsf{sort}([y, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.4 \cdot 10^{+110}:\\
\;\;\;\;\frac{\frac{x}{y - z}}{-z}\\
\mathbf{elif}\;z \leq 4.2 \cdot 10^{+131}:\\
\;\;\;\;\frac{x}{\left(y - z\right) \cdot \left(t - z\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{-x}{z}}{t - z}\\
\end{array}
\end{array}
if z < -3.4000000000000001e110Initial program 72.1%
Taylor expanded in t around 0 72.3%
associate-*r/72.3%
neg-mul-172.3%
*-commutative72.3%
Simplified72.3%
neg-mul-172.3%
times-frac97.3%
Applied egg-rr97.3%
*-commutative97.3%
frac-2neg97.3%
metadata-eval97.3%
un-div-inv97.3%
Applied egg-rr97.3%
if -3.4000000000000001e110 < z < 4.19999999999999971e131Initial program 96.0%
if 4.19999999999999971e131 < z Initial program 82.2%
Taylor expanded in y around 0 82.2%
mul-1-neg82.2%
distribute-frac-neg82.2%
associate-/r*91.6%
Simplified91.6%
Final simplification95.4%
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.4e+14)
t_1
(if (<= z -6.5e-130)
(/ (- x) (* z t))
(if (<= z 3.6e+28) (/ (/ 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.4e+14) {
tmp = t_1;
} else if (z <= -6.5e-130) {
tmp = -x / (z * t);
} else if (z <= 3.6e+28) {
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.4d+14)) then
tmp = t_1
else if (z <= (-6.5d-130)) then
tmp = -x / (z * t)
else if (z <= 3.6d+28) 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.4e+14) {
tmp = t_1;
} else if (z <= -6.5e-130) {
tmp = -x / (z * t);
} else if (z <= 3.6e+28) {
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.4e+14: tmp = t_1 elif z <= -6.5e-130: tmp = -x / (z * t) elif z <= 3.6e+28: 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.4e+14) tmp = t_1; elseif (z <= -6.5e-130) tmp = Float64(Float64(-x) / Float64(z * t)); elseif (z <= 3.6e+28) tmp = Float64(Float64(x / 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.4e+14)
tmp = t_1;
elseif (z <= -6.5e-130)
tmp = -x / (z * t);
elseif (z <= 3.6e+28)
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.4e+14], t$95$1, If[LessEqual[z, -6.5e-130], N[((-x) / N[(z * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.6e+28], N[(N[(x / t), $MachinePrecision] / y), $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.4 \cdot 10^{+14}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -6.5 \cdot 10^{-130}:\\
\;\;\;\;\frac{-x}{z \cdot t}\\
\mathbf{elif}\;z \leq 3.6 \cdot 10^{+28}:\\
\;\;\;\;\frac{\frac{x}{t}}{y}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -1.4e14 or 3.5999999999999999e28 < z Initial program 85.9%
Taylor expanded in z around inf 69.5%
unpow269.5%
associate-/r*76.6%
Simplified76.6%
if -1.4e14 < z < -6.5000000000000002e-130Initial program 99.7%
associate-/l/95.8%
Simplified95.8%
Taylor expanded in t around inf 66.3%
Taylor expanded in y around 0 45.3%
mul-1-neg45.3%
*-commutative45.3%
Simplified45.3%
if -6.5000000000000002e-130 < z < 3.5999999999999999e28Initial program 93.5%
clear-num93.3%
associate-/r/93.4%
*-commutative93.4%
associate-/r*93.6%
Applied egg-rr93.6%
div-inv93.6%
associate-*l*94.2%
associate-/r/94.3%
*-un-lft-identity94.3%
times-frac94.5%
clear-num94.5%
/-rgt-identity94.5%
Applied egg-rr94.5%
Taylor expanded in z around 0 63.4%
*-lft-identity63.4%
times-frac68.7%
associate-*l/68.8%
*-lft-identity68.8%
Simplified68.8%
Final simplification70.6%
NOTE: y and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= z -2.25e+47) (/ (/ x z) z) (if (<= z 3.5e+29) (/ x (* (- y z) t)) (/ 1.0 (* z (/ z x))))))
assert(y < t);
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -2.25e+47) {
tmp = (x / z) / z;
} else if (z <= 3.5e+29) {
tmp = x / ((y - z) * t);
} else {
tmp = 1.0 / (z * (z / x));
}
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 <= (-2.25d+47)) then
tmp = (x / z) / z
else if (z <= 3.5d+29) then
tmp = x / ((y - z) * t)
else
tmp = 1.0d0 / (z * (z / x))
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 <= -2.25e+47) {
tmp = (x / z) / z;
} else if (z <= 3.5e+29) {
tmp = x / ((y - z) * t);
} else {
tmp = 1.0 / (z * (z / x));
}
return tmp;
}
[y, t] = sort([y, t]) def code(x, y, z, t): tmp = 0 if z <= -2.25e+47: tmp = (x / z) / z elif z <= 3.5e+29: tmp = x / ((y - z) * t) else: tmp = 1.0 / (z * (z / x)) return tmp
y, t = sort([y, t]) function code(x, y, z, t) tmp = 0.0 if (z <= -2.25e+47) tmp = Float64(Float64(x / z) / z); elseif (z <= 3.5e+29) tmp = Float64(x / Float64(Float64(y - z) * t)); else tmp = Float64(1.0 / Float64(z * Float64(z / x))); end return tmp end
y, t = num2cell(sort([y, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (z <= -2.25e+47)
tmp = (x / z) / z;
elseif (z <= 3.5e+29)
tmp = x / ((y - z) * t);
else
tmp = 1.0 / (z * (z / x));
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, -2.25e+47], N[(N[(x / z), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[z, 3.5e+29], N[(x / N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(z * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[y, t] = \mathsf{sort}([y, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.25 \cdot 10^{+47}:\\
\;\;\;\;\frac{\frac{x}{z}}{z}\\
\mathbf{elif}\;z \leq 3.5 \cdot 10^{+29}:\\
\;\;\;\;\frac{x}{\left(y - z\right) \cdot t}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{z \cdot \frac{z}{x}}\\
\end{array}
\end{array}
if z < -2.2499999999999999e47Initial program 81.8%
Taylor expanded in z around inf 67.2%
unpow267.2%
associate-/r*77.9%
Simplified77.9%
if -2.2499999999999999e47 < z < 3.49999999999999979e29Initial program 94.8%
Taylor expanded in t around inf 73.3%
if 3.49999999999999979e29 < z Initial program 88.4%
Taylor expanded in z around inf 75.1%
unpow275.1%
Simplified75.1%
associate-/r*79.5%
div-inv79.5%
Applied egg-rr79.5%
clear-num79.4%
frac-times79.8%
metadata-eval79.8%
Applied egg-rr79.8%
Final simplification76.0%
NOTE: y and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (or (<= z -1.1e+47) (not (<= z 2.25e+55))) (/ x (* y z)) (/ x (* y t))))
assert(y < t);
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.1e+47) || !(z <= 2.25e+55)) {
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 <= (-1.1d+47)) .or. (.not. (z <= 2.25d+55))) 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 <= -1.1e+47) || !(z <= 2.25e+55)) {
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 <= -1.1e+47) or not (z <= 2.25e+55): 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 <= -1.1e+47) || !(z <= 2.25e+55)) 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 <= -1.1e+47) || ~((z <= 2.25e+55)))
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, -1.1e+47], N[Not[LessEqual[z, 2.25e+55]], $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 -1.1 \cdot 10^{+47} \lor \neg \left(z \leq 2.25 \cdot 10^{+55}\right):\\
\;\;\;\;\frac{x}{y \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y \cdot t}\\
\end{array}
\end{array}
if z < -1.1e47 or 2.24999999999999999e55 < z Initial program 84.5%
Taylor expanded in y around inf 42.9%
*-commutative42.9%
Simplified42.9%
Taylor expanded in t around 0 40.0%
mul-1-neg40.0%
associate-/r*40.3%
distribute-neg-frac40.3%
distribute-neg-frac40.3%
Simplified40.3%
expm1-log1p-u40.1%
expm1-udef59.9%
associate-/l/60.0%
add-sqr-sqrt37.7%
sqrt-unprod58.6%
sqr-neg58.6%
sqrt-unprod22.2%
add-sqr-sqrt59.9%
Applied egg-rr59.9%
expm1-def37.0%
expm1-log1p37.4%
*-commutative37.4%
Simplified37.4%
if -1.1e47 < z < 2.24999999999999999e55Initial program 95.0%
Taylor expanded in z around 0 55.0%
Final simplification47.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 -96000000000.0) (not (<= z 5.5e+22))) (/ x (* z z)) (/ x (* y t))))
assert(y < t);
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -96000000000.0) || !(z <= 5.5e+22)) {
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 <= (-96000000000.0d0)) .or. (.not. (z <= 5.5d+22))) 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 <= -96000000000.0) || !(z <= 5.5e+22)) {
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 <= -96000000000.0) or not (z <= 5.5e+22): 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 <= -96000000000.0) || !(z <= 5.5e+22)) 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 <= -96000000000.0) || ~((z <= 5.5e+22)))
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, -96000000000.0], N[Not[LessEqual[z, 5.5e+22]], $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 -96000000000 \lor \neg \left(z \leq 5.5 \cdot 10^{+22}\right):\\
\;\;\;\;\frac{x}{z \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y \cdot t}\\
\end{array}
\end{array}
if z < -9.6e10 or 5.50000000000000021e22 < z Initial program 85.3%
Taylor expanded in z around inf 68.5%
unpow268.5%
Simplified68.5%
if -9.6e10 < z < 5.50000000000000021e22Initial program 95.2%
Taylor expanded in z around 0 58.8%
Final simplification63.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 -22000000000000.0) (not (<= z 1.46e+29))) (/ x (* z z)) (/ (/ x t) y)))
assert(y < t);
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -22000000000000.0) || !(z <= 1.46e+29)) {
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 <= (-22000000000000.0d0)) .or. (.not. (z <= 1.46d+29))) 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 <= -22000000000000.0) || !(z <= 1.46e+29)) {
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 <= -22000000000000.0) or not (z <= 1.46e+29): 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 <= -22000000000000.0) || !(z <= 1.46e+29)) 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 <= -22000000000000.0) || ~((z <= 1.46e+29)))
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, -22000000000000.0], N[Not[LessEqual[z, 1.46e+29]], $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 -22000000000000 \lor \neg \left(z \leq 1.46 \cdot 10^{+29}\right):\\
\;\;\;\;\frac{x}{z \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{t}}{y}\\
\end{array}
\end{array}
if z < -2.2e13 or 1.46e29 < z Initial program 85.9%
Taylor expanded in z around inf 69.5%
unpow269.5%
Simplified69.5%
if -2.2e13 < z < 1.46e29Initial program 94.6%
clear-num94.5%
associate-/r/94.5%
*-commutative94.5%
associate-/r*94.7%
Applied egg-rr94.7%
div-inv94.7%
associate-*l*94.4%
associate-/r/94.4%
*-un-lft-identity94.4%
times-frac94.7%
clear-num94.7%
/-rgt-identity94.7%
Applied egg-rr94.7%
Taylor expanded in z around 0 58.0%
*-lft-identity58.0%
times-frac63.0%
associate-*l/63.1%
*-lft-identity63.1%
Simplified63.1%
Final simplification66.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 -780000000000.0) (not (<= z 4.2e+28))) (/ (/ x z) z) (/ (/ x t) y)))
assert(y < t);
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -780000000000.0) || !(z <= 4.2e+28)) {
tmp = (x / z) / z;
} else {
tmp = (x / t) / y;
}
return tmp;
}
NOTE: y and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((z <= (-780000000000.0d0)) .or. (.not. (z <= 4.2d+28))) 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 <= -780000000000.0) || !(z <= 4.2e+28)) {
tmp = (x / z) / z;
} else {
tmp = (x / t) / y;
}
return tmp;
}
[y, t] = sort([y, t]) def code(x, y, z, t): tmp = 0 if (z <= -780000000000.0) or not (z <= 4.2e+28): tmp = (x / z) / z else: tmp = (x / t) / y return tmp
y, t = sort([y, t]) function code(x, y, z, t) tmp = 0.0 if ((z <= -780000000000.0) || !(z <= 4.2e+28)) 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 <= -780000000000.0) || ~((z <= 4.2e+28)))
tmp = (x / z) / z;
else
tmp = (x / t) / y;
end
tmp_2 = tmp;
end
NOTE: y and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[Or[LessEqual[z, -780000000000.0], N[Not[LessEqual[z, 4.2e+28]], $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 -780000000000 \lor \neg \left(z \leq 4.2 \cdot 10^{+28}\right):\\
\;\;\;\;\frac{\frac{x}{z}}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{t}}{y}\\
\end{array}
\end{array}
if z < -7.8e11 or 4.19999999999999978e28 < z Initial program 85.9%
Taylor expanded in z around inf 69.5%
unpow269.5%
associate-/r*76.6%
Simplified76.6%
if -7.8e11 < z < 4.19999999999999978e28Initial program 94.6%
clear-num94.5%
associate-/r/94.5%
*-commutative94.5%
associate-/r*94.7%
Applied egg-rr94.7%
div-inv94.7%
associate-*l*94.4%
associate-/r/94.4%
*-un-lft-identity94.4%
times-frac94.7%
clear-num94.7%
/-rgt-identity94.7%
Applied egg-rr94.7%
Taylor expanded in z around 0 58.0%
*-lft-identity58.0%
times-frac63.0%
associate-*l/63.1%
*-lft-identity63.1%
Simplified63.1%
Final simplification69.8%
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 90.2%
associate-/l/97.3%
Simplified97.3%
Final simplification97.3%
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 90.2%
Taylor expanded in z around 0 40.3%
Final simplification40.3%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (* (- y z) (- t z)))) (if (< (/ x t_1) 0.0) (/ (/ x (- y z)) (- t z)) (* x (/ 1.0 t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = (y - z) * (t - z);
double tmp;
if ((x / t_1) < 0.0) {
tmp = (x / (y - z)) / (t - z);
} else {
tmp = x * (1.0 / t_1);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = (y - z) * (t - z)
if ((x / t_1) < 0.0d0) then
tmp = (x / (y - z)) / (t - z)
else
tmp = x * (1.0d0 / t_1)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (y - z) * (t - z);
double tmp;
if ((x / t_1) < 0.0) {
tmp = (x / (y - z)) / (t - z);
} else {
tmp = x * (1.0 / t_1);
}
return tmp;
}
def code(x, y, z, t): t_1 = (y - z) * (t - z) tmp = 0 if (x / t_1) < 0.0: tmp = (x / (y - z)) / (t - z) else: tmp = x * (1.0 / t_1) return tmp
function code(x, y, z, t) t_1 = Float64(Float64(y - z) * Float64(t - z)) tmp = 0.0 if (Float64(x / t_1) < 0.0) tmp = Float64(Float64(x / Float64(y - z)) / Float64(t - z)); else tmp = Float64(x * Float64(1.0 / t_1)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (y - z) * (t - z); tmp = 0.0; if ((x / t_1) < 0.0) tmp = (x / (y - z)) / (t - z); else tmp = x * (1.0 / t_1); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(y - z), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision]}, If[Less[N[(x / t$95$1), $MachinePrecision], 0.0], N[(N[(x / N[(y - z), $MachinePrecision]), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], N[(x * N[(1.0 / t$95$1), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(y - z\right) \cdot \left(t - z\right)\\
\mathbf{if}\;\frac{x}{t_1} < 0:\\
\;\;\;\;\frac{\frac{x}{y - z}}{t - z}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{1}{t_1}\\
\end{array}
\end{array}
herbie shell --seed 2023257
(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))))