
(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 (+ y (* z (- b y))))
(t_2
(+
(/ (- (/ x (/ (- b y) y)) (/ y (/ (pow (- b y) 2.0) (- t a)))) z)
(/ (- t a) (- b y))))
(t_3 (cbrt (/ z (/ t_1 (- t a)))))
(t_4 (* z (- t a)))
(t_5 (/ (+ (* x y) t_4) t_1))
(t_6 (+ x (* t_3 (* t_3 t_3)))))
(if (<= t_5 (- INFINITY))
t_6
(if (<= t_5 -1e-222)
(/ (fma x y t_4) (fma z (- b y) y))
(if (<= t_5 0.0)
t_2
(if (<= t_5 1e+303)
(/ (+ (* x y) (- (* z t) (* z a))) t_1)
(if (<= t_5 INFINITY) t_6 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 = (((x / ((b - y) / y)) - (y / (pow((b - y), 2.0) / (t - a)))) / z) + ((t - a) / (b - y));
double t_3 = cbrt((z / (t_1 / (t - a))));
double t_4 = z * (t - a);
double t_5 = ((x * y) + t_4) / t_1;
double t_6 = x + (t_3 * (t_3 * t_3));
double tmp;
if (t_5 <= -((double) INFINITY)) {
tmp = t_6;
} else if (t_5 <= -1e-222) {
tmp = fma(x, y, t_4) / fma(z, (b - y), y);
} else if (t_5 <= 0.0) {
tmp = t_2;
} else if (t_5 <= 1e+303) {
tmp = ((x * y) + ((z * t) - (z * a))) / t_1;
} else if (t_5 <= ((double) INFINITY)) {
tmp = t_6;
} 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(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))) t_3 = cbrt(Float64(z / Float64(t_1 / Float64(t - a)))) t_4 = Float64(z * Float64(t - a)) t_5 = Float64(Float64(Float64(x * y) + t_4) / t_1) t_6 = Float64(x + Float64(t_3 * Float64(t_3 * t_3))) tmp = 0.0 if (t_5 <= Float64(-Inf)) tmp = t_6; elseif (t_5 <= -1e-222) tmp = Float64(fma(x, y, t_4) / fma(z, Float64(b - y), y)); elseif (t_5 <= 0.0) tmp = t_2; elseif (t_5 <= 1e+303) tmp = Float64(Float64(Float64(x * y) + Float64(Float64(z * t) - Float64(z * a))) / t_1); elseif (t_5 <= Inf) tmp = t_6; else tmp = t_2; end return 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[(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]}, Block[{t$95$3 = N[Power[N[(z / N[(t$95$1 / N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision]}, Block[{t$95$4 = N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(N[(N[(x * y), $MachinePrecision] + t$95$4), $MachinePrecision] / t$95$1), $MachinePrecision]}, Block[{t$95$6 = N[(x + N[(t$95$3 * N[(t$95$3 * t$95$3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$5, (-Infinity)], t$95$6, If[LessEqual[t$95$5, -1e-222], N[(N[(x * y + t$95$4), $MachinePrecision] / N[(z * N[(b - y), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$5, 0.0], t$95$2, If[LessEqual[t$95$5, 1e+303], N[(N[(N[(x * y), $MachinePrecision] + N[(N[(z * t), $MachinePrecision] - N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision], If[LessEqual[t$95$5, Infinity], t$95$6, t$95$2]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y + z \cdot \left(b - y\right)\\
t_2 := \frac{\frac{x}{\frac{b - y}{y}} - \frac{y}{\frac{{\left(b - y\right)}^{2}}{t - a}}}{z} + \frac{t - a}{b - y}\\
t_3 := \sqrt[3]{\frac{z}{\frac{t_1}{t - a}}}\\
t_4 := z \cdot \left(t - a\right)\\
t_5 := \frac{x \cdot y + t_4}{t_1}\\
t_6 := x + t_3 \cdot \left(t_3 \cdot t_3\right)\\
\mathbf{if}\;t_5 \leq -\infty:\\
\;\;\;\;t_6\\
\mathbf{elif}\;t_5 \leq -1 \cdot 10^{-222}:\\
\;\;\;\;\frac{\mathsf{fma}\left(x, y, t_4\right)}{\mathsf{fma}\left(z, b - y, y\right)}\\
\mathbf{elif}\;t_5 \leq 0:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t_5 \leq 10^{+303}:\\
\;\;\;\;\frac{x \cdot y + \left(z \cdot t - z \cdot a\right)}{t_1}\\
\mathbf{elif}\;t_5 \leq \infty:\\
\;\;\;\;t_6\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < -inf.0 or 1e303 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < +inf.0Initial program 32.6%
Taylor expanded in x around 0 32.6%
add-cube-cbrt32.6%
associate-/l*32.6%
associate-/l*32.6%
associate-/l*67.5%
Applied egg-rr67.5%
Taylor expanded in z around 0 88.8%
if -inf.0 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < -1.00000000000000005e-222Initial program 99.1%
fma-def99.2%
+-commutative99.2%
fma-def99.2%
Simplified99.2%
if -1.00000000000000005e-222 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < 0.0 or +inf.0 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) Initial program 13.6%
Taylor expanded in z around -inf 63.6%
associate--l+63.6%
mul-1-neg63.6%
distribute-lft-out--63.6%
associate-/l*72.6%
associate-/l*98.6%
div-sub98.6%
Simplified98.6%
if 0.0 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < 1e303Initial program 99.7%
sub-neg99.7%
distribute-lft-in99.7%
Applied egg-rr99.7%
Final simplification97.1%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ y (* z (- b y))))
(t_2 (fma z (- b y) y))
(t_3
(+
(/ (- (/ x (/ (- b y) y)) (/ y (/ (pow (- b y) 2.0) (- t a)))) z)
(/ (- t a) (- b y))))
(t_4 (* z (- t a)))
(t_5 (/ (+ (* x y) t_4) t_1)))
(if (<= t_5 (- INFINITY))
(- (/ (- a t) y) (/ x (+ z -1.0)))
(if (<= t_5 -1e-222)
(/ (fma x y t_4) t_2)
(if (<= t_5 0.0)
t_3
(if (<= t_5 1e+303)
(/ (+ (* x y) (- (* z t) (* z a))) t_1)
(if (<= t_5 INFINITY) (/ z (/ t_2 (- t a))) t_3)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = y + (z * (b - y));
double t_2 = fma(z, (b - y), y);
double t_3 = (((x / ((b - y) / y)) - (y / (pow((b - y), 2.0) / (t - a)))) / z) + ((t - a) / (b - y));
double t_4 = z * (t - a);
double t_5 = ((x * y) + t_4) / t_1;
double tmp;
if (t_5 <= -((double) INFINITY)) {
tmp = ((a - t) / y) - (x / (z + -1.0));
} else if (t_5 <= -1e-222) {
tmp = fma(x, y, t_4) / t_2;
} else if (t_5 <= 0.0) {
tmp = t_3;
} else if (t_5 <= 1e+303) {
tmp = ((x * y) + ((z * t) - (z * a))) / t_1;
} else if (t_5 <= ((double) INFINITY)) {
tmp = z / (t_2 / (t - a));
} else {
tmp = t_3;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(y + Float64(z * Float64(b - y))) t_2 = fma(z, Float64(b - y), y) t_3 = 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))) t_4 = Float64(z * Float64(t - a)) t_5 = Float64(Float64(Float64(x * y) + t_4) / t_1) tmp = 0.0 if (t_5 <= Float64(-Inf)) tmp = Float64(Float64(Float64(a - t) / y) - Float64(x / Float64(z + -1.0))); elseif (t_5 <= -1e-222) tmp = Float64(fma(x, y, t_4) / t_2); elseif (t_5 <= 0.0) tmp = t_3; elseif (t_5 <= 1e+303) tmp = Float64(Float64(Float64(x * y) + Float64(Float64(z * t) - Float64(z * a))) / t_1); elseif (t_5 <= Inf) tmp = Float64(z / Float64(t_2 / Float64(t - a))); else tmp = t_3; end return 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[(z * N[(b - y), $MachinePrecision] + y), $MachinePrecision]}, Block[{t$95$3 = 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]}, Block[{t$95$4 = N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(N[(N[(x * y), $MachinePrecision] + t$95$4), $MachinePrecision] / t$95$1), $MachinePrecision]}, If[LessEqual[t$95$5, (-Infinity)], N[(N[(N[(a - t), $MachinePrecision] / y), $MachinePrecision] - N[(x / N[(z + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$5, -1e-222], N[(N[(x * y + t$95$4), $MachinePrecision] / t$95$2), $MachinePrecision], If[LessEqual[t$95$5, 0.0], t$95$3, If[LessEqual[t$95$5, 1e+303], N[(N[(N[(x * y), $MachinePrecision] + N[(N[(z * t), $MachinePrecision] - N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision], If[LessEqual[t$95$5, Infinity], N[(z / N[(t$95$2 / N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$3]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y + z \cdot \left(b - y\right)\\
t_2 := \mathsf{fma}\left(z, b - y, y\right)\\
t_3 := \frac{\frac{x}{\frac{b - y}{y}} - \frac{y}{\frac{{\left(b - y\right)}^{2}}{t - a}}}{z} + \frac{t - a}{b - y}\\
t_4 := z \cdot \left(t - a\right)\\
t_5 := \frac{x \cdot y + t_4}{t_1}\\
\mathbf{if}\;t_5 \leq -\infty:\\
\;\;\;\;\frac{a - t}{y} - \frac{x}{z + -1}\\
\mathbf{elif}\;t_5 \leq -1 \cdot 10^{-222}:\\
\;\;\;\;\frac{\mathsf{fma}\left(x, y, t_4\right)}{t_2}\\
\mathbf{elif}\;t_5 \leq 0:\\
\;\;\;\;t_3\\
\mathbf{elif}\;t_5 \leq 10^{+303}:\\
\;\;\;\;\frac{x \cdot y + \left(z \cdot t - z \cdot a\right)}{t_1}\\
\mathbf{elif}\;t_5 \leq \infty:\\
\;\;\;\;\frac{z}{\frac{t_2}{t - a}}\\
\mathbf{else}:\\
\;\;\;\;t_3\\
\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 27.8%
Taylor expanded in y around -inf 47.7%
distribute-lft-out47.7%
sub-neg47.7%
metadata-eval47.7%
Simplified47.7%
Taylor expanded in z around inf 73.4%
if -inf.0 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < -1.00000000000000005e-222Initial program 99.1%
fma-def99.2%
+-commutative99.2%
fma-def99.2%
Simplified99.2%
if -1.00000000000000005e-222 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < 0.0 or +inf.0 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) Initial program 13.6%
Taylor expanded in z around -inf 63.6%
associate--l+63.6%
mul-1-neg63.6%
distribute-lft-out--63.6%
associate-/l*72.6%
associate-/l*98.6%
div-sub98.6%
Simplified98.6%
if 0.0 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < 1e303Initial program 99.7%
sub-neg99.7%
distribute-lft-in99.7%
Applied egg-rr99.7%
if 1e303 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < +inf.0Initial program 36.4%
Taylor expanded in x around 0 35.1%
associate-/l*73.4%
+-commutative73.4%
fma-def73.4%
Simplified73.4%
Final simplification94.1%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ y (* z (- b y))))
(t_2
(+
(/ (- (/ x (/ (- b y) y)) (/ y (/ (pow (- b y) 2.0) (- t a)))) z)
(/ (- t a) (- b y))))
(t_3 (* z (- t a)))
(t_4 (/ (+ (* x y) t_3) t_1)))
(if (<= t_4 (- INFINITY))
(- (/ (- a t) y) (/ x (+ z -1.0)))
(if (<= t_4 -1e-222)
(+ (/ (* x y) t_1) (/ t_3 t_1))
(if (<= t_4 0.0)
t_2
(if (<= t_4 1e+303)
(/ (+ (* x y) (- (* z t) (* z a))) t_1)
(if (<= t_4 INFINITY) (/ z (/ (fma z (- b y) y) (- t a))) 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 = (((x / ((b - y) / y)) - (y / (pow((b - y), 2.0) / (t - a)))) / z) + ((t - a) / (b - y));
double t_3 = z * (t - a);
double t_4 = ((x * y) + t_3) / t_1;
double tmp;
if (t_4 <= -((double) INFINITY)) {
tmp = ((a - t) / y) - (x / (z + -1.0));
} else if (t_4 <= -1e-222) {
tmp = ((x * y) / t_1) + (t_3 / t_1);
} else if (t_4 <= 0.0) {
tmp = t_2;
} else if (t_4 <= 1e+303) {
tmp = ((x * y) + ((z * t) - (z * a))) / t_1;
} else if (t_4 <= ((double) INFINITY)) {
tmp = z / (fma(z, (b - y), y) / (t - a));
} 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(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))) t_3 = Float64(z * Float64(t - a)) t_4 = Float64(Float64(Float64(x * y) + t_3) / t_1) tmp = 0.0 if (t_4 <= Float64(-Inf)) tmp = Float64(Float64(Float64(a - t) / y) - Float64(x / Float64(z + -1.0))); elseif (t_4 <= -1e-222) tmp = Float64(Float64(Float64(x * y) / t_1) + Float64(t_3 / t_1)); elseif (t_4 <= 0.0) tmp = t_2; elseif (t_4 <= 1e+303) tmp = Float64(Float64(Float64(x * y) + Float64(Float64(z * t) - Float64(z * a))) / t_1); elseif (t_4 <= Inf) tmp = Float64(z / Float64(fma(z, Float64(b - y), y) / Float64(t - a))); else tmp = t_2; end return 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[(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]}, Block[{t$95$3 = N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[(N[(x * y), $MachinePrecision] + t$95$3), $MachinePrecision] / t$95$1), $MachinePrecision]}, If[LessEqual[t$95$4, (-Infinity)], N[(N[(N[(a - t), $MachinePrecision] / y), $MachinePrecision] - N[(x / N[(z + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$4, -1e-222], N[(N[(N[(x * y), $MachinePrecision] / t$95$1), $MachinePrecision] + N[(t$95$3 / t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$4, 0.0], t$95$2, If[LessEqual[t$95$4, 1e+303], N[(N[(N[(x * y), $MachinePrecision] + N[(N[(z * t), $MachinePrecision] - N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision], If[LessEqual[t$95$4, Infinity], N[(z / N[(N[(z * N[(b - y), $MachinePrecision] + y), $MachinePrecision] / N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y + z \cdot \left(b - y\right)\\
t_2 := \frac{\frac{x}{\frac{b - y}{y}} - \frac{y}{\frac{{\left(b - y\right)}^{2}}{t - a}}}{z} + \frac{t - a}{b - y}\\
t_3 := z \cdot \left(t - a\right)\\
t_4 := \frac{x \cdot y + t_3}{t_1}\\
\mathbf{if}\;t_4 \leq -\infty:\\
\;\;\;\;\frac{a - t}{y} - \frac{x}{z + -1}\\
\mathbf{elif}\;t_4 \leq -1 \cdot 10^{-222}:\\
\;\;\;\;\frac{x \cdot y}{t_1} + \frac{t_3}{t_1}\\
\mathbf{elif}\;t_4 \leq 0:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t_4 \leq 10^{+303}:\\
\;\;\;\;\frac{x \cdot y + \left(z \cdot t - z \cdot a\right)}{t_1}\\
\mathbf{elif}\;t_4 \leq \infty:\\
\;\;\;\;\frac{z}{\frac{\mathsf{fma}\left(z, b - y, y\right)}{t - a}}\\
\mathbf{else}:\\
\;\;\;\;t_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 27.8%
Taylor expanded in y around -inf 47.7%
distribute-lft-out47.7%
sub-neg47.7%
metadata-eval47.7%
Simplified47.7%
Taylor expanded in z around inf 73.4%
if -inf.0 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < -1.00000000000000005e-222Initial program 99.1%
Taylor expanded in x around 0 99.2%
if -1.00000000000000005e-222 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < 0.0 or +inf.0 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) Initial program 13.6%
Taylor expanded in z around -inf 63.6%
associate--l+63.6%
mul-1-neg63.6%
distribute-lft-out--63.6%
associate-/l*72.6%
associate-/l*98.6%
div-sub98.6%
Simplified98.6%
if 0.0 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < 1e303Initial program 99.7%
sub-neg99.7%
distribute-lft-in99.7%
Applied egg-rr99.7%
if 1e303 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < +inf.0Initial program 36.4%
Taylor expanded in x around 0 35.1%
associate-/l*73.4%
+-commutative73.4%
fma-def73.4%
Simplified73.4%
Final simplification94.1%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ y (* z (- b y))))
(t_2 (* z (- t a)))
(t_3 (/ (- t a) (- b y)))
(t_4 (/ t_2 t_1)))
(if (<= z -3e+54)
t_3
(if (<= z 9.4e-291)
(+ (/ (* x y) t_1) t_4)
(if (<= z 1.18e-101)
(+ x t_4)
(if (<= z 4.6e+33) (/ (+ (* x y) t_2) t_1) t_3))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = y + (z * (b - y));
double t_2 = z * (t - a);
double t_3 = (t - a) / (b - y);
double t_4 = t_2 / t_1;
double tmp;
if (z <= -3e+54) {
tmp = t_3;
} else if (z <= 9.4e-291) {
tmp = ((x * y) / t_1) + t_4;
} else if (z <= 1.18e-101) {
tmp = x + t_4;
} else if (z <= 4.6e+33) {
tmp = ((x * y) + t_2) / t_1;
} else {
tmp = t_3;
}
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) :: t_3
real(8) :: t_4
real(8) :: tmp
t_1 = y + (z * (b - y))
t_2 = z * (t - a)
t_3 = (t - a) / (b - y)
t_4 = t_2 / t_1
if (z <= (-3d+54)) then
tmp = t_3
else if (z <= 9.4d-291) then
tmp = ((x * y) / t_1) + t_4
else if (z <= 1.18d-101) then
tmp = x + t_4
else if (z <= 4.6d+33) then
tmp = ((x * y) + t_2) / t_1
else
tmp = t_3
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 = z * (t - a);
double t_3 = (t - a) / (b - y);
double t_4 = t_2 / t_1;
double tmp;
if (z <= -3e+54) {
tmp = t_3;
} else if (z <= 9.4e-291) {
tmp = ((x * y) / t_1) + t_4;
} else if (z <= 1.18e-101) {
tmp = x + t_4;
} else if (z <= 4.6e+33) {
tmp = ((x * y) + t_2) / t_1;
} else {
tmp = t_3;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = y + (z * (b - y)) t_2 = z * (t - a) t_3 = (t - a) / (b - y) t_4 = t_2 / t_1 tmp = 0 if z <= -3e+54: tmp = t_3 elif z <= 9.4e-291: tmp = ((x * y) / t_1) + t_4 elif z <= 1.18e-101: tmp = x + t_4 elif z <= 4.6e+33: tmp = ((x * y) + t_2) / t_1 else: tmp = t_3 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(y + Float64(z * Float64(b - y))) t_2 = Float64(z * Float64(t - a)) t_3 = Float64(Float64(t - a) / Float64(b - y)) t_4 = Float64(t_2 / t_1) tmp = 0.0 if (z <= -3e+54) tmp = t_3; elseif (z <= 9.4e-291) tmp = Float64(Float64(Float64(x * y) / t_1) + t_4); elseif (z <= 1.18e-101) tmp = Float64(x + t_4); elseif (z <= 4.6e+33) tmp = Float64(Float64(Float64(x * y) + t_2) / t_1); else tmp = t_3; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = y + (z * (b - y)); t_2 = z * (t - a); t_3 = (t - a) / (b - y); t_4 = t_2 / t_1; tmp = 0.0; if (z <= -3e+54) tmp = t_3; elseif (z <= 9.4e-291) tmp = ((x * y) / t_1) + t_4; elseif (z <= 1.18e-101) tmp = x + t_4; elseif (z <= 4.6e+33) tmp = ((x * y) + t_2) / t_1; else tmp = t_3; 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[(z * N[(t - a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(t$95$2 / t$95$1), $MachinePrecision]}, If[LessEqual[z, -3e+54], t$95$3, If[LessEqual[z, 9.4e-291], N[(N[(N[(x * y), $MachinePrecision] / t$95$1), $MachinePrecision] + t$95$4), $MachinePrecision], If[LessEqual[z, 1.18e-101], N[(x + t$95$4), $MachinePrecision], If[LessEqual[z, 4.6e+33], N[(N[(N[(x * y), $MachinePrecision] + t$95$2), $MachinePrecision] / t$95$1), $MachinePrecision], t$95$3]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y + z \cdot \left(b - y\right)\\
t_2 := z \cdot \left(t - a\right)\\
t_3 := \frac{t - a}{b - y}\\
t_4 := \frac{t_2}{t_1}\\
\mathbf{if}\;z \leq -3 \cdot 10^{+54}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;z \leq 9.4 \cdot 10^{-291}:\\
\;\;\;\;\frac{x \cdot y}{t_1} + t_4\\
\mathbf{elif}\;z \leq 1.18 \cdot 10^{-101}:\\
\;\;\;\;x + t_4\\
\mathbf{elif}\;z \leq 4.6 \cdot 10^{+33}:\\
\;\;\;\;\frac{x \cdot y + t_2}{t_1}\\
\mathbf{else}:\\
\;\;\;\;t_3\\
\end{array}
\end{array}
if z < -2.9999999999999999e54 or 4.60000000000000021e33 < z Initial program 36.8%
Taylor expanded in z around inf 83.7%
if -2.9999999999999999e54 < z < 9.3999999999999997e-291Initial program 91.7%
Taylor expanded in x around 0 91.8%
if 9.3999999999999997e-291 < z < 1.1800000000000001e-101Initial program 79.1%
Taylor expanded in x around 0 79.1%
Taylor expanded in z around 0 93.1%
if 1.1800000000000001e-101 < z < 4.60000000000000021e33Initial program 90.0%
Final simplification88.1%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* z (- t a)))
(t_2 (/ (+ (* x y) t_1) (+ y (* z b))))
(t_3 (/ (- t a) (- b y))))
(if (<= z -4.2)
t_3
(if (<= z 6.1e-291)
t_2
(if (<= z 3e-101)
(+ x (/ t_1 (+ y (* z (- b y)))))
(if (<= z 27.5)
t_2
(if (or (<= z 7.9e+65) (not (<= z 3.3e+121)))
t_3
(/ (+ t (- (/ 1.0 (/ (/ z y) x)) a)) b))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = z * (t - a);
double t_2 = ((x * y) + t_1) / (y + (z * b));
double t_3 = (t - a) / (b - y);
double tmp;
if (z <= -4.2) {
tmp = t_3;
} else if (z <= 6.1e-291) {
tmp = t_2;
} else if (z <= 3e-101) {
tmp = x + (t_1 / (y + (z * (b - y))));
} else if (z <= 27.5) {
tmp = t_2;
} else if ((z <= 7.9e+65) || !(z <= 3.3e+121)) {
tmp = t_3;
} else {
tmp = (t + ((1.0 / ((z / y) / x)) - 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) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = z * (t - a)
t_2 = ((x * y) + t_1) / (y + (z * b))
t_3 = (t - a) / (b - y)
if (z <= (-4.2d0)) then
tmp = t_3
else if (z <= 6.1d-291) then
tmp = t_2
else if (z <= 3d-101) then
tmp = x + (t_1 / (y + (z * (b - y))))
else if (z <= 27.5d0) then
tmp = t_2
else if ((z <= 7.9d+65) .or. (.not. (z <= 3.3d+121))) then
tmp = t_3
else
tmp = (t + ((1.0d0 / ((z / y) / x)) - 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 t_1 = z * (t - a);
double t_2 = ((x * y) + t_1) / (y + (z * b));
double t_3 = (t - a) / (b - y);
double tmp;
if (z <= -4.2) {
tmp = t_3;
} else if (z <= 6.1e-291) {
tmp = t_2;
} else if (z <= 3e-101) {
tmp = x + (t_1 / (y + (z * (b - y))));
} else if (z <= 27.5) {
tmp = t_2;
} else if ((z <= 7.9e+65) || !(z <= 3.3e+121)) {
tmp = t_3;
} else {
tmp = (t + ((1.0 / ((z / y) / x)) - a)) / b;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = z * (t - a) t_2 = ((x * y) + t_1) / (y + (z * b)) t_3 = (t - a) / (b - y) tmp = 0 if z <= -4.2: tmp = t_3 elif z <= 6.1e-291: tmp = t_2 elif z <= 3e-101: tmp = x + (t_1 / (y + (z * (b - y)))) elif z <= 27.5: tmp = t_2 elif (z <= 7.9e+65) or not (z <= 3.3e+121): tmp = t_3 else: tmp = (t + ((1.0 / ((z / y) / x)) - a)) / b return tmp
function code(x, y, z, t, a, b) t_1 = Float64(z * Float64(t - a)) t_2 = Float64(Float64(Float64(x * y) + t_1) / Float64(y + Float64(z * b))) t_3 = Float64(Float64(t - a) / Float64(b - y)) tmp = 0.0 if (z <= -4.2) tmp = t_3; elseif (z <= 6.1e-291) tmp = t_2; elseif (z <= 3e-101) tmp = Float64(x + Float64(t_1 / Float64(y + Float64(z * Float64(b - y))))); elseif (z <= 27.5) tmp = t_2; elseif ((z <= 7.9e+65) || !(z <= 3.3e+121)) tmp = t_3; else tmp = Float64(Float64(t + Float64(Float64(1.0 / Float64(Float64(z / y) / x)) - a)) / b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = z * (t - a); t_2 = ((x * y) + t_1) / (y + (z * b)); t_3 = (t - a) / (b - y); tmp = 0.0; if (z <= -4.2) tmp = t_3; elseif (z <= 6.1e-291) tmp = t_2; elseif (z <= 3e-101) tmp = x + (t_1 / (y + (z * (b - y)))); elseif (z <= 27.5) tmp = t_2; elseif ((z <= 7.9e+65) || ~((z <= 3.3e+121))) tmp = t_3; else tmp = (t + ((1.0 / ((z / y) / x)) - a)) / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(x * y), $MachinePrecision] + t$95$1), $MachinePrecision] / N[(y + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -4.2], t$95$3, If[LessEqual[z, 6.1e-291], t$95$2, If[LessEqual[z, 3e-101], N[(x + N[(t$95$1 / N[(y + N[(z * N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 27.5], t$95$2, If[Or[LessEqual[z, 7.9e+65], N[Not[LessEqual[z, 3.3e+121]], $MachinePrecision]], t$95$3, N[(N[(t + N[(N[(1.0 / N[(N[(z / y), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] - a), $MachinePrecision]), $MachinePrecision] / b), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \left(t - a\right)\\
t_2 := \frac{x \cdot y + t_1}{y + z \cdot b}\\
t_3 := \frac{t - a}{b - y}\\
\mathbf{if}\;z \leq -4.2:\\
\;\;\;\;t_3\\
\mathbf{elif}\;z \leq 6.1 \cdot 10^{-291}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq 3 \cdot 10^{-101}:\\
\;\;\;\;x + \frac{t_1}{y + z \cdot \left(b - y\right)}\\
\mathbf{elif}\;z \leq 27.5:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq 7.9 \cdot 10^{+65} \lor \neg \left(z \leq 3.3 \cdot 10^{+121}\right):\\
\;\;\;\;t_3\\
\mathbf{else}:\\
\;\;\;\;\frac{t + \left(\frac{1}{\frac{\frac{z}{y}}{x}} - a\right)}{b}\\
\end{array}
\end{array}
if z < -4.20000000000000018 or 27.5 < z < 7.8999999999999998e65 or 3.29999999999999979e121 < z Initial program 41.5%
Taylor expanded in z around inf 83.2%
if -4.20000000000000018 < z < 6.1e-291 or 3.0000000000000003e-101 < z < 27.5Initial program 92.1%
Taylor expanded in b around inf 89.7%
*-commutative89.7%
Simplified89.7%
if 6.1e-291 < z < 3.0000000000000003e-101Initial program 79.1%
Taylor expanded in x around 0 79.1%
Taylor expanded in z around 0 93.1%
if 7.8999999999999998e65 < z < 3.29999999999999979e121Initial program 46.9%
Taylor expanded in x around 0 46.9%
Taylor expanded in b around inf 70.2%
associate--l+70.2%
associate-/l*78.7%
Simplified78.7%
clear-num78.8%
inv-pow78.8%
Applied egg-rr78.8%
unpow-178.8%
Simplified78.8%
Final simplification86.7%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* z (- t a)))
(t_2 (+ y (* z (- b y))))
(t_3 (/ (+ (* x y) t_1) t_2))
(t_4 (/ (- t a) (- b y))))
(if (<= z -3.4e+55)
t_4
(if (<= z 1.4e-290)
t_3
(if (<= z 1.18e-101) (+ x (/ t_1 t_2)) (if (<= z 7.5e+33) t_3 t_4))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = z * (t - a);
double t_2 = y + (z * (b - y));
double t_3 = ((x * y) + t_1) / t_2;
double t_4 = (t - a) / (b - y);
double tmp;
if (z <= -3.4e+55) {
tmp = t_4;
} else if (z <= 1.4e-290) {
tmp = t_3;
} else if (z <= 1.18e-101) {
tmp = x + (t_1 / t_2);
} else if (z <= 7.5e+33) {
tmp = t_3;
} else {
tmp = t_4;
}
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) :: t_3
real(8) :: t_4
real(8) :: tmp
t_1 = z * (t - a)
t_2 = y + (z * (b - y))
t_3 = ((x * y) + t_1) / t_2
t_4 = (t - a) / (b - y)
if (z <= (-3.4d+55)) then
tmp = t_4
else if (z <= 1.4d-290) then
tmp = t_3
else if (z <= 1.18d-101) then
tmp = x + (t_1 / t_2)
else if (z <= 7.5d+33) then
tmp = t_3
else
tmp = t_4
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 = z * (t - a);
double t_2 = y + (z * (b - y));
double t_3 = ((x * y) + t_1) / t_2;
double t_4 = (t - a) / (b - y);
double tmp;
if (z <= -3.4e+55) {
tmp = t_4;
} else if (z <= 1.4e-290) {
tmp = t_3;
} else if (z <= 1.18e-101) {
tmp = x + (t_1 / t_2);
} else if (z <= 7.5e+33) {
tmp = t_3;
} else {
tmp = t_4;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = z * (t - a) t_2 = y + (z * (b - y)) t_3 = ((x * y) + t_1) / t_2 t_4 = (t - a) / (b - y) tmp = 0 if z <= -3.4e+55: tmp = t_4 elif z <= 1.4e-290: tmp = t_3 elif z <= 1.18e-101: tmp = x + (t_1 / t_2) elif z <= 7.5e+33: tmp = t_3 else: tmp = t_4 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(z * Float64(t - a)) t_2 = Float64(y + Float64(z * Float64(b - y))) t_3 = Float64(Float64(Float64(x * y) + t_1) / t_2) t_4 = Float64(Float64(t - a) / Float64(b - y)) tmp = 0.0 if (z <= -3.4e+55) tmp = t_4; elseif (z <= 1.4e-290) tmp = t_3; elseif (z <= 1.18e-101) tmp = Float64(x + Float64(t_1 / t_2)); elseif (z <= 7.5e+33) tmp = t_3; else tmp = t_4; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = z * (t - a); t_2 = y + (z * (b - y)); t_3 = ((x * y) + t_1) / t_2; t_4 = (t - a) / (b - y); tmp = 0.0; if (z <= -3.4e+55) tmp = t_4; elseif (z <= 1.4e-290) tmp = t_3; elseif (z <= 1.18e-101) tmp = x + (t_1 / t_2); elseif (z <= 7.5e+33) tmp = t_3; else tmp = t_4; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(y + N[(z * N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(x * y), $MachinePrecision] + t$95$1), $MachinePrecision] / t$95$2), $MachinePrecision]}, Block[{t$95$4 = N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -3.4e+55], t$95$4, If[LessEqual[z, 1.4e-290], t$95$3, If[LessEqual[z, 1.18e-101], N[(x + N[(t$95$1 / t$95$2), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 7.5e+33], t$95$3, t$95$4]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \left(t - a\right)\\
t_2 := y + z \cdot \left(b - y\right)\\
t_3 := \frac{x \cdot y + t_1}{t_2}\\
t_4 := \frac{t - a}{b - y}\\
\mathbf{if}\;z \leq -3.4 \cdot 10^{+55}:\\
\;\;\;\;t_4\\
\mathbf{elif}\;z \leq 1.4 \cdot 10^{-290}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;z \leq 1.18 \cdot 10^{-101}:\\
\;\;\;\;x + \frac{t_1}{t_2}\\
\mathbf{elif}\;z \leq 7.5 \cdot 10^{+33}:\\
\;\;\;\;t_3\\
\mathbf{else}:\\
\;\;\;\;t_4\\
\end{array}
\end{array}
if z < -3.3999999999999998e55 or 7.50000000000000046e33 < z Initial program 36.8%
Taylor expanded in z around inf 83.7%
if -3.3999999999999998e55 < z < 1.39999999999999998e-290 or 1.1800000000000001e-101 < z < 7.50000000000000046e33Initial program 91.2%
if 1.39999999999999998e-290 < z < 1.1800000000000001e-101Initial program 79.1%
Taylor expanded in x around 0 79.1%
Taylor expanded in z around 0 93.1%
Final simplification88.1%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ x (/ (* z t) y)))
(t_2 (/ (- t a) (- b y)))
(t_3 (/ (+ t (- (/ x (/ z y)) a)) b)))
(if (<= z -1.65e-24)
t_2
(if (<= z 1.12e-100)
t_1
(if (<= z 1.7e-32)
t_3
(if (<= z 1.8e-21)
t_1
(if (or (<= z 8e+65) (not (<= z 3.3e+121))) t_2 t_3)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x + ((z * t) / y);
double t_2 = (t - a) / (b - y);
double t_3 = (t + ((x / (z / y)) - a)) / b;
double tmp;
if (z <= -1.65e-24) {
tmp = t_2;
} else if (z <= 1.12e-100) {
tmp = t_1;
} else if (z <= 1.7e-32) {
tmp = t_3;
} else if (z <= 1.8e-21) {
tmp = t_1;
} else if ((z <= 8e+65) || !(z <= 3.3e+121)) {
tmp = t_2;
} else {
tmp = t_3;
}
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) :: t_3
real(8) :: tmp
t_1 = x + ((z * t) / y)
t_2 = (t - a) / (b - y)
t_3 = (t + ((x / (z / y)) - a)) / b
if (z <= (-1.65d-24)) then
tmp = t_2
else if (z <= 1.12d-100) then
tmp = t_1
else if (z <= 1.7d-32) then
tmp = t_3
else if (z <= 1.8d-21) then
tmp = t_1
else if ((z <= 8d+65) .or. (.not. (z <= 3.3d+121))) then
tmp = t_2
else
tmp = t_3
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 + ((z * t) / y);
double t_2 = (t - a) / (b - y);
double t_3 = (t + ((x / (z / y)) - a)) / b;
double tmp;
if (z <= -1.65e-24) {
tmp = t_2;
} else if (z <= 1.12e-100) {
tmp = t_1;
} else if (z <= 1.7e-32) {
tmp = t_3;
} else if (z <= 1.8e-21) {
tmp = t_1;
} else if ((z <= 8e+65) || !(z <= 3.3e+121)) {
tmp = t_2;
} else {
tmp = t_3;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x + ((z * t) / y) t_2 = (t - a) / (b - y) t_3 = (t + ((x / (z / y)) - a)) / b tmp = 0 if z <= -1.65e-24: tmp = t_2 elif z <= 1.12e-100: tmp = t_1 elif z <= 1.7e-32: tmp = t_3 elif z <= 1.8e-21: tmp = t_1 elif (z <= 8e+65) or not (z <= 3.3e+121): tmp = t_2 else: tmp = t_3 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x + Float64(Float64(z * t) / y)) t_2 = Float64(Float64(t - a) / Float64(b - y)) t_3 = Float64(Float64(t + Float64(Float64(x / Float64(z / y)) - a)) / b) tmp = 0.0 if (z <= -1.65e-24) tmp = t_2; elseif (z <= 1.12e-100) tmp = t_1; elseif (z <= 1.7e-32) tmp = t_3; elseif (z <= 1.8e-21) tmp = t_1; elseif ((z <= 8e+65) || !(z <= 3.3e+121)) tmp = t_2; else tmp = t_3; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x + ((z * t) / y); t_2 = (t - a) / (b - y); t_3 = (t + ((x / (z / y)) - a)) / b; tmp = 0.0; if (z <= -1.65e-24) tmp = t_2; elseif (z <= 1.12e-100) tmp = t_1; elseif (z <= 1.7e-32) tmp = t_3; elseif (z <= 1.8e-21) tmp = t_1; elseif ((z <= 8e+65) || ~((z <= 3.3e+121))) tmp = t_2; else tmp = t_3; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x + N[(N[(z * t), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(t + N[(N[(x / N[(z / y), $MachinePrecision]), $MachinePrecision] - a), $MachinePrecision]), $MachinePrecision] / b), $MachinePrecision]}, If[LessEqual[z, -1.65e-24], t$95$2, If[LessEqual[z, 1.12e-100], t$95$1, If[LessEqual[z, 1.7e-32], t$95$3, If[LessEqual[z, 1.8e-21], t$95$1, If[Or[LessEqual[z, 8e+65], N[Not[LessEqual[z, 3.3e+121]], $MachinePrecision]], t$95$2, t$95$3]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \frac{z \cdot t}{y}\\
t_2 := \frac{t - a}{b - y}\\
t_3 := \frac{t + \left(\frac{x}{\frac{z}{y}} - a\right)}{b}\\
\mathbf{if}\;z \leq -1.65 \cdot 10^{-24}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq 1.12 \cdot 10^{-100}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 1.7 \cdot 10^{-32}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;z \leq 1.8 \cdot 10^{-21}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 8 \cdot 10^{+65} \lor \neg \left(z \leq 3.3 \cdot 10^{+121}\right):\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;t_3\\
\end{array}
\end{array}
if z < -1.64999999999999992e-24 or 1.79999999999999995e-21 < z < 7.9999999999999999e65 or 3.29999999999999979e121 < z Initial program 46.9%
Taylor expanded in z around inf 80.1%
if -1.64999999999999992e-24 < z < 1.11999999999999996e-100 or 1.69999999999999989e-32 < z < 1.79999999999999995e-21Initial program 86.5%
Taylor expanded in x around 0 86.5%
Taylor expanded in z around 0 51.7%
associate--r+51.7%
div-sub51.7%
associate-/l*63.1%
Simplified63.1%
Taylor expanded in t around inf 66.4%
if 1.11999999999999996e-100 < z < 1.69999999999999989e-32 or 7.9999999999999999e65 < z < 3.29999999999999979e121Initial program 67.6%
Taylor expanded in x around 0 67.6%
Taylor expanded in b around inf 63.3%
associate--l+63.3%
associate-/l*67.3%
Simplified67.3%
Final simplification73.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (- (/ (- a t) y) (/ x (+ z -1.0)))))
(if (<= y -1.4e+31)
t_1
(if (<= y 3.4e-57)
(/ (+ t (- (/ x (/ z y)) a)) b)
(if (<= y 4500000000000.0)
(/ (* x y) (+ y (* z (- b y))))
(if (<= y 1.05e+28) (/ (- t a) (- b y)) t_1))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((a - t) / y) - (x / (z + -1.0));
double tmp;
if (y <= -1.4e+31) {
tmp = t_1;
} else if (y <= 3.4e-57) {
tmp = (t + ((x / (z / y)) - a)) / b;
} else if (y <= 4500000000000.0) {
tmp = (x * y) / (y + (z * (b - y)));
} else if (y <= 1.05e+28) {
tmp = (t - a) / (b - y);
} 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 = ((a - t) / y) - (x / (z + (-1.0d0)))
if (y <= (-1.4d+31)) then
tmp = t_1
else if (y <= 3.4d-57) then
tmp = (t + ((x / (z / y)) - a)) / b
else if (y <= 4500000000000.0d0) then
tmp = (x * y) / (y + (z * (b - y)))
else if (y <= 1.05d+28) then
tmp = (t - a) / (b - y)
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 = ((a - t) / y) - (x / (z + -1.0));
double tmp;
if (y <= -1.4e+31) {
tmp = t_1;
} else if (y <= 3.4e-57) {
tmp = (t + ((x / (z / y)) - a)) / b;
} else if (y <= 4500000000000.0) {
tmp = (x * y) / (y + (z * (b - y)));
} else if (y <= 1.05e+28) {
tmp = (t - a) / (b - y);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = ((a - t) / y) - (x / (z + -1.0)) tmp = 0 if y <= -1.4e+31: tmp = t_1 elif y <= 3.4e-57: tmp = (t + ((x / (z / y)) - a)) / b elif y <= 4500000000000.0: tmp = (x * y) / (y + (z * (b - y))) elif y <= 1.05e+28: tmp = (t - a) / (b - y) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(a - t) / y) - Float64(x / Float64(z + -1.0))) tmp = 0.0 if (y <= -1.4e+31) tmp = t_1; elseif (y <= 3.4e-57) tmp = Float64(Float64(t + Float64(Float64(x / Float64(z / y)) - a)) / b); elseif (y <= 4500000000000.0) tmp = Float64(Float64(x * y) / Float64(y + Float64(z * Float64(b - y)))); elseif (y <= 1.05e+28) tmp = Float64(Float64(t - a) / Float64(b - y)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = ((a - t) / y) - (x / (z + -1.0)); tmp = 0.0; if (y <= -1.4e+31) tmp = t_1; elseif (y <= 3.4e-57) tmp = (t + ((x / (z / y)) - a)) / b; elseif (y <= 4500000000000.0) tmp = (x * y) / (y + (z * (b - y))); elseif (y <= 1.05e+28) tmp = (t - a) / (b - y); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(a - t), $MachinePrecision] / y), $MachinePrecision] - N[(x / N[(z + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.4e+31], t$95$1, If[LessEqual[y, 3.4e-57], N[(N[(t + N[(N[(x / N[(z / y), $MachinePrecision]), $MachinePrecision] - a), $MachinePrecision]), $MachinePrecision] / b), $MachinePrecision], If[LessEqual[y, 4500000000000.0], N[(N[(x * y), $MachinePrecision] / N[(y + N[(z * N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.05e+28], N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{a - t}{y} - \frac{x}{z + -1}\\
\mathbf{if}\;y \leq -1.4 \cdot 10^{+31}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 3.4 \cdot 10^{-57}:\\
\;\;\;\;\frac{t + \left(\frac{x}{\frac{z}{y}} - a\right)}{b}\\
\mathbf{elif}\;y \leq 4500000000000:\\
\;\;\;\;\frac{x \cdot y}{y + z \cdot \left(b - y\right)}\\
\mathbf{elif}\;y \leq 1.05 \cdot 10^{+28}:\\
\;\;\;\;\frac{t - a}{b - y}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if y < -1.40000000000000008e31 or 1.04999999999999995e28 < y Initial program 48.8%
Taylor expanded in y around -inf 59.6%
distribute-lft-out59.6%
sub-neg59.6%
metadata-eval59.6%
Simplified60.9%
Taylor expanded in z around inf 67.5%
if -1.40000000000000008e31 < y < 3.40000000000000016e-57Initial program 77.4%
Taylor expanded in x around 0 77.5%
Taylor expanded in b around inf 73.6%
associate--l+73.6%
associate-/l*74.4%
Simplified74.4%
if 3.40000000000000016e-57 < y < 4.5e12Initial program 88.3%
Taylor expanded in x around inf 74.5%
*-commutative74.5%
Simplified74.5%
if 4.5e12 < y < 1.04999999999999995e28Initial program 23.4%
Taylor expanded in z around inf 80.6%
Final simplification71.5%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -880.0) (not (<= z 1.2e+14))) (/ (- t a) (- b y)) (+ x (/ (* z (- t a)) (+ y (* z (- b y)))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -880.0) || !(z <= 1.2e+14)) {
tmp = (t - a) / (b - y);
} else {
tmp = x + ((z * (t - 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 <= (-880.0d0)) .or. (.not. (z <= 1.2d+14))) then
tmp = (t - a) / (b - y)
else
tmp = x + ((z * (t - 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 <= -880.0) || !(z <= 1.2e+14)) {
tmp = (t - a) / (b - y);
} else {
tmp = x + ((z * (t - a)) / (y + (z * (b - y))));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -880.0) or not (z <= 1.2e+14): tmp = (t - a) / (b - y) else: tmp = x + ((z * (t - a)) / (y + (z * (b - y)))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -880.0) || !(z <= 1.2e+14)) tmp = Float64(Float64(t - a) / Float64(b - y)); else tmp = Float64(x + Float64(Float64(z * Float64(t - 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 <= -880.0) || ~((z <= 1.2e+14))) tmp = (t - a) / (b - y); else tmp = x + ((z * (t - a)) / (y + (z * (b - y)))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -880.0], N[Not[LessEqual[z, 1.2e+14]], $MachinePrecision]], N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision] / N[(y + N[(z * N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -880 \lor \neg \left(z \leq 1.2 \cdot 10^{+14}\right):\\
\;\;\;\;\frac{t - a}{b - y}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)}\\
\end{array}
\end{array}
if z < -880 or 1.2e14 < z Initial program 40.7%
Taylor expanded in z around inf 80.5%
if -880 < z < 1.2e14Initial program 88.0%
Taylor expanded in x around 0 88.0%
Taylor expanded in z around 0 78.6%
Final simplification79.5%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (- a) b)) (t_2 (/ x (- 1.0 z))))
(if (<= y -3.5e-52)
t_2
(if (<= y -9e-262)
(/ t b)
(if (<= y 2.5e-284)
t_1
(if (<= y 8.8e-242) (/ t b) (if (<= y 1.35e-52) t_1 t_2)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = -a / b;
double t_2 = x / (1.0 - z);
double tmp;
if (y <= -3.5e-52) {
tmp = t_2;
} else if (y <= -9e-262) {
tmp = t / b;
} else if (y <= 2.5e-284) {
tmp = t_1;
} else if (y <= 8.8e-242) {
tmp = t / b;
} else if (y <= 1.35e-52) {
tmp = t_1;
} 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 = -a / b
t_2 = x / (1.0d0 - z)
if (y <= (-3.5d-52)) then
tmp = t_2
else if (y <= (-9d-262)) then
tmp = t / b
else if (y <= 2.5d-284) then
tmp = t_1
else if (y <= 8.8d-242) then
tmp = t / b
else if (y <= 1.35d-52) then
tmp = t_1
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 = -a / b;
double t_2 = x / (1.0 - z);
double tmp;
if (y <= -3.5e-52) {
tmp = t_2;
} else if (y <= -9e-262) {
tmp = t / b;
} else if (y <= 2.5e-284) {
tmp = t_1;
} else if (y <= 8.8e-242) {
tmp = t / b;
} else if (y <= 1.35e-52) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = -a / b t_2 = x / (1.0 - z) tmp = 0 if y <= -3.5e-52: tmp = t_2 elif y <= -9e-262: tmp = t / b elif y <= 2.5e-284: tmp = t_1 elif y <= 8.8e-242: tmp = t / b elif y <= 1.35e-52: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(-a) / b) t_2 = Float64(x / Float64(1.0 - z)) tmp = 0.0 if (y <= -3.5e-52) tmp = t_2; elseif (y <= -9e-262) tmp = Float64(t / b); elseif (y <= 2.5e-284) tmp = t_1; elseif (y <= 8.8e-242) tmp = Float64(t / b); elseif (y <= 1.35e-52) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = -a / b; t_2 = x / (1.0 - z); tmp = 0.0; if (y <= -3.5e-52) tmp = t_2; elseif (y <= -9e-262) tmp = t / b; elseif (y <= 2.5e-284) tmp = t_1; elseif (y <= 8.8e-242) tmp = t / b; elseif (y <= 1.35e-52) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[((-a) / b), $MachinePrecision]}, Block[{t$95$2 = N[(x / N[(1.0 - z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -3.5e-52], t$95$2, If[LessEqual[y, -9e-262], N[(t / b), $MachinePrecision], If[LessEqual[y, 2.5e-284], t$95$1, If[LessEqual[y, 8.8e-242], N[(t / b), $MachinePrecision], If[LessEqual[y, 1.35e-52], t$95$1, t$95$2]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{-a}{b}\\
t_2 := \frac{x}{1 - z}\\
\mathbf{if}\;y \leq -3.5 \cdot 10^{-52}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq -9 \cdot 10^{-262}:\\
\;\;\;\;\frac{t}{b}\\
\mathbf{elif}\;y \leq 2.5 \cdot 10^{-284}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 8.8 \cdot 10^{-242}:\\
\;\;\;\;\frac{t}{b}\\
\mathbf{elif}\;y \leq 1.35 \cdot 10^{-52}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if y < -3.5e-52 or 1.35000000000000005e-52 < y Initial program 56.9%
Taylor expanded in y around inf 43.7%
mul-1-neg43.7%
unsub-neg43.7%
Simplified43.7%
if -3.5e-52 < y < -8.99999999999999997e-262 or 2.49999999999999987e-284 < y < 8.80000000000000006e-242Initial program 78.1%
Taylor expanded in b around inf 58.6%
Taylor expanded in t around inf 55.2%
if -8.99999999999999997e-262 < y < 2.49999999999999987e-284 or 8.80000000000000006e-242 < y < 1.35000000000000005e-52Initial program 72.9%
Taylor expanded in b around inf 54.0%
Taylor expanded in a around inf 54.8%
associate-*r/54.8%
mul-1-neg54.8%
Simplified54.8%
Final simplification48.4%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -1.05e-25) (not (<= z 7e-89))) (/ (- t a) (- b y)) (+ x (/ (* z t) y))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -1.05e-25) || !(z <= 7e-89)) {
tmp = (t - a) / (b - y);
} else {
tmp = x + ((z * t) / 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 <= (-1.05d-25)) .or. (.not. (z <= 7d-89))) then
tmp = (t - a) / (b - y)
else
tmp = x + ((z * t) / 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 <= -1.05e-25) || !(z <= 7e-89)) {
tmp = (t - a) / (b - y);
} else {
tmp = x + ((z * t) / y);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -1.05e-25) or not (z <= 7e-89): tmp = (t - a) / (b - y) else: tmp = x + ((z * t) / y) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -1.05e-25) || !(z <= 7e-89)) tmp = Float64(Float64(t - a) / Float64(b - y)); else tmp = Float64(x + Float64(Float64(z * t) / y)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((z <= -1.05e-25) || ~((z <= 7e-89))) tmp = (t - a) / (b - y); else tmp = x + ((z * t) / y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -1.05e-25], N[Not[LessEqual[z, 7e-89]], $MachinePrecision]], N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(z * t), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.05 \cdot 10^{-25} \lor \neg \left(z \leq 7 \cdot 10^{-89}\right):\\
\;\;\;\;\frac{t - a}{b - y}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{z \cdot t}{y}\\
\end{array}
\end{array}
if z < -1.05000000000000001e-25 or 6.9999999999999994e-89 < z Initial program 50.8%
Taylor expanded in z around inf 74.7%
if -1.05000000000000001e-25 < z < 6.9999999999999994e-89Initial program 85.7%
Taylor expanded in x around 0 85.8%
Taylor expanded in z around 0 49.3%
associate--r+49.3%
div-sub49.3%
associate-/l*60.5%
Simplified60.5%
Taylor expanded in t around inf 62.9%
Final simplification70.0%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -3.1e-47) (not (<= y 5.7e-49))) (/ 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 <= -3.1e-47) || !(y <= 5.7e-49)) {
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 <= (-3.1d-47)) .or. (.not. (y <= 5.7d-49))) 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 <= -3.1e-47) || !(y <= 5.7e-49)) {
tmp = x / (1.0 - z);
} else {
tmp = (t - a) / b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -3.1e-47) or not (y <= 5.7e-49): 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 <= -3.1e-47) || !(y <= 5.7e-49)) 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 <= -3.1e-47) || ~((y <= 5.7e-49))) 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, -3.1e-47], N[Not[LessEqual[y, 5.7e-49]], $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 -3.1 \cdot 10^{-47} \lor \neg \left(y \leq 5.7 \cdot 10^{-49}\right):\\
\;\;\;\;\frac{x}{1 - z}\\
\mathbf{else}:\\
\;\;\;\;\frac{t - a}{b}\\
\end{array}
\end{array}
if y < -3.0999999999999998e-47 or 5.7000000000000003e-49 < y Initial program 56.9%
Taylor expanded in y around inf 43.7%
mul-1-neg43.7%
unsub-neg43.7%
Simplified43.7%
if -3.0999999999999998e-47 < y < 5.7000000000000003e-49Initial program 75.4%
Taylor expanded in y around 0 71.9%
Final simplification55.4%
(FPCore (x y z t a b) :precision binary64 (if (<= y -2.35e-49) (+ x (* z (/ t y))) (if (<= y 4.8e-49) (/ (- t a) b) (/ x (- 1.0 z)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -2.35e-49) {
tmp = x + (z * (t / y));
} else if (y <= 4.8e-49) {
tmp = (t - a) / b;
} else {
tmp = x / (1.0 - z);
}
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 <= (-2.35d-49)) then
tmp = x + (z * (t / y))
else if (y <= 4.8d-49) then
tmp = (t - a) / b
else
tmp = x / (1.0d0 - z)
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 <= -2.35e-49) {
tmp = x + (z * (t / y));
} else if (y <= 4.8e-49) {
tmp = (t - a) / b;
} else {
tmp = x / (1.0 - z);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -2.35e-49: tmp = x + (z * (t / y)) elif y <= 4.8e-49: tmp = (t - a) / b else: tmp = x / (1.0 - z) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -2.35e-49) tmp = Float64(x + Float64(z * Float64(t / y))); elseif (y <= 4.8e-49) tmp = Float64(Float64(t - a) / b); else tmp = Float64(x / Float64(1.0 - z)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= -2.35e-49) tmp = x + (z * (t / y)); elseif (y <= 4.8e-49) tmp = (t - a) / b; else tmp = x / (1.0 - z); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -2.35e-49], N[(x + N[(z * N[(t / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4.8e-49], N[(N[(t - a), $MachinePrecision] / b), $MachinePrecision], N[(x / N[(1.0 - z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.35 \cdot 10^{-49}:\\
\;\;\;\;x + z \cdot \frac{t}{y}\\
\mathbf{elif}\;y \leq 4.8 \cdot 10^{-49}:\\
\;\;\;\;\frac{t - a}{b}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{1 - z}\\
\end{array}
\end{array}
if y < -2.35000000000000011e-49Initial program 59.4%
Taylor expanded in x around 0 59.4%
Taylor expanded in z around 0 34.1%
associate--r+34.1%
div-sub34.1%
associate-/l*44.1%
Simplified44.1%
Taylor expanded in t around inf 43.4%
if -2.35000000000000011e-49 < y < 4.79999999999999985e-49Initial program 75.4%
Taylor expanded in y around 0 71.9%
if 4.79999999999999985e-49 < y Initial program 54.9%
Taylor expanded in y around inf 44.9%
mul-1-neg44.9%
unsub-neg44.9%
Simplified44.9%
Final simplification55.7%
(FPCore (x y z t a b) :precision binary64 (if (<= z -2.8e-26) (/ t b) (if (<= z 2.8e-75) x (/ (- a) b))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -2.8e-26) {
tmp = t / b;
} else if (z <= 2.8e-75) {
tmp = x;
} else {
tmp = -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 (z <= (-2.8d-26)) then
tmp = t / b
else if (z <= 2.8d-75) then
tmp = x
else
tmp = -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 (z <= -2.8e-26) {
tmp = t / b;
} else if (z <= 2.8e-75) {
tmp = x;
} else {
tmp = -a / b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= -2.8e-26: tmp = t / b elif z <= 2.8e-75: tmp = x else: tmp = -a / b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -2.8e-26) tmp = Float64(t / b); elseif (z <= 2.8e-75) tmp = x; else tmp = Float64(Float64(-a) / b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (z <= -2.8e-26) tmp = t / b; elseif (z <= 2.8e-75) tmp = x; else tmp = -a / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -2.8e-26], N[(t / b), $MachinePrecision], If[LessEqual[z, 2.8e-75], x, N[((-a) / b), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.8 \cdot 10^{-26}:\\
\;\;\;\;\frac{t}{b}\\
\mathbf{elif}\;z \leq 2.8 \cdot 10^{-75}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;\frac{-a}{b}\\
\end{array}
\end{array}
if z < -2.8000000000000001e-26Initial program 47.0%
Taylor expanded in b around inf 28.5%
Taylor expanded in t around inf 35.2%
if -2.8000000000000001e-26 < z < 2.79999999999999998e-75Initial program 85.9%
Taylor expanded in z around 0 49.8%
if 2.79999999999999998e-75 < z Initial program 53.4%
Taylor expanded in b around inf 34.7%
Taylor expanded in a around inf 27.9%
associate-*r/27.9%
mul-1-neg27.9%
Simplified27.9%
Final simplification38.6%
(FPCore (x y z t a b) :precision binary64 (if (<= z -1.12e-26) (/ t b) (if (<= z 7e-89) x (/ t b))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -1.12e-26) {
tmp = t / b;
} else if (z <= 7e-89) {
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.12d-26)) then
tmp = t / b
else if (z <= 7d-89) 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.12e-26) {
tmp = t / b;
} else if (z <= 7e-89) {
tmp = x;
} else {
tmp = t / b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= -1.12e-26: tmp = t / b elif z <= 7e-89: tmp = x else: tmp = t / b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -1.12e-26) tmp = Float64(t / b); elseif (z <= 7e-89) 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.12e-26) tmp = t / b; elseif (z <= 7e-89) tmp = x; else tmp = t / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -1.12e-26], N[(t / b), $MachinePrecision], If[LessEqual[z, 7e-89], x, N[(t / b), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.12 \cdot 10^{-26}:\\
\;\;\;\;\frac{t}{b}\\
\mathbf{elif}\;z \leq 7 \cdot 10^{-89}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;\frac{t}{b}\\
\end{array}
\end{array}
if z < -1.12e-26 or 6.9999999999999994e-89 < z Initial program 50.8%
Taylor expanded in b around inf 32.3%
Taylor expanded in t around inf 30.4%
if -1.12e-26 < z < 6.9999999999999994e-89Initial program 85.7%
Taylor expanded in z around 0 50.2%
Final simplification38.2%
(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 64.6%
Taylor expanded in z around 0 22.9%
Final simplification22.9%
(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 2023279
(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)))))