
(FPCore (x y z t a b) :precision binary64 (/ (+ (* x y) (* z (- t a))) (+ y (* z (- b y)))))
double code(double x, double y, double z, double t, double a, double b) {
return ((x * y) + (z * (t - a))) / (y + (z * (b - y)));
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = ((x * y) + (z * (t - a))) / (y + (z * (b - y)))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((x * y) + (z * (t - a))) / (y + (z * (b - y)));
}
def code(x, y, z, t, a, b): return ((x * y) + (z * (t - a))) / (y + (z * (b - y)))
function code(x, y, z, t, a, b) return Float64(Float64(Float64(x * y) + Float64(z * Float64(t - a))) / Float64(y + Float64(z * Float64(b - y)))) end
function tmp = code(x, y, z, t, a, b) tmp = ((x * y) + (z * (t - a))) / (y + (z * (b - y))); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(x * y), $MachinePrecision] + N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(y + N[(z * N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x \cdot y + z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 16 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b) :precision binary64 (/ (+ (* x y) (* z (- t a))) (+ y (* z (- b y)))))
double code(double x, double y, double z, double t, double a, double b) {
return ((x * y) + (z * (t - a))) / (y + (z * (b - y)));
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = ((x * y) + (z * (t - a))) / (y + (z * (b - y)))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((x * y) + (z * (t - a))) / (y + (z * (b - y)));
}
def code(x, y, z, t, a, b): return ((x * y) + (z * (t - a))) / (y + (z * (b - y)))
function code(x, y, z, t, a, b) return Float64(Float64(Float64(x * y) + Float64(z * Float64(t - a))) / Float64(y + Float64(z * Float64(b - y)))) end
function tmp = code(x, y, z, t, a, b) tmp = ((x * y) + (z * (t - a))) / (y + (z * (b - y))); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(x * y), $MachinePrecision] + N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(y + N[(z * N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x \cdot y + z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)}
\end{array}
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (pow (- b y) 2.0))
(t_2 (/ (+ (* z (- t a)) (* x y)) (+ y (* z (- b y))))))
(if (<= t_2 (- INFINITY))
(-
(/
(- (* (/ z (+ z -1.0)) (- a t)) (/ b (/ (pow (+ z -1.0) 2.0) (* x z))))
y)
(/ x (+ z -1.0)))
(if (<= t_2 -5e-258)
t_2
(if (<= t_2 0.0)
(+
(- (+ (/ t (- b y)) (/ (/ (* x y) z) (- b y))) (/ a (- b y)))
(* (/ y z) (/ (- a t) t_1)))
(if (<= t_2 5e+291)
t_2
(+
(/ (- (/ x (/ (- b y) y)) (/ y (/ t_1 (- t a)))) z)
(/ (- t a) (- b y)))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = pow((b - y), 2.0);
double t_2 = ((z * (t - a)) + (x * y)) / (y + (z * (b - y)));
double tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = ((((z / (z + -1.0)) * (a - t)) - (b / (pow((z + -1.0), 2.0) / (x * z)))) / y) - (x / (z + -1.0));
} else if (t_2 <= -5e-258) {
tmp = t_2;
} else if (t_2 <= 0.0) {
tmp = (((t / (b - y)) + (((x * y) / z) / (b - y))) - (a / (b - y))) + ((y / z) * ((a - t) / t_1));
} else if (t_2 <= 5e+291) {
tmp = t_2;
} else {
tmp = (((x / ((b - y) / y)) - (y / (t_1 / (t - a)))) / z) + ((t - a) / (b - y));
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = Math.pow((b - y), 2.0);
double t_2 = ((z * (t - a)) + (x * y)) / (y + (z * (b - y)));
double tmp;
if (t_2 <= -Double.POSITIVE_INFINITY) {
tmp = ((((z / (z + -1.0)) * (a - t)) - (b / (Math.pow((z + -1.0), 2.0) / (x * z)))) / y) - (x / (z + -1.0));
} else if (t_2 <= -5e-258) {
tmp = t_2;
} else if (t_2 <= 0.0) {
tmp = (((t / (b - y)) + (((x * y) / z) / (b - y))) - (a / (b - y))) + ((y / z) * ((a - t) / t_1));
} else if (t_2 <= 5e+291) {
tmp = t_2;
} else {
tmp = (((x / ((b - y) / y)) - (y / (t_1 / (t - a)))) / z) + ((t - a) / (b - y));
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = math.pow((b - y), 2.0) t_2 = ((z * (t - a)) + (x * y)) / (y + (z * (b - y))) tmp = 0 if t_2 <= -math.inf: tmp = ((((z / (z + -1.0)) * (a - t)) - (b / (math.pow((z + -1.0), 2.0) / (x * z)))) / y) - (x / (z + -1.0)) elif t_2 <= -5e-258: tmp = t_2 elif t_2 <= 0.0: tmp = (((t / (b - y)) + (((x * y) / z) / (b - y))) - (a / (b - y))) + ((y / z) * ((a - t) / t_1)) elif t_2 <= 5e+291: tmp = t_2 else: tmp = (((x / ((b - y) / y)) - (y / (t_1 / (t - a)))) / z) + ((t - a) / (b - y)) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(b - y) ^ 2.0 t_2 = Float64(Float64(Float64(z * Float64(t - a)) + Float64(x * y)) / Float64(y + Float64(z * Float64(b - y)))) tmp = 0.0 if (t_2 <= Float64(-Inf)) tmp = Float64(Float64(Float64(Float64(Float64(z / Float64(z + -1.0)) * Float64(a - t)) - Float64(b / Float64((Float64(z + -1.0) ^ 2.0) / Float64(x * z)))) / y) - Float64(x / Float64(z + -1.0))); elseif (t_2 <= -5e-258) tmp = t_2; elseif (t_2 <= 0.0) tmp = Float64(Float64(Float64(Float64(t / Float64(b - y)) + Float64(Float64(Float64(x * y) / z) / Float64(b - y))) - Float64(a / Float64(b - y))) + Float64(Float64(y / z) * Float64(Float64(a - t) / t_1))); elseif (t_2 <= 5e+291) tmp = t_2; else tmp = Float64(Float64(Float64(Float64(x / Float64(Float64(b - y) / y)) - Float64(y / Float64(t_1 / Float64(t - a)))) / z) + Float64(Float64(t - a) / Float64(b - y))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (b - y) ^ 2.0; t_2 = ((z * (t - a)) + (x * y)) / (y + (z * (b - y))); tmp = 0.0; if (t_2 <= -Inf) tmp = ((((z / (z + -1.0)) * (a - t)) - (b / (((z + -1.0) ^ 2.0) / (x * z)))) / y) - (x / (z + -1.0)); elseif (t_2 <= -5e-258) tmp = t_2; elseif (t_2 <= 0.0) tmp = (((t / (b - y)) + (((x * y) / z) / (b - y))) - (a / (b - y))) + ((y / z) * ((a - t) / t_1)); elseif (t_2 <= 5e+291) tmp = t_2; else tmp = (((x / ((b - y) / y)) - (y / (t_1 / (t - a)))) / z) + ((t - a) / (b - y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[Power[N[(b - y), $MachinePrecision], 2.0], $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision] / N[(y + N[(z * N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], N[(N[(N[(N[(N[(z / N[(z + -1.0), $MachinePrecision]), $MachinePrecision] * N[(a - t), $MachinePrecision]), $MachinePrecision] - N[(b / N[(N[Power[N[(z + -1.0), $MachinePrecision], 2.0], $MachinePrecision] / N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision] - N[(x / N[(z + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, -5e-258], t$95$2, If[LessEqual[t$95$2, 0.0], N[(N[(N[(N[(t / N[(b - y), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(x * y), $MachinePrecision] / z), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(a / N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(y / z), $MachinePrecision] * N[(N[(a - t), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 5e+291], t$95$2, N[(N[(N[(N[(x / N[(N[(b - y), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision] - N[(y / N[(t$95$1 / N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision] + N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := {\left(b - y\right)}^{2}\\
t_2 := \frac{z \cdot \left(t - a\right) + x \cdot y}{y + z \cdot \left(b - y\right)}\\
\mathbf{if}\;t_2 \leq -\infty:\\
\;\;\;\;\frac{\frac{z}{z + -1} \cdot \left(a - t\right) - \frac{b}{\frac{{\left(z + -1\right)}^{2}}{x \cdot z}}}{y} - \frac{x}{z + -1}\\
\mathbf{elif}\;t_2 \leq -5 \cdot 10^{-258}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t_2 \leq 0:\\
\;\;\;\;\left(\left(\frac{t}{b - y} + \frac{\frac{x \cdot y}{z}}{b - y}\right) - \frac{a}{b - y}\right) + \frac{y}{z} \cdot \frac{a - t}{t_1}\\
\mathbf{elif}\;t_2 \leq 5 \cdot 10^{+291}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{\frac{b - y}{y}} - \frac{y}{\frac{t_1}{t - a}}}{z} + \frac{t - a}{b - y}\\
\end{array}
\end{array}
if (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < -inf.0Initial program 17.2%
Taylor expanded in y around -inf 47.9%
mul-1-neg47.9%
unsub-neg47.9%
associate-*r/47.9%
neg-mul-147.9%
sub-neg47.9%
metadata-eval47.9%
Simplified69.7%
if -inf.0 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < -4.9999999999999999e-258 or -0.0 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < 5.0000000000000001e291Initial program 99.3%
if -4.9999999999999999e-258 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < -0.0Initial program 29.4%
Taylor expanded in z around inf 59.0%
associate--r+59.0%
associate-/r*89.1%
*-commutative89.1%
times-frac96.2%
Simplified96.2%
if 5.0000000000000001e291 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) Initial program 9.7%
Taylor expanded in z around -inf 39.4%
associate--l+39.4%
mul-1-neg39.4%
distribute-lft-out--39.4%
associate-/l*48.7%
associate-/l*85.0%
div-sub85.0%
Simplified85.0%
Final simplification93.0%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (+ (* z (- t a)) (* x y)) (+ y (* z (- b y))))))
(if (<= t_1 (- INFINITY))
(-
(/
(- (* (/ z (+ z -1.0)) (- a t)) (/ b (/ (pow (+ z -1.0) 2.0) (* x z))))
y)
(/ x (+ z -1.0)))
(if (or (<= t_1 -2e-268) (and (not (<= t_1 0.0)) (<= t_1 5e+291)))
t_1
(+
(+ (/ (- t a) (- b y)) (/ x (/ z (/ y (- b y)))))
(* (/ y z) (/ (- a t) (pow (- b y) 2.0))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((z * (t - a)) + (x * y)) / (y + (z * (b - y)));
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = ((((z / (z + -1.0)) * (a - t)) - (b / (pow((z + -1.0), 2.0) / (x * z)))) / y) - (x / (z + -1.0));
} else if ((t_1 <= -2e-268) || (!(t_1 <= 0.0) && (t_1 <= 5e+291))) {
tmp = t_1;
} else {
tmp = (((t - a) / (b - y)) + (x / (z / (y / (b - y))))) + ((y / z) * ((a - t) / pow((b - y), 2.0)));
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((z * (t - a)) + (x * y)) / (y + (z * (b - y)));
double tmp;
if (t_1 <= -Double.POSITIVE_INFINITY) {
tmp = ((((z / (z + -1.0)) * (a - t)) - (b / (Math.pow((z + -1.0), 2.0) / (x * z)))) / y) - (x / (z + -1.0));
} else if ((t_1 <= -2e-268) || (!(t_1 <= 0.0) && (t_1 <= 5e+291))) {
tmp = t_1;
} else {
tmp = (((t - a) / (b - y)) + (x / (z / (y / (b - y))))) + ((y / z) * ((a - t) / Math.pow((b - y), 2.0)));
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = ((z * (t - a)) + (x * y)) / (y + (z * (b - y))) tmp = 0 if t_1 <= -math.inf: tmp = ((((z / (z + -1.0)) * (a - t)) - (b / (math.pow((z + -1.0), 2.0) / (x * z)))) / y) - (x / (z + -1.0)) elif (t_1 <= -2e-268) or (not (t_1 <= 0.0) and (t_1 <= 5e+291)): tmp = t_1 else: tmp = (((t - a) / (b - y)) + (x / (z / (y / (b - y))))) + ((y / z) * ((a - t) / math.pow((b - y), 2.0))) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(z * Float64(t - a)) + Float64(x * y)) / Float64(y + Float64(z * Float64(b - y)))) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = Float64(Float64(Float64(Float64(Float64(z / Float64(z + -1.0)) * Float64(a - t)) - Float64(b / Float64((Float64(z + -1.0) ^ 2.0) / Float64(x * z)))) / y) - Float64(x / Float64(z + -1.0))); elseif ((t_1 <= -2e-268) || (!(t_1 <= 0.0) && (t_1 <= 5e+291))) tmp = t_1; else tmp = Float64(Float64(Float64(Float64(t - a) / Float64(b - y)) + Float64(x / Float64(z / Float64(y / Float64(b - y))))) + Float64(Float64(y / z) * Float64(Float64(a - t) / (Float64(b - y) ^ 2.0)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = ((z * (t - a)) + (x * y)) / (y + (z * (b - y))); tmp = 0.0; if (t_1 <= -Inf) tmp = ((((z / (z + -1.0)) * (a - t)) - (b / (((z + -1.0) ^ 2.0) / (x * z)))) / y) - (x / (z + -1.0)); elseif ((t_1 <= -2e-268) || (~((t_1 <= 0.0)) && (t_1 <= 5e+291))) tmp = t_1; else tmp = (((t - a) / (b - y)) + (x / (z / (y / (b - y))))) + ((y / z) * ((a - t) / ((b - y) ^ 2.0))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision] / N[(y + N[(z * N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(N[(N[(N[(N[(z / N[(z + -1.0), $MachinePrecision]), $MachinePrecision] * N[(a - t), $MachinePrecision]), $MachinePrecision] - N[(b / N[(N[Power[N[(z + -1.0), $MachinePrecision], 2.0], $MachinePrecision] / N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision] - N[(x / N[(z + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[t$95$1, -2e-268], And[N[Not[LessEqual[t$95$1, 0.0]], $MachinePrecision], LessEqual[t$95$1, 5e+291]]], t$95$1, N[(N[(N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision] + N[(x / N[(z / N[(y / N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(y / z), $MachinePrecision] * N[(N[(a - t), $MachinePrecision] / N[Power[N[(b - y), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{z \cdot \left(t - a\right) + x \cdot y}{y + z \cdot \left(b - y\right)}\\
\mathbf{if}\;t_1 \leq -\infty:\\
\;\;\;\;\frac{\frac{z}{z + -1} \cdot \left(a - t\right) - \frac{b}{\frac{{\left(z + -1\right)}^{2}}{x \cdot z}}}{y} - \frac{x}{z + -1}\\
\mathbf{elif}\;t_1 \leq -2 \cdot 10^{-268} \lor \neg \left(t_1 \leq 0\right) \land t_1 \leq 5 \cdot 10^{+291}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{t - a}{b - y} + \frac{x}{\frac{z}{\frac{y}{b - y}}}\right) + \frac{y}{z} \cdot \frac{a - t}{{\left(b - y\right)}^{2}}\\
\end{array}
\end{array}
if (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < -inf.0Initial program 17.2%
Taylor expanded in y around -inf 47.9%
mul-1-neg47.9%
unsub-neg47.9%
associate-*r/47.9%
neg-mul-147.9%
sub-neg47.9%
metadata-eval47.9%
Simplified69.7%
if -inf.0 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < -1.99999999999999992e-268 or -0.0 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < 5.0000000000000001e291Initial program 99.3%
if -1.99999999999999992e-268 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < -0.0 or 5.0000000000000001e291 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) Initial program 15.5%
Taylor expanded in z around inf 45.4%
associate--r+45.4%
+-commutative45.4%
associate--l+45.4%
associate-/l*50.4%
associate-/l*58.7%
div-sub58.7%
times-frac82.6%
Simplified82.6%
Final simplification91.1%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (+ (* z (- t a)) (* x y)) (+ y (* z (- b y))))))
(if (<= t_1 (- INFINITY))
(-
(/
(- (* (/ z (+ z -1.0)) (- a t)) (/ b (/ (pow (+ z -1.0) 2.0) (* x z))))
y)
(/ x (+ z -1.0)))
(if (or (<= t_1 -2e-268) (and (not (<= t_1 0.0)) (<= t_1 5e+291)))
t_1
(+
(/ (- (/ x (/ (- b y) y)) (/ y (/ (pow (- b y) 2.0) (- t a)))) z)
(/ (- t a) (- b y)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((z * (t - a)) + (x * y)) / (y + (z * (b - y)));
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = ((((z / (z + -1.0)) * (a - t)) - (b / (pow((z + -1.0), 2.0) / (x * z)))) / y) - (x / (z + -1.0));
} else if ((t_1 <= -2e-268) || (!(t_1 <= 0.0) && (t_1 <= 5e+291))) {
tmp = t_1;
} else {
tmp = (((x / ((b - y) / y)) - (y / (pow((b - y), 2.0) / (t - a)))) / z) + ((t - a) / (b - y));
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((z * (t - a)) + (x * y)) / (y + (z * (b - y)));
double tmp;
if (t_1 <= -Double.POSITIVE_INFINITY) {
tmp = ((((z / (z + -1.0)) * (a - t)) - (b / (Math.pow((z + -1.0), 2.0) / (x * z)))) / y) - (x / (z + -1.0));
} else if ((t_1 <= -2e-268) || (!(t_1 <= 0.0) && (t_1 <= 5e+291))) {
tmp = t_1;
} else {
tmp = (((x / ((b - y) / y)) - (y / (Math.pow((b - y), 2.0) / (t - a)))) / z) + ((t - a) / (b - y));
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = ((z * (t - a)) + (x * y)) / (y + (z * (b - y))) tmp = 0 if t_1 <= -math.inf: tmp = ((((z / (z + -1.0)) * (a - t)) - (b / (math.pow((z + -1.0), 2.0) / (x * z)))) / y) - (x / (z + -1.0)) elif (t_1 <= -2e-268) or (not (t_1 <= 0.0) and (t_1 <= 5e+291)): tmp = t_1 else: tmp = (((x / ((b - y) / y)) - (y / (math.pow((b - y), 2.0) / (t - a)))) / z) + ((t - a) / (b - y)) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(z * Float64(t - a)) + Float64(x * y)) / Float64(y + Float64(z * Float64(b - y)))) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = Float64(Float64(Float64(Float64(Float64(z / Float64(z + -1.0)) * Float64(a - t)) - Float64(b / Float64((Float64(z + -1.0) ^ 2.0) / Float64(x * z)))) / y) - Float64(x / Float64(z + -1.0))); elseif ((t_1 <= -2e-268) || (!(t_1 <= 0.0) && (t_1 <= 5e+291))) tmp = t_1; else tmp = Float64(Float64(Float64(Float64(x / Float64(Float64(b - y) / y)) - Float64(y / Float64((Float64(b - y) ^ 2.0) / Float64(t - a)))) / z) + Float64(Float64(t - a) / Float64(b - y))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = ((z * (t - a)) + (x * y)) / (y + (z * (b - y))); tmp = 0.0; if (t_1 <= -Inf) tmp = ((((z / (z + -1.0)) * (a - t)) - (b / (((z + -1.0) ^ 2.0) / (x * z)))) / y) - (x / (z + -1.0)); elseif ((t_1 <= -2e-268) || (~((t_1 <= 0.0)) && (t_1 <= 5e+291))) tmp = t_1; else tmp = (((x / ((b - y) / y)) - (y / (((b - y) ^ 2.0) / (t - a)))) / z) + ((t - a) / (b - y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision] / N[(y + N[(z * N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(N[(N[(N[(N[(z / N[(z + -1.0), $MachinePrecision]), $MachinePrecision] * N[(a - t), $MachinePrecision]), $MachinePrecision] - N[(b / N[(N[Power[N[(z + -1.0), $MachinePrecision], 2.0], $MachinePrecision] / N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision] - N[(x / N[(z + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[t$95$1, -2e-268], And[N[Not[LessEqual[t$95$1, 0.0]], $MachinePrecision], LessEqual[t$95$1, 5e+291]]], t$95$1, N[(N[(N[(N[(x / N[(N[(b - y), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision] - N[(y / N[(N[Power[N[(b - y), $MachinePrecision], 2.0], $MachinePrecision] / N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision] + N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{z \cdot \left(t - a\right) + x \cdot y}{y + z \cdot \left(b - y\right)}\\
\mathbf{if}\;t_1 \leq -\infty:\\
\;\;\;\;\frac{\frac{z}{z + -1} \cdot \left(a - t\right) - \frac{b}{\frac{{\left(z + -1\right)}^{2}}{x \cdot z}}}{y} - \frac{x}{z + -1}\\
\mathbf{elif}\;t_1 \leq -2 \cdot 10^{-268} \lor \neg \left(t_1 \leq 0\right) \land t_1 \leq 5 \cdot 10^{+291}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{\frac{b - y}{y}} - \frac{y}{\frac{{\left(b - y\right)}^{2}}{t - a}}}{z} + \frac{t - a}{b - y}\\
\end{array}
\end{array}
if (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < -inf.0Initial program 17.2%
Taylor expanded in y around -inf 47.9%
mul-1-neg47.9%
unsub-neg47.9%
associate-*r/47.9%
neg-mul-147.9%
sub-neg47.9%
metadata-eval47.9%
Simplified69.7%
if -inf.0 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < -1.99999999999999992e-268 or -0.0 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < 5.0000000000000001e291Initial program 99.3%
if -1.99999999999999992e-268 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < -0.0 or 5.0000000000000001e291 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) Initial program 15.5%
Taylor expanded in z around -inf 56.2%
associate--l+56.2%
mul-1-neg56.2%
distribute-lft-out--56.2%
associate-/l*62.4%
associate-/l*88.8%
div-sub88.7%
Simplified88.7%
Final simplification93.0%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (+ (* z (- t a)) (* x y)) (+ y (* z (- b y))))))
(if (<= t_1 (- INFINITY))
(-
(/
(- (* (/ z (+ z -1.0)) (- a t)) (/ b (/ (pow (+ z -1.0) 2.0) (* x z))))
y)
(/ x (+ z -1.0)))
(if (<= t_1 -2e-268)
t_1
(if (<= t_1 0.0)
(/ (- t a) (- b y))
(if (<= t_1 2e+286)
t_1
(-
(/ (- a t) (* y z))
(- (/ (- a t) (- b y)) (/ x (/ z (/ y (- b y))))))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((z * (t - a)) + (x * y)) / (y + (z * (b - y)));
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = ((((z / (z + -1.0)) * (a - t)) - (b / (pow((z + -1.0), 2.0) / (x * z)))) / y) - (x / (z + -1.0));
} else if (t_1 <= -2e-268) {
tmp = t_1;
} else if (t_1 <= 0.0) {
tmp = (t - a) / (b - y);
} else if (t_1 <= 2e+286) {
tmp = t_1;
} else {
tmp = ((a - t) / (y * z)) - (((a - t) / (b - y)) - (x / (z / (y / (b - y)))));
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((z * (t - a)) + (x * y)) / (y + (z * (b - y)));
double tmp;
if (t_1 <= -Double.POSITIVE_INFINITY) {
tmp = ((((z / (z + -1.0)) * (a - t)) - (b / (Math.pow((z + -1.0), 2.0) / (x * z)))) / y) - (x / (z + -1.0));
} else if (t_1 <= -2e-268) {
tmp = t_1;
} else if (t_1 <= 0.0) {
tmp = (t - a) / (b - y);
} else if (t_1 <= 2e+286) {
tmp = t_1;
} else {
tmp = ((a - t) / (y * z)) - (((a - t) / (b - y)) - (x / (z / (y / (b - y)))));
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = ((z * (t - a)) + (x * y)) / (y + (z * (b - y))) tmp = 0 if t_1 <= -math.inf: tmp = ((((z / (z + -1.0)) * (a - t)) - (b / (math.pow((z + -1.0), 2.0) / (x * z)))) / y) - (x / (z + -1.0)) elif t_1 <= -2e-268: tmp = t_1 elif t_1 <= 0.0: tmp = (t - a) / (b - y) elif t_1 <= 2e+286: tmp = t_1 else: tmp = ((a - t) / (y * z)) - (((a - t) / (b - y)) - (x / (z / (y / (b - y))))) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(z * Float64(t - a)) + Float64(x * y)) / Float64(y + Float64(z * Float64(b - y)))) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = Float64(Float64(Float64(Float64(Float64(z / Float64(z + -1.0)) * Float64(a - t)) - Float64(b / Float64((Float64(z + -1.0) ^ 2.0) / Float64(x * z)))) / y) - Float64(x / Float64(z + -1.0))); elseif (t_1 <= -2e-268) tmp = t_1; elseif (t_1 <= 0.0) tmp = Float64(Float64(t - a) / Float64(b - y)); elseif (t_1 <= 2e+286) tmp = t_1; else tmp = Float64(Float64(Float64(a - t) / Float64(y * z)) - Float64(Float64(Float64(a - t) / Float64(b - y)) - Float64(x / Float64(z / Float64(y / Float64(b - y)))))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = ((z * (t - a)) + (x * y)) / (y + (z * (b - y))); tmp = 0.0; if (t_1 <= -Inf) tmp = ((((z / (z + -1.0)) * (a - t)) - (b / (((z + -1.0) ^ 2.0) / (x * z)))) / y) - (x / (z + -1.0)); elseif (t_1 <= -2e-268) tmp = t_1; elseif (t_1 <= 0.0) tmp = (t - a) / (b - y); elseif (t_1 <= 2e+286) tmp = t_1; else tmp = ((a - t) / (y * z)) - (((a - t) / (b - y)) - (x / (z / (y / (b - y))))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision] / N[(y + N[(z * N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(N[(N[(N[(N[(z / N[(z + -1.0), $MachinePrecision]), $MachinePrecision] * N[(a - t), $MachinePrecision]), $MachinePrecision] - N[(b / N[(N[Power[N[(z + -1.0), $MachinePrecision], 2.0], $MachinePrecision] / N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision] - N[(x / N[(z + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, -2e-268], t$95$1, If[LessEqual[t$95$1, 0.0], N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2e+286], t$95$1, N[(N[(N[(a - t), $MachinePrecision] / N[(y * z), $MachinePrecision]), $MachinePrecision] - N[(N[(N[(a - t), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision] - N[(x / N[(z / N[(y / N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{z \cdot \left(t - a\right) + x \cdot y}{y + z \cdot \left(b - y\right)}\\
\mathbf{if}\;t_1 \leq -\infty:\\
\;\;\;\;\frac{\frac{z}{z + -1} \cdot \left(a - t\right) - \frac{b}{\frac{{\left(z + -1\right)}^{2}}{x \cdot z}}}{y} - \frac{x}{z + -1}\\
\mathbf{elif}\;t_1 \leq -2 \cdot 10^{-268}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t_1 \leq 0:\\
\;\;\;\;\frac{t - a}{b - y}\\
\mathbf{elif}\;t_1 \leq 2 \cdot 10^{+286}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\frac{a - t}{y \cdot z} - \left(\frac{a - t}{b - y} - \frac{x}{\frac{z}{\frac{y}{b - y}}}\right)\\
\end{array}
\end{array}
if (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < -inf.0Initial program 17.2%
Taylor expanded in y around -inf 47.9%
mul-1-neg47.9%
unsub-neg47.9%
associate-*r/47.9%
neg-mul-147.9%
sub-neg47.9%
metadata-eval47.9%
Simplified69.7%
if -inf.0 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < -1.99999999999999992e-268 or -0.0 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < 2.00000000000000007e286Initial program 99.3%
if -1.99999999999999992e-268 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < -0.0Initial program 26.8%
Taylor expanded in z around inf 64.9%
if 2.00000000000000007e286 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) Initial program 13.0%
Taylor expanded in z around inf 37.9%
associate--r+37.9%
+-commutative37.9%
associate--l+37.9%
associate-/l*45.2%
associate-/l*46.9%
div-sub46.9%
times-frac77.9%
Simplified77.9%
Taylor expanded in y around inf 79.7%
Final simplification88.5%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (+ (* z (- t a)) (* x y)) (+ y (* z (- b y))))))
(if (<= t_1 (- INFINITY))
(* y (/ x (fma z (- b y) y)))
(if (<= t_1 -2e-268)
t_1
(if (<= t_1 0.0)
(/ (- t a) (- b y))
(if (<= t_1 2e+286)
t_1
(-
(/ (- a t) (* y z))
(- (/ (- a t) (- b y)) (/ x (/ z (/ y (- b y))))))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((z * (t - a)) + (x * y)) / (y + (z * (b - y)));
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = y * (x / fma(z, (b - y), y));
} else if (t_1 <= -2e-268) {
tmp = t_1;
} else if (t_1 <= 0.0) {
tmp = (t - a) / (b - y);
} else if (t_1 <= 2e+286) {
tmp = t_1;
} else {
tmp = ((a - t) / (y * z)) - (((a - t) / (b - y)) - (x / (z / (y / (b - y)))));
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(z * Float64(t - a)) + Float64(x * y)) / Float64(y + Float64(z * Float64(b - y)))) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = Float64(y * Float64(x / fma(z, Float64(b - y), y))); elseif (t_1 <= -2e-268) tmp = t_1; elseif (t_1 <= 0.0) tmp = Float64(Float64(t - a) / Float64(b - y)); elseif (t_1 <= 2e+286) tmp = t_1; else tmp = Float64(Float64(Float64(a - t) / Float64(y * z)) - Float64(Float64(Float64(a - t) / Float64(b - y)) - Float64(x / Float64(z / Float64(y / Float64(b - y)))))); end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision] / N[(y + N[(z * N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(y * N[(x / N[(z * N[(b - y), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, -2e-268], t$95$1, If[LessEqual[t$95$1, 0.0], N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2e+286], t$95$1, N[(N[(N[(a - t), $MachinePrecision] / N[(y * z), $MachinePrecision]), $MachinePrecision] - N[(N[(N[(a - t), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision] - N[(x / N[(z / N[(y / N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{z \cdot \left(t - a\right) + x \cdot y}{y + z \cdot \left(b - y\right)}\\
\mathbf{if}\;t_1 \leq -\infty:\\
\;\;\;\;y \cdot \frac{x}{\mathsf{fma}\left(z, b - y, y\right)}\\
\mathbf{elif}\;t_1 \leq -2 \cdot 10^{-268}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t_1 \leq 0:\\
\;\;\;\;\frac{t - a}{b - y}\\
\mathbf{elif}\;t_1 \leq 2 \cdot 10^{+286}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\frac{a - t}{y \cdot z} - \left(\frac{a - t}{b - y} - \frac{x}{\frac{z}{\frac{y}{b - y}}}\right)\\
\end{array}
\end{array}
if (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < -inf.0Initial program 17.2%
Taylor expanded in x around inf 4.6%
associate-/l*58.4%
+-commutative58.4%
fma-udef58.4%
associate-/r/61.9%
Simplified61.9%
if -inf.0 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < -1.99999999999999992e-268 or -0.0 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < 2.00000000000000007e286Initial program 99.3%
if -1.99999999999999992e-268 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < -0.0Initial program 26.8%
Taylor expanded in z around inf 64.9%
if 2.00000000000000007e286 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) Initial program 13.0%
Taylor expanded in z around inf 37.9%
associate--r+37.9%
+-commutative37.9%
associate--l+37.9%
associate-/l*45.2%
associate-/l*46.9%
div-sub46.9%
times-frac77.9%
Simplified77.9%
Taylor expanded in y around inf 79.7%
Final simplification87.7%
(FPCore (x y z t a b)
:precision binary64
(if (<= z -2.15e+40)
(/ (- t a) (- b y))
(if (<= z 410000000000.0)
(/ (+ (* z (- t a)) (* x y)) (+ y (* z (- b y))))
(-
(/ (- a t) (* y z))
(- (/ (- a t) (- b y)) (/ x (/ z (/ y (- b y)))))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -2.15e+40) {
tmp = (t - a) / (b - y);
} else if (z <= 410000000000.0) {
tmp = ((z * (t - a)) + (x * y)) / (y + (z * (b - y)));
} else {
tmp = ((a - t) / (y * z)) - (((a - t) / (b - y)) - (x / (z / (y / (b - y)))));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (z <= (-2.15d+40)) then
tmp = (t - a) / (b - y)
else if (z <= 410000000000.0d0) then
tmp = ((z * (t - a)) + (x * y)) / (y + (z * (b - y)))
else
tmp = ((a - t) / (y * z)) - (((a - t) / (b - y)) - (x / (z / (y / (b - y)))))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -2.15e+40) {
tmp = (t - a) / (b - y);
} else if (z <= 410000000000.0) {
tmp = ((z * (t - a)) + (x * y)) / (y + (z * (b - y)));
} else {
tmp = ((a - t) / (y * z)) - (((a - t) / (b - y)) - (x / (z / (y / (b - y)))));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= -2.15e+40: tmp = (t - a) / (b - y) elif z <= 410000000000.0: tmp = ((z * (t - a)) + (x * y)) / (y + (z * (b - y))) else: tmp = ((a - t) / (y * z)) - (((a - t) / (b - y)) - (x / (z / (y / (b - y))))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -2.15e+40) tmp = Float64(Float64(t - a) / Float64(b - y)); elseif (z <= 410000000000.0) tmp = Float64(Float64(Float64(z * Float64(t - a)) + Float64(x * y)) / Float64(y + Float64(z * Float64(b - y)))); else tmp = Float64(Float64(Float64(a - t) / Float64(y * z)) - Float64(Float64(Float64(a - t) / Float64(b - y)) - Float64(x / Float64(z / Float64(y / Float64(b - y)))))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (z <= -2.15e+40) tmp = (t - a) / (b - y); elseif (z <= 410000000000.0) tmp = ((z * (t - a)) + (x * y)) / (y + (z * (b - y))); else tmp = ((a - t) / (y * z)) - (((a - t) / (b - y)) - (x / (z / (y / (b - y))))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -2.15e+40], N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 410000000000.0], N[(N[(N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision] / N[(y + N[(z * N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(a - t), $MachinePrecision] / N[(y * z), $MachinePrecision]), $MachinePrecision] - N[(N[(N[(a - t), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision] - N[(x / N[(z / N[(y / N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.15 \cdot 10^{+40}:\\
\;\;\;\;\frac{t - a}{b - y}\\
\mathbf{elif}\;z \leq 410000000000:\\
\;\;\;\;\frac{z \cdot \left(t - a\right) + x \cdot y}{y + z \cdot \left(b - y\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{a - t}{y \cdot z} - \left(\frac{a - t}{b - y} - \frac{x}{\frac{z}{\frac{y}{b - y}}}\right)\\
\end{array}
\end{array}
if z < -2.1500000000000001e40Initial program 39.1%
Taylor expanded in z around inf 81.8%
if -2.1500000000000001e40 < z < 4.1e11Initial program 86.5%
if 4.1e11 < z Initial program 41.7%
Taylor expanded in z around inf 57.4%
associate--r+57.4%
+-commutative57.4%
associate--l+57.4%
associate-/l*60.7%
associate-/l*67.0%
div-sub67.0%
times-frac83.5%
Simplified83.5%
Taylor expanded in y around inf 86.4%
Final simplification85.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ y (* z (- b y)))) (t_2 (/ (- t a) (- b y))))
(if (<= z -3.7e+15)
t_2
(if (<= z -4.5e-120)
(/ (* z (- t a)) t_1)
(if (<= z -4e-263)
(/ (* x y) t_1)
(if (<= z 4.8e-138)
x
(if (<= z 2.6) (/ (+ t (- (/ x (/ z y)) a)) b) t_2)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = y + (z * (b - y));
double t_2 = (t - a) / (b - y);
double tmp;
if (z <= -3.7e+15) {
tmp = t_2;
} else if (z <= -4.5e-120) {
tmp = (z * (t - a)) / t_1;
} else if (z <= -4e-263) {
tmp = (x * y) / t_1;
} else if (z <= 4.8e-138) {
tmp = x;
} else if (z <= 2.6) {
tmp = (t + ((x / (z / y)) - a)) / b;
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = y + (z * (b - y))
t_2 = (t - a) / (b - y)
if (z <= (-3.7d+15)) then
tmp = t_2
else if (z <= (-4.5d-120)) then
tmp = (z * (t - a)) / t_1
else if (z <= (-4d-263)) then
tmp = (x * y) / t_1
else if (z <= 4.8d-138) then
tmp = x
else if (z <= 2.6d0) then
tmp = (t + ((x / (z / y)) - a)) / b
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = y + (z * (b - y));
double t_2 = (t - a) / (b - y);
double tmp;
if (z <= -3.7e+15) {
tmp = t_2;
} else if (z <= -4.5e-120) {
tmp = (z * (t - a)) / t_1;
} else if (z <= -4e-263) {
tmp = (x * y) / t_1;
} else if (z <= 4.8e-138) {
tmp = x;
} else if (z <= 2.6) {
tmp = (t + ((x / (z / y)) - a)) / b;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = y + (z * (b - y)) t_2 = (t - a) / (b - y) tmp = 0 if z <= -3.7e+15: tmp = t_2 elif z <= -4.5e-120: tmp = (z * (t - a)) / t_1 elif z <= -4e-263: tmp = (x * y) / t_1 elif z <= 4.8e-138: tmp = x elif z <= 2.6: tmp = (t + ((x / (z / y)) - a)) / b else: tmp = t_2 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(y + Float64(z * Float64(b - y))) t_2 = Float64(Float64(t - a) / Float64(b - y)) tmp = 0.0 if (z <= -3.7e+15) tmp = t_2; elseif (z <= -4.5e-120) tmp = Float64(Float64(z * Float64(t - a)) / t_1); elseif (z <= -4e-263) tmp = Float64(Float64(x * y) / t_1); elseif (z <= 4.8e-138) tmp = x; elseif (z <= 2.6) tmp = Float64(Float64(t + Float64(Float64(x / Float64(z / y)) - a)) / b); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = y + (z * (b - y)); t_2 = (t - a) / (b - y); tmp = 0.0; if (z <= -3.7e+15) tmp = t_2; elseif (z <= -4.5e-120) tmp = (z * (t - a)) / t_1; elseif (z <= -4e-263) tmp = (x * y) / t_1; elseif (z <= 4.8e-138) tmp = x; elseif (z <= 2.6) tmp = (t + ((x / (z / y)) - a)) / b; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(y + N[(z * N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -3.7e+15], t$95$2, If[LessEqual[z, -4.5e-120], N[(N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision], If[LessEqual[z, -4e-263], N[(N[(x * y), $MachinePrecision] / t$95$1), $MachinePrecision], If[LessEqual[z, 4.8e-138], x, If[LessEqual[z, 2.6], N[(N[(t + N[(N[(x / N[(z / y), $MachinePrecision]), $MachinePrecision] - a), $MachinePrecision]), $MachinePrecision] / b), $MachinePrecision], t$95$2]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y + z \cdot \left(b - y\right)\\
t_2 := \frac{t - a}{b - y}\\
\mathbf{if}\;z \leq -3.7 \cdot 10^{+15}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq -4.5 \cdot 10^{-120}:\\
\;\;\;\;\frac{z \cdot \left(t - a\right)}{t_1}\\
\mathbf{elif}\;z \leq -4 \cdot 10^{-263}:\\
\;\;\;\;\frac{x \cdot y}{t_1}\\
\mathbf{elif}\;z \leq 4.8 \cdot 10^{-138}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 2.6:\\
\;\;\;\;\frac{t + \left(\frac{x}{\frac{z}{y}} - a\right)}{b}\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if z < -3.7e15 or 2.60000000000000009 < z Initial program 42.5%
Taylor expanded in z around inf 77.9%
if -3.7e15 < z < -4.5e-120Initial program 88.1%
Taylor expanded in x around 0 59.2%
if -4.5e-120 < z < -4e-263Initial program 93.5%
Taylor expanded in x around inf 64.9%
*-commutative64.9%
Simplified64.9%
if -4e-263 < z < 4.7999999999999998e-138Initial program 78.3%
Taylor expanded in z around 0 58.8%
if 4.7999999999999998e-138 < z < 2.60000000000000009Initial program 92.4%
Taylor expanded in y around 0 55.5%
associate--l+55.5%
associate-/r*55.5%
times-frac51.5%
mul-1-neg51.5%
div-sub51.5%
Simplified51.5%
Taylor expanded in b around inf 66.6%
associate--l+66.6%
associate-/l*66.6%
Simplified66.6%
Final simplification69.6%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -3.7e+39) (not (<= z 4.8e+111))) (/ (- t a) (- b y)) (/ (+ (* z (- t a)) (* x y)) (+ y (* z (- b y))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -3.7e+39) || !(z <= 4.8e+111)) {
tmp = (t - a) / (b - y);
} else {
tmp = ((z * (t - a)) + (x * y)) / (y + (z * (b - y)));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((z <= (-3.7d+39)) .or. (.not. (z <= 4.8d+111))) then
tmp = (t - a) / (b - y)
else
tmp = ((z * (t - a)) + (x * y)) / (y + (z * (b - y)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -3.7e+39) || !(z <= 4.8e+111)) {
tmp = (t - a) / (b - y);
} else {
tmp = ((z * (t - a)) + (x * y)) / (y + (z * (b - y)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -3.7e+39) or not (z <= 4.8e+111): tmp = (t - a) / (b - y) else: tmp = ((z * (t - a)) + (x * y)) / (y + (z * (b - y))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -3.7e+39) || !(z <= 4.8e+111)) tmp = Float64(Float64(t - a) / Float64(b - y)); else tmp = Float64(Float64(Float64(z * Float64(t - a)) + Float64(x * y)) / Float64(y + Float64(z * Float64(b - y)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((z <= -3.7e+39) || ~((z <= 4.8e+111))) tmp = (t - a) / (b - y); else tmp = ((z * (t - a)) + (x * y)) / (y + (z * (b - y))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -3.7e+39], N[Not[LessEqual[z, 4.8e+111]], $MachinePrecision]], N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision], N[(N[(N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision] / N[(y + N[(z * N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.7 \cdot 10^{+39} \lor \neg \left(z \leq 4.8 \cdot 10^{+111}\right):\\
\;\;\;\;\frac{t - a}{b - y}\\
\mathbf{else}:\\
\;\;\;\;\frac{z \cdot \left(t - a\right) + x \cdot y}{y + z \cdot \left(b - y\right)}\\
\end{array}
\end{array}
if z < -3.70000000000000012e39 or 4.80000000000000011e111 < z Initial program 36.4%
Taylor expanded in z around inf 82.9%
if -3.70000000000000012e39 < z < 4.80000000000000011e111Initial program 84.7%
Final simplification84.0%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -0.0043) (not (<= z 9.5e-13))) (/ (- t a) (- b y)) (/ (- (* x y) (* z a)) (+ y (* z (- b y))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -0.0043) || !(z <= 9.5e-13)) {
tmp = (t - a) / (b - y);
} else {
tmp = ((x * y) - (z * a)) / (y + (z * (b - y)));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((z <= (-0.0043d0)) .or. (.not. (z <= 9.5d-13))) then
tmp = (t - a) / (b - y)
else
tmp = ((x * y) - (z * a)) / (y + (z * (b - y)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -0.0043) || !(z <= 9.5e-13)) {
tmp = (t - a) / (b - y);
} else {
tmp = ((x * y) - (z * a)) / (y + (z * (b - y)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -0.0043) or not (z <= 9.5e-13): tmp = (t - a) / (b - y) else: tmp = ((x * y) - (z * a)) / (y + (z * (b - y))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -0.0043) || !(z <= 9.5e-13)) tmp = Float64(Float64(t - a) / Float64(b - y)); else tmp = Float64(Float64(Float64(x * y) - Float64(z * a)) / Float64(y + Float64(z * Float64(b - y)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((z <= -0.0043) || ~((z <= 9.5e-13))) tmp = (t - a) / (b - y); else tmp = ((x * y) - (z * a)) / (y + (z * (b - y))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -0.0043], N[Not[LessEqual[z, 9.5e-13]], $MachinePrecision]], N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x * y), $MachinePrecision] - N[(z * a), $MachinePrecision]), $MachinePrecision] / N[(y + N[(z * N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.0043 \lor \neg \left(z \leq 9.5 \cdot 10^{-13}\right):\\
\;\;\;\;\frac{t - a}{b - y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot y - z \cdot a}{y + z \cdot \left(b - y\right)}\\
\end{array}
\end{array}
if z < -0.0043 or 9.49999999999999991e-13 < z Initial program 45.3%
Taylor expanded in z around inf 77.7%
if -0.0043 < z < 9.49999999999999991e-13Initial program 86.4%
Taylor expanded in t around 0 64.6%
+-commutative64.6%
mul-1-neg64.6%
unsub-neg64.6%
*-commutative64.6%
*-commutative64.6%
Simplified64.6%
Final simplification71.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ x (- 1.0 z))))
(if (<= y -3.6e+50)
t_1
(if (<= y -2.7e-95)
(/ t b)
(if (<= y -8.5e-152)
t_1
(if (<= y -1.25e-274)
(/ t b)
(if (<= y 1.8e-99)
(/ (- a) b)
(if (<= y 6.1e-34) (/ t b) t_1))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x / (1.0 - z);
double tmp;
if (y <= -3.6e+50) {
tmp = t_1;
} else if (y <= -2.7e-95) {
tmp = t / b;
} else if (y <= -8.5e-152) {
tmp = t_1;
} else if (y <= -1.25e-274) {
tmp = t / b;
} else if (y <= 1.8e-99) {
tmp = -a / b;
} else if (y <= 6.1e-34) {
tmp = t / b;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = x / (1.0d0 - z)
if (y <= (-3.6d+50)) then
tmp = t_1
else if (y <= (-2.7d-95)) then
tmp = t / b
else if (y <= (-8.5d-152)) then
tmp = t_1
else if (y <= (-1.25d-274)) then
tmp = t / b
else if (y <= 1.8d-99) then
tmp = -a / b
else if (y <= 6.1d-34) then
tmp = t / b
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x / (1.0 - z);
double tmp;
if (y <= -3.6e+50) {
tmp = t_1;
} else if (y <= -2.7e-95) {
tmp = t / b;
} else if (y <= -8.5e-152) {
tmp = t_1;
} else if (y <= -1.25e-274) {
tmp = t / b;
} else if (y <= 1.8e-99) {
tmp = -a / b;
} else if (y <= 6.1e-34) {
tmp = t / b;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x / (1.0 - z) tmp = 0 if y <= -3.6e+50: tmp = t_1 elif y <= -2.7e-95: tmp = t / b elif y <= -8.5e-152: tmp = t_1 elif y <= -1.25e-274: tmp = t / b elif y <= 1.8e-99: tmp = -a / b elif y <= 6.1e-34: tmp = t / b else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x / Float64(1.0 - z)) tmp = 0.0 if (y <= -3.6e+50) tmp = t_1; elseif (y <= -2.7e-95) tmp = Float64(t / b); elseif (y <= -8.5e-152) tmp = t_1; elseif (y <= -1.25e-274) tmp = Float64(t / b); elseif (y <= 1.8e-99) tmp = Float64(Float64(-a) / b); elseif (y <= 6.1e-34) tmp = Float64(t / b); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x / (1.0 - z); tmp = 0.0; if (y <= -3.6e+50) tmp = t_1; elseif (y <= -2.7e-95) tmp = t / b; elseif (y <= -8.5e-152) tmp = t_1; elseif (y <= -1.25e-274) tmp = t / b; elseif (y <= 1.8e-99) tmp = -a / b; elseif (y <= 6.1e-34) tmp = t / b; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x / N[(1.0 - z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -3.6e+50], t$95$1, If[LessEqual[y, -2.7e-95], N[(t / b), $MachinePrecision], If[LessEqual[y, -8.5e-152], t$95$1, If[LessEqual[y, -1.25e-274], N[(t / b), $MachinePrecision], If[LessEqual[y, 1.8e-99], N[((-a) / b), $MachinePrecision], If[LessEqual[y, 6.1e-34], N[(t / b), $MachinePrecision], t$95$1]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{1 - z}\\
\mathbf{if}\;y \leq -3.6 \cdot 10^{+50}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq -2.7 \cdot 10^{-95}:\\
\;\;\;\;\frac{t}{b}\\
\mathbf{elif}\;y \leq -8.5 \cdot 10^{-152}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq -1.25 \cdot 10^{-274}:\\
\;\;\;\;\frac{t}{b}\\
\mathbf{elif}\;y \leq 1.8 \cdot 10^{-99}:\\
\;\;\;\;\frac{-a}{b}\\
\mathbf{elif}\;y \leq 6.1 \cdot 10^{-34}:\\
\;\;\;\;\frac{t}{b}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if y < -3.59999999999999986e50 or -2.7e-95 < y < -8.5000000000000007e-152 or 6.0999999999999998e-34 < y Initial program 49.2%
Taylor expanded in y around inf 54.1%
mul-1-neg54.1%
unsub-neg54.1%
Simplified54.1%
if -3.59999999999999986e50 < y < -2.7e-95 or -8.5000000000000007e-152 < y < -1.25e-274 or 1.8e-99 < y < 6.0999999999999998e-34Initial program 77.8%
Taylor expanded in b around inf 51.6%
Taylor expanded in t around inf 40.5%
if -1.25e-274 < y < 1.8e-99Initial program 85.2%
Taylor expanded in a around inf 45.0%
mul-1-neg45.0%
distribute-lft-neg-out45.0%
*-commutative45.0%
Simplified45.0%
Taylor expanded in y around 0 42.8%
associate-*r/42.8%
neg-mul-142.8%
Simplified42.8%
Final simplification47.7%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (- t a) (- b y))))
(if (<= z -1e-53)
t_1
(if (<= z 9.5e-138)
x
(if (<= z 5.2) (/ (+ t (- (/ x (/ z y)) a)) b) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (t - a) / (b - y);
double tmp;
if (z <= -1e-53) {
tmp = t_1;
} else if (z <= 9.5e-138) {
tmp = x;
} else if (z <= 5.2) {
tmp = (t + ((x / (z / y)) - a)) / b;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = (t - a) / (b - y)
if (z <= (-1d-53)) then
tmp = t_1
else if (z <= 9.5d-138) then
tmp = x
else if (z <= 5.2d0) then
tmp = (t + ((x / (z / y)) - a)) / b
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (t - a) / (b - y);
double tmp;
if (z <= -1e-53) {
tmp = t_1;
} else if (z <= 9.5e-138) {
tmp = x;
} else if (z <= 5.2) {
tmp = (t + ((x / (z / y)) - a)) / b;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (t - a) / (b - y) tmp = 0 if z <= -1e-53: tmp = t_1 elif z <= 9.5e-138: tmp = x elif z <= 5.2: tmp = (t + ((x / (z / y)) - a)) / b else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(t - a) / Float64(b - y)) tmp = 0.0 if (z <= -1e-53) tmp = t_1; elseif (z <= 9.5e-138) tmp = x; elseif (z <= 5.2) tmp = Float64(Float64(t + Float64(Float64(x / Float64(z / y)) - a)) / b); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (t - a) / (b - y); tmp = 0.0; if (z <= -1e-53) tmp = t_1; elseif (z <= 9.5e-138) tmp = x; elseif (z <= 5.2) tmp = (t + ((x / (z / y)) - a)) / b; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1e-53], t$95$1, If[LessEqual[z, 9.5e-138], x, If[LessEqual[z, 5.2], N[(N[(t + N[(N[(x / N[(z / y), $MachinePrecision]), $MachinePrecision] - a), $MachinePrecision]), $MachinePrecision] / b), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t - a}{b - y}\\
\mathbf{if}\;z \leq -1 \cdot 10^{-53}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 9.5 \cdot 10^{-138}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 5.2:\\
\;\;\;\;\frac{t + \left(\frac{x}{\frac{z}{y}} - a\right)}{b}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -1.00000000000000003e-53 or 5.20000000000000018 < z Initial program 48.0%
Taylor expanded in z around inf 75.1%
if -1.00000000000000003e-53 < z < 9.49999999999999997e-138Initial program 84.8%
Taylor expanded in z around 0 55.3%
if 9.49999999999999997e-138 < z < 5.20000000000000018Initial program 92.4%
Taylor expanded in y around 0 55.5%
associate--l+55.5%
associate-/r*55.5%
times-frac51.5%
mul-1-neg51.5%
div-sub51.5%
Simplified51.5%
Taylor expanded in b around inf 66.6%
associate--l+66.6%
associate-/l*66.6%
Simplified66.6%
Final simplification67.3%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -6e-52) (not (<= z 9.8e-138))) (/ (- t a) (- b y)) x))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -6e-52) || !(z <= 9.8e-138)) {
tmp = (t - a) / (b - y);
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((z <= (-6d-52)) .or. (.not. (z <= 9.8d-138))) then
tmp = (t - a) / (b - y)
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -6e-52) || !(z <= 9.8e-138)) {
tmp = (t - a) / (b - y);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -6e-52) or not (z <= 9.8e-138): tmp = (t - a) / (b - y) else: tmp = x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -6e-52) || !(z <= 9.8e-138)) tmp = Float64(Float64(t - a) / Float64(b - y)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((z <= -6e-52) || ~((z <= 9.8e-138))) tmp = (t - a) / (b - y); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -6e-52], N[Not[LessEqual[z, 9.8e-138]], $MachinePrecision]], N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6 \cdot 10^{-52} \lor \neg \left(z \leq 9.8 \cdot 10^{-138}\right):\\
\;\;\;\;\frac{t - a}{b - y}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -6e-52 or 9.80000000000000033e-138 < z Initial program 54.4%
Taylor expanded in z around inf 71.4%
if -6e-52 < z < 9.80000000000000033e-138Initial program 84.8%
Taylor expanded in z around 0 55.3%
Final simplification65.7%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -1.45e+80) (not (<= y 2.9e-32))) (/ x (- 1.0 z)) (/ (- t a) b)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -1.45e+80) || !(y <= 2.9e-32)) {
tmp = x / (1.0 - z);
} else {
tmp = (t - a) / b;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((y <= (-1.45d+80)) .or. (.not. (y <= 2.9d-32))) then
tmp = x / (1.0d0 - z)
else
tmp = (t - a) / b
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -1.45e+80) || !(y <= 2.9e-32)) {
tmp = x / (1.0 - z);
} else {
tmp = (t - a) / b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -1.45e+80) or not (y <= 2.9e-32): tmp = x / (1.0 - z) else: tmp = (t - a) / b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -1.45e+80) || !(y <= 2.9e-32)) tmp = Float64(x / Float64(1.0 - z)); else tmp = Float64(Float64(t - a) / b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -1.45e+80) || ~((y <= 2.9e-32))) tmp = x / (1.0 - z); else tmp = (t - a) / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -1.45e+80], N[Not[LessEqual[y, 2.9e-32]], $MachinePrecision]], N[(x / N[(1.0 - z), $MachinePrecision]), $MachinePrecision], N[(N[(t - a), $MachinePrecision] / b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.45 \cdot 10^{+80} \lor \neg \left(y \leq 2.9 \cdot 10^{-32}\right):\\
\;\;\;\;\frac{x}{1 - z}\\
\mathbf{else}:\\
\;\;\;\;\frac{t - a}{b}\\
\end{array}
\end{array}
if y < -1.44999999999999993e80 or 2.89999999999999996e-32 < y Initial program 45.2%
Taylor expanded in y around inf 57.8%
mul-1-neg57.8%
unsub-neg57.8%
Simplified57.8%
if -1.44999999999999993e80 < y < 2.89999999999999996e-32Initial program 79.8%
Taylor expanded in y around 0 54.8%
Final simplification56.1%
(FPCore (x y z t a b) :precision binary64 (if (<= y -6e+50) x (if (<= y 4.9e-32) (/ t b) x)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -6e+50) {
tmp = x;
} else if (y <= 4.9e-32) {
tmp = t / b;
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (y <= (-6d+50)) then
tmp = x
else if (y <= 4.9d-32) then
tmp = t / b
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -6e+50) {
tmp = x;
} else if (y <= 4.9e-32) {
tmp = t / b;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -6e+50: tmp = x elif y <= 4.9e-32: tmp = t / b else: tmp = x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -6e+50) tmp = x; elseif (y <= 4.9e-32) tmp = Float64(t / b); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= -6e+50) tmp = x; elseif (y <= 4.9e-32) tmp = t / b; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -6e+50], x, If[LessEqual[y, 4.9e-32], N[(t / b), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -6 \cdot 10^{+50}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 4.9 \cdot 10^{-32}:\\
\;\;\;\;\frac{t}{b}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if y < -5.9999999999999996e50 or 4.8999999999999998e-32 < y Initial program 45.5%
Taylor expanded in z around 0 41.9%
if -5.9999999999999996e50 < y < 4.8999999999999998e-32Initial program 81.0%
Taylor expanded in b around inf 52.2%
Taylor expanded in t around inf 33.1%
Final simplification37.1%
(FPCore (x y z t a b) :precision binary64 (if (<= z -1.15e-18) (/ (- a) b) (if (<= z 9.8e-138) x (/ t b))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -1.15e-18) {
tmp = -a / b;
} else if (z <= 9.8e-138) {
tmp = x;
} else {
tmp = t / b;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (z <= (-1.15d-18)) then
tmp = -a / b
else if (z <= 9.8d-138) then
tmp = x
else
tmp = t / b
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -1.15e-18) {
tmp = -a / b;
} else if (z <= 9.8e-138) {
tmp = x;
} else {
tmp = t / b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= -1.15e-18: tmp = -a / b elif z <= 9.8e-138: tmp = x else: tmp = t / b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -1.15e-18) tmp = Float64(Float64(-a) / b); elseif (z <= 9.8e-138) tmp = x; else tmp = Float64(t / b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (z <= -1.15e-18) tmp = -a / b; elseif (z <= 9.8e-138) tmp = x; else tmp = t / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -1.15e-18], N[((-a) / b), $MachinePrecision], If[LessEqual[z, 9.8e-138], x, N[(t / b), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.15 \cdot 10^{-18}:\\
\;\;\;\;\frac{-a}{b}\\
\mathbf{elif}\;z \leq 9.8 \cdot 10^{-138}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;\frac{t}{b}\\
\end{array}
\end{array}
if z < -1.15e-18Initial program 45.9%
Taylor expanded in a around inf 18.9%
mul-1-neg18.9%
distribute-lft-neg-out18.9%
*-commutative18.9%
Simplified18.9%
Taylor expanded in y around 0 29.8%
associate-*r/29.8%
neg-mul-129.8%
Simplified29.8%
if -1.15e-18 < z < 9.80000000000000033e-138Initial program 85.3%
Taylor expanded in z around 0 53.9%
if 9.80000000000000033e-138 < z Initial program 57.2%
Taylor expanded in b around inf 39.7%
Taylor expanded in t around inf 24.9%
Final simplification37.6%
(FPCore (x y z t a b) :precision binary64 x)
double code(double x, double y, double z, double t, double a, double b) {
return x;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = x
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return x;
}
def code(x, y, z, t, a, b): return x
function code(x, y, z, t, a, b) return x end
function tmp = code(x, y, z, t, a, b) tmp = x; end
code[x_, y_, z_, t_, a_, b_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 65.1%
Taylor expanded in z around 0 25.2%
Final simplification25.2%
(FPCore (x y z t a b) :precision binary64 (- (/ (+ (* z t) (* y x)) (+ y (* z (- b y)))) (/ a (+ (- b y) (/ y z)))))
double code(double x, double y, double z, double t, double a, double b) {
return (((z * t) + (y * x)) / (y + (z * (b - y)))) - (a / ((b - y) + (y / z)));
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = (((z * t) + (y * x)) / (y + (z * (b - y)))) - (a / ((b - y) + (y / z)))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return (((z * t) + (y * x)) / (y + (z * (b - y)))) - (a / ((b - y) + (y / z)));
}
def code(x, y, z, t, a, b): return (((z * t) + (y * x)) / (y + (z * (b - y)))) - (a / ((b - y) + (y / z)))
function code(x, y, z, t, a, b) return Float64(Float64(Float64(Float64(z * t) + Float64(y * x)) / Float64(y + Float64(z * Float64(b - y)))) - Float64(a / Float64(Float64(b - y) + Float64(y / z)))) end
function tmp = code(x, y, z, t, a, b) tmp = (((z * t) + (y * x)) / (y + (z * (b - y)))) - (a / ((b - y) + (y / z))); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(N[(z * t), $MachinePrecision] + N[(y * x), $MachinePrecision]), $MachinePrecision] / N[(y + N[(z * N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(a / N[(N[(b - y), $MachinePrecision] + N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{z \cdot t + y \cdot x}{y + z \cdot \left(b - y\right)} - \frac{a}{\left(b - y\right) + \frac{y}{z}}
\end{array}
herbie shell --seed 2024010
(FPCore (x y z t a b)
:name "Development.Shake.Progress:decay from shake-0.15.5"
:precision binary64
:herbie-target
(- (/ (+ (* z t) (* y x)) (+ y (* z (- b y)))) (/ a (+ (- b y) (/ y z))))
(/ (+ (* x y) (* z (- t a))) (+ y (* z (- b y)))))