
(FPCore (x y z t a b) :precision binary64 (/ (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)) (+ (+ x t) y)))
double code(double x, double y, double z, double t, double a, double b) {
return ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + 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 + y) * a)) - (y * b)) / ((x + t) + y)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y);
}
def code(x, y, z, t, a, b): return ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y)
function code(x, y, z, t, a, b) return Float64(Float64(Float64(Float64(Float64(x + y) * z) + Float64(Float64(t + y) * a)) - Float64(y * b)) / Float64(Float64(x + t) + y)) end
function tmp = code(x, y, z, t, a, b) tmp = ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(N[(N[(x + y), $MachinePrecision] * z), $MachinePrecision] + N[(N[(t + y), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / N[(N[(x + t), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b}{\left(x + t\right) + y}
\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 y) a)) (* y b)) (+ (+ x t) y)))
double code(double x, double y, double z, double t, double a, double b) {
return ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + 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 + y) * a)) - (y * b)) / ((x + t) + y)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y);
}
def code(x, y, z, t, a, b): return ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y)
function code(x, y, z, t, a, b) return Float64(Float64(Float64(Float64(Float64(x + y) * z) + Float64(Float64(t + y) * a)) - Float64(y * b)) / Float64(Float64(x + t) + y)) end
function tmp = code(x, y, z, t, a, b) tmp = ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(N[(N[(x + y), $MachinePrecision] * z), $MachinePrecision] + N[(N[(t + y), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / N[(N[(x + t), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b}{\left(x + t\right) + y}
\end{array}
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ y (+ x t))))
(if (<= x -2.8e+182)
(+ z (- (+ (/ y (/ x (+ a (- z b)))) (/ a (/ x t))) (/ z (/ x (+ y t)))))
(if (<= x 1.2e+257)
(+ (/ (- z b) (/ t_1 y)) (+ (/ a (/ t_1 (+ y t))) (/ (* x z) t_1)))
(* z (/ (+ x y) t_1))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = y + (x + t);
double tmp;
if (x <= -2.8e+182) {
tmp = z + (((y / (x / (a + (z - b)))) + (a / (x / t))) - (z / (x / (y + t))));
} else if (x <= 1.2e+257) {
tmp = ((z - b) / (t_1 / y)) + ((a / (t_1 / (y + t))) + ((x * z) / t_1));
} else {
tmp = z * ((x + y) / 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 = y + (x + t)
if (x <= (-2.8d+182)) then
tmp = z + (((y / (x / (a + (z - b)))) + (a / (x / t))) - (z / (x / (y + t))))
else if (x <= 1.2d+257) then
tmp = ((z - b) / (t_1 / y)) + ((a / (t_1 / (y + t))) + ((x * z) / t_1))
else
tmp = z * ((x + y) / 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 = y + (x + t);
double tmp;
if (x <= -2.8e+182) {
tmp = z + (((y / (x / (a + (z - b)))) + (a / (x / t))) - (z / (x / (y + t))));
} else if (x <= 1.2e+257) {
tmp = ((z - b) / (t_1 / y)) + ((a / (t_1 / (y + t))) + ((x * z) / t_1));
} else {
tmp = z * ((x + y) / t_1);
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = y + (x + t) tmp = 0 if x <= -2.8e+182: tmp = z + (((y / (x / (a + (z - b)))) + (a / (x / t))) - (z / (x / (y + t)))) elif x <= 1.2e+257: tmp = ((z - b) / (t_1 / y)) + ((a / (t_1 / (y + t))) + ((x * z) / t_1)) else: tmp = z * ((x + y) / t_1) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(y + Float64(x + t)) tmp = 0.0 if (x <= -2.8e+182) tmp = Float64(z + Float64(Float64(Float64(y / Float64(x / Float64(a + Float64(z - b)))) + Float64(a / Float64(x / t))) - Float64(z / Float64(x / Float64(y + t))))); elseif (x <= 1.2e+257) tmp = Float64(Float64(Float64(z - b) / Float64(t_1 / y)) + Float64(Float64(a / Float64(t_1 / Float64(y + t))) + Float64(Float64(x * z) / t_1))); else tmp = Float64(z * Float64(Float64(x + y) / t_1)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = y + (x + t); tmp = 0.0; if (x <= -2.8e+182) tmp = z + (((y / (x / (a + (z - b)))) + (a / (x / t))) - (z / (x / (y + t)))); elseif (x <= 1.2e+257) tmp = ((z - b) / (t_1 / y)) + ((a / (t_1 / (y + t))) + ((x * z) / t_1)); else tmp = z * ((x + y) / t_1); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -2.8e+182], N[(z + N[(N[(N[(y / N[(x / N[(a + N[(z - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(a / N[(x / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(z / N[(x / N[(y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.2e+257], N[(N[(N[(z - b), $MachinePrecision] / N[(t$95$1 / y), $MachinePrecision]), $MachinePrecision] + N[(N[(a / N[(t$95$1 / N[(y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(x * z), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z * N[(N[(x + y), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y + \left(x + t\right)\\
\mathbf{if}\;x \leq -2.8 \cdot 10^{+182}:\\
\;\;\;\;z + \left(\left(\frac{y}{\frac{x}{a + \left(z - b\right)}} + \frac{a}{\frac{x}{t}}\right) - \frac{z}{\frac{x}{y + t}}\right)\\
\mathbf{elif}\;x \leq 1.2 \cdot 10^{+257}:\\
\;\;\;\;\frac{z - b}{\frac{t_1}{y}} + \left(\frac{a}{\frac{t_1}{y + t}} + \frac{x \cdot z}{t_1}\right)\\
\mathbf{else}:\\
\;\;\;\;z \cdot \frac{x + y}{t_1}\\
\end{array}
\end{array}
if x < -2.80000000000000006e182Initial program 40.8%
Simplified41.0%
Taylor expanded in x around inf 63.9%
associate--l+63.9%
associate-/l*72.7%
sub-neg72.7%
+-commutative72.7%
associate-+r+72.7%
sub-neg72.7%
+-commutative72.7%
associate-+l-72.7%
associate-/l*77.0%
associate-/l*91.1%
Simplified91.1%
if -2.80000000000000006e182 < x < 1.2e257Initial program 65.0%
Simplified65.4%
Taylor expanded in a around inf 65.0%
associate-/l*75.3%
+-commutative75.3%
associate-/l*92.9%
Simplified92.9%
if 1.2e257 < x Initial program 28.3%
Taylor expanded in z around inf 29.7%
associate-/l*81.3%
Simplified81.3%
associate-/r/93.1%
+-commutative93.1%
+-commutative93.1%
Applied egg-rr93.1%
Final simplification92.6%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (- (+ (* a (+ y t)) (* z (+ x y))) (* y b)) (+ y (+ x t)))))
(if (<= t_1 (- INFINITY))
(+ z a)
(if (<= t_1 2e+247) t_1 (+ a (/ (- z b) (/ (+ y t) y)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (((a * (y + t)) + (z * (x + y))) - (y * b)) / (y + (x + t));
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = z + a;
} else if (t_1 <= 2e+247) {
tmp = t_1;
} else {
tmp = a + ((z - b) / ((y + t) / y));
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (((a * (y + t)) + (z * (x + y))) - (y * b)) / (y + (x + t));
double tmp;
if (t_1 <= -Double.POSITIVE_INFINITY) {
tmp = z + a;
} else if (t_1 <= 2e+247) {
tmp = t_1;
} else {
tmp = a + ((z - b) / ((y + t) / y));
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (((a * (y + t)) + (z * (x + y))) - (y * b)) / (y + (x + t)) tmp = 0 if t_1 <= -math.inf: tmp = z + a elif t_1 <= 2e+247: tmp = t_1 else: tmp = a + ((z - b) / ((y + t) / y)) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(Float64(a * Float64(y + t)) + Float64(z * Float64(x + y))) - Float64(y * b)) / Float64(y + Float64(x + t))) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = Float64(z + a); elseif (t_1 <= 2e+247) tmp = t_1; else tmp = Float64(a + Float64(Float64(z - b) / Float64(Float64(y + t) / y))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (((a * (y + t)) + (z * (x + y))) - (y * b)) / (y + (x + t)); tmp = 0.0; if (t_1 <= -Inf) tmp = z + a; elseif (t_1 <= 2e+247) tmp = t_1; else tmp = a + ((z - b) / ((y + t) / y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(N[(a * N[(y + t), $MachinePrecision]), $MachinePrecision] + N[(z * N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(z + a), $MachinePrecision], If[LessEqual[t$95$1, 2e+247], t$95$1, N[(a + N[(N[(z - b), $MachinePrecision] / N[(N[(y + t), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\left(a \cdot \left(y + t\right) + z \cdot \left(x + y\right)\right) - y \cdot b}{y + \left(x + t\right)}\\
\mathbf{if}\;t_1 \leq -\infty:\\
\;\;\;\;z + a\\
\mathbf{elif}\;t_1 \leq 2 \cdot 10^{+247}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;a + \frac{z - b}{\frac{y + t}{y}}\\
\end{array}
\end{array}
if (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < -inf.0Initial program 7.4%
Simplified7.3%
Taylor expanded in a around inf 7.4%
associate-/l*30.8%
+-commutative30.8%
associate-/l*68.5%
Simplified68.5%
Taylor expanded in y around inf 64.3%
Taylor expanded in x around inf 70.6%
if -inf.0 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 1.9999999999999999e247Initial program 99.1%
if 1.9999999999999999e247 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 5.7%
Simplified7.3%
Taylor expanded in a around inf 6.0%
associate-/l*29.7%
+-commutative29.7%
associate-/l*63.6%
Simplified63.6%
Taylor expanded in y around inf 63.6%
Taylor expanded in x around 0 27.9%
associate-/l*77.2%
Simplified77.2%
Final simplification88.6%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ y (+ x t))))
(if (<= y -3.6e+90)
(+ a (/ (- z b) (/ (+ y t) y)))
(if (<= y 1.45e+30)
(+ (* z (+ (/ x t_1) (/ y t_1))) (/ (- (* a (+ y t)) (* y b)) t_1))
(+ (/ (- z b) (/ t_1 y)) (+ a (/ (* x z) t_1)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = y + (x + t);
double tmp;
if (y <= -3.6e+90) {
tmp = a + ((z - b) / ((y + t) / y));
} else if (y <= 1.45e+30) {
tmp = (z * ((x / t_1) + (y / t_1))) + (((a * (y + t)) - (y * b)) / t_1);
} else {
tmp = ((z - b) / (t_1 / y)) + (a + ((x * z) / 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 = y + (x + t)
if (y <= (-3.6d+90)) then
tmp = a + ((z - b) / ((y + t) / y))
else if (y <= 1.45d+30) then
tmp = (z * ((x / t_1) + (y / t_1))) + (((a * (y + t)) - (y * b)) / t_1)
else
tmp = ((z - b) / (t_1 / y)) + (a + ((x * z) / 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 = y + (x + t);
double tmp;
if (y <= -3.6e+90) {
tmp = a + ((z - b) / ((y + t) / y));
} else if (y <= 1.45e+30) {
tmp = (z * ((x / t_1) + (y / t_1))) + (((a * (y + t)) - (y * b)) / t_1);
} else {
tmp = ((z - b) / (t_1 / y)) + (a + ((x * z) / t_1));
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = y + (x + t) tmp = 0 if y <= -3.6e+90: tmp = a + ((z - b) / ((y + t) / y)) elif y <= 1.45e+30: tmp = (z * ((x / t_1) + (y / t_1))) + (((a * (y + t)) - (y * b)) / t_1) else: tmp = ((z - b) / (t_1 / y)) + (a + ((x * z) / t_1)) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(y + Float64(x + t)) tmp = 0.0 if (y <= -3.6e+90) tmp = Float64(a + Float64(Float64(z - b) / Float64(Float64(y + t) / y))); elseif (y <= 1.45e+30) tmp = Float64(Float64(z * Float64(Float64(x / t_1) + Float64(y / t_1))) + Float64(Float64(Float64(a * Float64(y + t)) - Float64(y * b)) / t_1)); else tmp = Float64(Float64(Float64(z - b) / Float64(t_1 / y)) + Float64(a + Float64(Float64(x * z) / t_1))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = y + (x + t); tmp = 0.0; if (y <= -3.6e+90) tmp = a + ((z - b) / ((y + t) / y)); elseif (y <= 1.45e+30) tmp = (z * ((x / t_1) + (y / t_1))) + (((a * (y + t)) - (y * b)) / t_1); else tmp = ((z - b) / (t_1 / y)) + (a + ((x * z) / t_1)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -3.6e+90], N[(a + N[(N[(z - b), $MachinePrecision] / N[(N[(y + t), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.45e+30], N[(N[(z * N[(N[(x / t$95$1), $MachinePrecision] + N[(y / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(a * N[(y + t), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision], N[(N[(N[(z - b), $MachinePrecision] / N[(t$95$1 / y), $MachinePrecision]), $MachinePrecision] + N[(a + N[(N[(x * z), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y + \left(x + t\right)\\
\mathbf{if}\;y \leq -3.6 \cdot 10^{+90}:\\
\;\;\;\;a + \frac{z - b}{\frac{y + t}{y}}\\
\mathbf{elif}\;y \leq 1.45 \cdot 10^{+30}:\\
\;\;\;\;z \cdot \left(\frac{x}{t_1} + \frac{y}{t_1}\right) + \frac{a \cdot \left(y + t\right) - y \cdot b}{t_1}\\
\mathbf{else}:\\
\;\;\;\;\frac{z - b}{\frac{t_1}{y}} + \left(a + \frac{x \cdot z}{t_1}\right)\\
\end{array}
\end{array}
if y < -3.6e90Initial program 28.6%
Simplified29.5%
Taylor expanded in a around inf 28.8%
associate-/l*54.2%
+-commutative54.2%
associate-/l*79.5%
Simplified79.5%
Taylor expanded in y around inf 75.1%
Taylor expanded in x around 0 40.6%
associate-/l*83.9%
Simplified83.9%
if -3.6e90 < y < 1.4499999999999999e30Initial program 77.6%
Taylor expanded in z around 0 92.6%
associate--l+92.6%
*-commutative92.6%
div-sub92.6%
Simplified92.6%
if 1.4499999999999999e30 < y Initial program 33.7%
Simplified34.8%
Taylor expanded in a around inf 33.9%
associate-/l*55.2%
+-commutative55.2%
associate-/l*90.3%
Simplified90.3%
Taylor expanded in y around inf 85.7%
Final simplification89.6%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ y (+ x t))) (t_2 (* z (/ (+ x y) t_1))) (t_3 (- (+ z a) b)))
(if (<= y -1.9e-25)
t_3
(if (<= y -4.25e-240)
t_2
(if (<= y -2.9e-272)
a
(if (<= y 1.22e-260)
(/ (+ x y) (/ (+ x t) z))
(if (<= y 2.3e-229)
(/ (* a t) t_1)
(if (<= y 1.95e-88) t_2 t_3))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = y + (x + t);
double t_2 = z * ((x + y) / t_1);
double t_3 = (z + a) - b;
double tmp;
if (y <= -1.9e-25) {
tmp = t_3;
} else if (y <= -4.25e-240) {
tmp = t_2;
} else if (y <= -2.9e-272) {
tmp = a;
} else if (y <= 1.22e-260) {
tmp = (x + y) / ((x + t) / z);
} else if (y <= 2.3e-229) {
tmp = (a * t) / t_1;
} else if (y <= 1.95e-88) {
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 = y + (x + t)
t_2 = z * ((x + y) / t_1)
t_3 = (z + a) - b
if (y <= (-1.9d-25)) then
tmp = t_3
else if (y <= (-4.25d-240)) then
tmp = t_2
else if (y <= (-2.9d-272)) then
tmp = a
else if (y <= 1.22d-260) then
tmp = (x + y) / ((x + t) / z)
else if (y <= 2.3d-229) then
tmp = (a * t) / t_1
else if (y <= 1.95d-88) 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 = y + (x + t);
double t_2 = z * ((x + y) / t_1);
double t_3 = (z + a) - b;
double tmp;
if (y <= -1.9e-25) {
tmp = t_3;
} else if (y <= -4.25e-240) {
tmp = t_2;
} else if (y <= -2.9e-272) {
tmp = a;
} else if (y <= 1.22e-260) {
tmp = (x + y) / ((x + t) / z);
} else if (y <= 2.3e-229) {
tmp = (a * t) / t_1;
} else if (y <= 1.95e-88) {
tmp = t_2;
} else {
tmp = t_3;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = y + (x + t) t_2 = z * ((x + y) / t_1) t_3 = (z + a) - b tmp = 0 if y <= -1.9e-25: tmp = t_3 elif y <= -4.25e-240: tmp = t_2 elif y <= -2.9e-272: tmp = a elif y <= 1.22e-260: tmp = (x + y) / ((x + t) / z) elif y <= 2.3e-229: tmp = (a * t) / t_1 elif y <= 1.95e-88: tmp = t_2 else: tmp = t_3 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(y + Float64(x + t)) t_2 = Float64(z * Float64(Float64(x + y) / t_1)) t_3 = Float64(Float64(z + a) - b) tmp = 0.0 if (y <= -1.9e-25) tmp = t_3; elseif (y <= -4.25e-240) tmp = t_2; elseif (y <= -2.9e-272) tmp = a; elseif (y <= 1.22e-260) tmp = Float64(Float64(x + y) / Float64(Float64(x + t) / z)); elseif (y <= 2.3e-229) tmp = Float64(Float64(a * t) / t_1); elseif (y <= 1.95e-88) tmp = t_2; else tmp = t_3; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = y + (x + t); t_2 = z * ((x + y) / t_1); t_3 = (z + a) - b; tmp = 0.0; if (y <= -1.9e-25) tmp = t_3; elseif (y <= -4.25e-240) tmp = t_2; elseif (y <= -2.9e-272) tmp = a; elseif (y <= 1.22e-260) tmp = (x + y) / ((x + t) / z); elseif (y <= 2.3e-229) tmp = (a * t) / t_1; elseif (y <= 1.95e-88) tmp = t_2; else tmp = t_3; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(z * N[(N[(x + y), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision]}, If[LessEqual[y, -1.9e-25], t$95$3, If[LessEqual[y, -4.25e-240], t$95$2, If[LessEqual[y, -2.9e-272], a, If[LessEqual[y, 1.22e-260], N[(N[(x + y), $MachinePrecision] / N[(N[(x + t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.3e-229], N[(N[(a * t), $MachinePrecision] / t$95$1), $MachinePrecision], If[LessEqual[y, 1.95e-88], t$95$2, t$95$3]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y + \left(x + t\right)\\
t_2 := z \cdot \frac{x + y}{t_1}\\
t_3 := \left(z + a\right) - b\\
\mathbf{if}\;y \leq -1.9 \cdot 10^{-25}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;y \leq -4.25 \cdot 10^{-240}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq -2.9 \cdot 10^{-272}:\\
\;\;\;\;a\\
\mathbf{elif}\;y \leq 1.22 \cdot 10^{-260}:\\
\;\;\;\;\frac{x + y}{\frac{x + t}{z}}\\
\mathbf{elif}\;y \leq 2.3 \cdot 10^{-229}:\\
\;\;\;\;\frac{a \cdot t}{t_1}\\
\mathbf{elif}\;y \leq 1.95 \cdot 10^{-88}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;t_3\\
\end{array}
\end{array}
if y < -1.8999999999999999e-25 or 1.94999999999999996e-88 < y Initial program 45.6%
Taylor expanded in y around inf 68.5%
+-commutative68.5%
Simplified68.5%
if -1.8999999999999999e-25 < y < -4.25e-240 or 2.29999999999999996e-229 < y < 1.94999999999999996e-88Initial program 77.6%
Taylor expanded in z around inf 49.2%
associate-/l*57.7%
Simplified57.7%
associate-/r/65.6%
+-commutative65.6%
+-commutative65.6%
Applied egg-rr65.6%
if -4.25e-240 < y < -2.89999999999999995e-272Initial program 100.0%
Taylor expanded in t around inf 100.0%
if -2.89999999999999995e-272 < y < 1.22e-260Initial program 64.2%
Taylor expanded in z around inf 39.9%
associate-/l*60.3%
Simplified60.3%
Taylor expanded in y around 0 60.3%
+-commutative60.3%
Simplified60.3%
if 1.22e-260 < y < 2.29999999999999996e-229Initial program 99.6%
Taylor expanded in t around inf 72.4%
Final simplification67.9%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ a (/ (- z b) (/ (+ y t) y)))))
(if (<= x -3.2e+135)
(+ z (* y (- (/ a x) (/ b x))))
(if (<= x -0.0003)
t_1
(if (<= x -8.6e-57)
(/ (- (* z (+ x y)) (* y b)) (+ y (+ x t)))
(if (<= x 1.4e+189) t_1 (+ z (* a (+ (/ y x) (/ t x))))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = a + ((z - b) / ((y + t) / y));
double tmp;
if (x <= -3.2e+135) {
tmp = z + (y * ((a / x) - (b / x)));
} else if (x <= -0.0003) {
tmp = t_1;
} else if (x <= -8.6e-57) {
tmp = ((z * (x + y)) - (y * b)) / (y + (x + t));
} else if (x <= 1.4e+189) {
tmp = t_1;
} else {
tmp = z + (a * ((y / x) + (t / 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) :: t_1
real(8) :: tmp
t_1 = a + ((z - b) / ((y + t) / y))
if (x <= (-3.2d+135)) then
tmp = z + (y * ((a / x) - (b / x)))
else if (x <= (-0.0003d0)) then
tmp = t_1
else if (x <= (-8.6d-57)) then
tmp = ((z * (x + y)) - (y * b)) / (y + (x + t))
else if (x <= 1.4d+189) then
tmp = t_1
else
tmp = z + (a * ((y / x) + (t / x)))
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 + ((z - b) / ((y + t) / y));
double tmp;
if (x <= -3.2e+135) {
tmp = z + (y * ((a / x) - (b / x)));
} else if (x <= -0.0003) {
tmp = t_1;
} else if (x <= -8.6e-57) {
tmp = ((z * (x + y)) - (y * b)) / (y + (x + t));
} else if (x <= 1.4e+189) {
tmp = t_1;
} else {
tmp = z + (a * ((y / x) + (t / x)));
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = a + ((z - b) / ((y + t) / y)) tmp = 0 if x <= -3.2e+135: tmp = z + (y * ((a / x) - (b / x))) elif x <= -0.0003: tmp = t_1 elif x <= -8.6e-57: tmp = ((z * (x + y)) - (y * b)) / (y + (x + t)) elif x <= 1.4e+189: tmp = t_1 else: tmp = z + (a * ((y / x) + (t / x))) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(a + Float64(Float64(z - b) / Float64(Float64(y + t) / y))) tmp = 0.0 if (x <= -3.2e+135) tmp = Float64(z + Float64(y * Float64(Float64(a / x) - Float64(b / x)))); elseif (x <= -0.0003) tmp = t_1; elseif (x <= -8.6e-57) tmp = Float64(Float64(Float64(z * Float64(x + y)) - Float64(y * b)) / Float64(y + Float64(x + t))); elseif (x <= 1.4e+189) tmp = t_1; else tmp = Float64(z + Float64(a * Float64(Float64(y / x) + Float64(t / x)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = a + ((z - b) / ((y + t) / y)); tmp = 0.0; if (x <= -3.2e+135) tmp = z + (y * ((a / x) - (b / x))); elseif (x <= -0.0003) tmp = t_1; elseif (x <= -8.6e-57) tmp = ((z * (x + y)) - (y * b)) / (y + (x + t)); elseif (x <= 1.4e+189) tmp = t_1; else tmp = z + (a * ((y / x) + (t / x))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(a + N[(N[(z - b), $MachinePrecision] / N[(N[(y + t), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -3.2e+135], N[(z + N[(y * N[(N[(a / x), $MachinePrecision] - N[(b / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -0.0003], t$95$1, If[LessEqual[x, -8.6e-57], N[(N[(N[(z * N[(x + y), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.4e+189], t$95$1, N[(z + N[(a * N[(N[(y / x), $MachinePrecision] + N[(t / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a + \frac{z - b}{\frac{y + t}{y}}\\
\mathbf{if}\;x \leq -3.2 \cdot 10^{+135}:\\
\;\;\;\;z + y \cdot \left(\frac{a}{x} - \frac{b}{x}\right)\\
\mathbf{elif}\;x \leq -0.0003:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -8.6 \cdot 10^{-57}:\\
\;\;\;\;\frac{z \cdot \left(x + y\right) - y \cdot b}{y + \left(x + t\right)}\\
\mathbf{elif}\;x \leq 1.4 \cdot 10^{+189}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;z + a \cdot \left(\frac{y}{x} + \frac{t}{x}\right)\\
\end{array}
\end{array}
if x < -3.19999999999999975e135Initial program 47.5%
Simplified47.7%
Taylor expanded in x around inf 61.9%
associate--l+61.9%
associate-/l*70.4%
sub-neg70.4%
+-commutative70.4%
associate-+r+70.4%
sub-neg70.4%
+-commutative70.4%
associate-+l-70.4%
associate-/l*73.6%
associate-/l*84.6%
Simplified84.6%
Taylor expanded in y around inf 75.3%
if -3.19999999999999975e135 < x < -2.99999999999999974e-4 or -8.60000000000000043e-57 < x < 1.40000000000000003e189Initial program 62.2%
Simplified62.7%
Taylor expanded in a around inf 62.2%
associate-/l*74.6%
+-commutative74.6%
associate-/l*94.6%
Simplified94.6%
Taylor expanded in y around inf 88.0%
Taylor expanded in x around 0 54.3%
associate-/l*79.9%
Simplified79.9%
if -2.99999999999999974e-4 < x < -8.60000000000000043e-57Initial program 92.1%
Taylor expanded in a around 0 78.0%
if 1.40000000000000003e189 < x Initial program 55.8%
Simplified56.4%
Taylor expanded in x around inf 55.8%
associate--l+55.8%
associate-/l*55.5%
sub-neg55.5%
+-commutative55.5%
associate-+r+55.5%
sub-neg55.5%
+-commutative55.5%
associate-+l-55.5%
associate-/l*59.3%
associate-/l*66.7%
Simplified66.7%
Taylor expanded in a around inf 63.8%
Final simplification77.2%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ z (/ (+ x t) x))) (t_2 (- (+ z a) b)))
(if (<= y -1.3e-25)
t_2
(if (<= y -1.75e-240)
t_1
(if (<= y -5.7e-272)
a
(if (<= y 4.2e-254)
(* z (/ x (+ x t)))
(if (<= y 1.7e-229)
(/ (* a t) (+ y (+ x t)))
(if (<= y 2e-90) t_1 t_2))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = z / ((x + t) / x);
double t_2 = (z + a) - b;
double tmp;
if (y <= -1.3e-25) {
tmp = t_2;
} else if (y <= -1.75e-240) {
tmp = t_1;
} else if (y <= -5.7e-272) {
tmp = a;
} else if (y <= 4.2e-254) {
tmp = z * (x / (x + t));
} else if (y <= 1.7e-229) {
tmp = (a * t) / (y + (x + t));
} else if (y <= 2e-90) {
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 = z / ((x + t) / x)
t_2 = (z + a) - b
if (y <= (-1.3d-25)) then
tmp = t_2
else if (y <= (-1.75d-240)) then
tmp = t_1
else if (y <= (-5.7d-272)) then
tmp = a
else if (y <= 4.2d-254) then
tmp = z * (x / (x + t))
else if (y <= 1.7d-229) then
tmp = (a * t) / (y + (x + t))
else if (y <= 2d-90) 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 = z / ((x + t) / x);
double t_2 = (z + a) - b;
double tmp;
if (y <= -1.3e-25) {
tmp = t_2;
} else if (y <= -1.75e-240) {
tmp = t_1;
} else if (y <= -5.7e-272) {
tmp = a;
} else if (y <= 4.2e-254) {
tmp = z * (x / (x + t));
} else if (y <= 1.7e-229) {
tmp = (a * t) / (y + (x + t));
} else if (y <= 2e-90) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = z / ((x + t) / x) t_2 = (z + a) - b tmp = 0 if y <= -1.3e-25: tmp = t_2 elif y <= -1.75e-240: tmp = t_1 elif y <= -5.7e-272: tmp = a elif y <= 4.2e-254: tmp = z * (x / (x + t)) elif y <= 1.7e-229: tmp = (a * t) / (y + (x + t)) elif y <= 2e-90: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(z / Float64(Float64(x + t) / x)) t_2 = Float64(Float64(z + a) - b) tmp = 0.0 if (y <= -1.3e-25) tmp = t_2; elseif (y <= -1.75e-240) tmp = t_1; elseif (y <= -5.7e-272) tmp = a; elseif (y <= 4.2e-254) tmp = Float64(z * Float64(x / Float64(x + t))); elseif (y <= 1.7e-229) tmp = Float64(Float64(a * t) / Float64(y + Float64(x + t))); elseif (y <= 2e-90) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = z / ((x + t) / x); t_2 = (z + a) - b; tmp = 0.0; if (y <= -1.3e-25) tmp = t_2; elseif (y <= -1.75e-240) tmp = t_1; elseif (y <= -5.7e-272) tmp = a; elseif (y <= 4.2e-254) tmp = z * (x / (x + t)); elseif (y <= 1.7e-229) tmp = (a * t) / (y + (x + t)); elseif (y <= 2e-90) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(z / N[(N[(x + t), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision]}, If[LessEqual[y, -1.3e-25], t$95$2, If[LessEqual[y, -1.75e-240], t$95$1, If[LessEqual[y, -5.7e-272], a, If[LessEqual[y, 4.2e-254], N[(z * N[(x / N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.7e-229], N[(N[(a * t), $MachinePrecision] / N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2e-90], t$95$1, t$95$2]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{z}{\frac{x + t}{x}}\\
t_2 := \left(z + a\right) - b\\
\mathbf{if}\;y \leq -1.3 \cdot 10^{-25}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq -1.75 \cdot 10^{-240}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq -5.7 \cdot 10^{-272}:\\
\;\;\;\;a\\
\mathbf{elif}\;y \leq 4.2 \cdot 10^{-254}:\\
\;\;\;\;z \cdot \frac{x}{x + t}\\
\mathbf{elif}\;y \leq 1.7 \cdot 10^{-229}:\\
\;\;\;\;\frac{a \cdot t}{y + \left(x + t\right)}\\
\mathbf{elif}\;y \leq 2 \cdot 10^{-90}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if y < -1.3e-25 or 1.99999999999999999e-90 < y Initial program 45.6%
Taylor expanded in y around inf 68.5%
+-commutative68.5%
Simplified68.5%
if -1.3e-25 < y < -1.75000000000000008e-240 or 1.7e-229 < y < 1.99999999999999999e-90Initial program 77.6%
Taylor expanded in x around inf 46.5%
Taylor expanded in y around 0 46.5%
associate-/l*63.0%
Simplified63.0%
if -1.75000000000000008e-240 < y < -5.6999999999999999e-272Initial program 100.0%
Taylor expanded in t around inf 100.0%
if -5.6999999999999999e-272 < y < 4.19999999999999993e-254Initial program 64.2%
Taylor expanded in z around inf 39.9%
associate-/l*60.3%
Simplified60.3%
associate-/r/60.3%
+-commutative60.3%
+-commutative60.3%
Applied egg-rr60.3%
Taylor expanded in y around 0 60.3%
if 4.19999999999999993e-254 < y < 1.7e-229Initial program 99.6%
Taylor expanded in t around inf 72.4%
Final simplification67.1%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ z (/ (+ x t) x))) (t_2 (- (+ z a) b)))
(if (<= y -2.3e-23)
t_2
(if (<= y -3.9e-240)
t_1
(if (<= y -6.5e-273)
a
(if (<= y 6.5e-255)
(/ (+ x y) (/ (+ x t) z))
(if (<= y 1.36e-229)
(/ (* a t) (+ y (+ x t)))
(if (<= y 1.7e-89) t_1 t_2))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = z / ((x + t) / x);
double t_2 = (z + a) - b;
double tmp;
if (y <= -2.3e-23) {
tmp = t_2;
} else if (y <= -3.9e-240) {
tmp = t_1;
} else if (y <= -6.5e-273) {
tmp = a;
} else if (y <= 6.5e-255) {
tmp = (x + y) / ((x + t) / z);
} else if (y <= 1.36e-229) {
tmp = (a * t) / (y + (x + t));
} else if (y <= 1.7e-89) {
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 = z / ((x + t) / x)
t_2 = (z + a) - b
if (y <= (-2.3d-23)) then
tmp = t_2
else if (y <= (-3.9d-240)) then
tmp = t_1
else if (y <= (-6.5d-273)) then
tmp = a
else if (y <= 6.5d-255) then
tmp = (x + y) / ((x + t) / z)
else if (y <= 1.36d-229) then
tmp = (a * t) / (y + (x + t))
else if (y <= 1.7d-89) 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 = z / ((x + t) / x);
double t_2 = (z + a) - b;
double tmp;
if (y <= -2.3e-23) {
tmp = t_2;
} else if (y <= -3.9e-240) {
tmp = t_1;
} else if (y <= -6.5e-273) {
tmp = a;
} else if (y <= 6.5e-255) {
tmp = (x + y) / ((x + t) / z);
} else if (y <= 1.36e-229) {
tmp = (a * t) / (y + (x + t));
} else if (y <= 1.7e-89) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = z / ((x + t) / x) t_2 = (z + a) - b tmp = 0 if y <= -2.3e-23: tmp = t_2 elif y <= -3.9e-240: tmp = t_1 elif y <= -6.5e-273: tmp = a elif y <= 6.5e-255: tmp = (x + y) / ((x + t) / z) elif y <= 1.36e-229: tmp = (a * t) / (y + (x + t)) elif y <= 1.7e-89: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(z / Float64(Float64(x + t) / x)) t_2 = Float64(Float64(z + a) - b) tmp = 0.0 if (y <= -2.3e-23) tmp = t_2; elseif (y <= -3.9e-240) tmp = t_1; elseif (y <= -6.5e-273) tmp = a; elseif (y <= 6.5e-255) tmp = Float64(Float64(x + y) / Float64(Float64(x + t) / z)); elseif (y <= 1.36e-229) tmp = Float64(Float64(a * t) / Float64(y + Float64(x + t))); elseif (y <= 1.7e-89) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = z / ((x + t) / x); t_2 = (z + a) - b; tmp = 0.0; if (y <= -2.3e-23) tmp = t_2; elseif (y <= -3.9e-240) tmp = t_1; elseif (y <= -6.5e-273) tmp = a; elseif (y <= 6.5e-255) tmp = (x + y) / ((x + t) / z); elseif (y <= 1.36e-229) tmp = (a * t) / (y + (x + t)); elseif (y <= 1.7e-89) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(z / N[(N[(x + t), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision]}, If[LessEqual[y, -2.3e-23], t$95$2, If[LessEqual[y, -3.9e-240], t$95$1, If[LessEqual[y, -6.5e-273], a, If[LessEqual[y, 6.5e-255], N[(N[(x + y), $MachinePrecision] / N[(N[(x + t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.36e-229], N[(N[(a * t), $MachinePrecision] / N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.7e-89], t$95$1, t$95$2]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{z}{\frac{x + t}{x}}\\
t_2 := \left(z + a\right) - b\\
\mathbf{if}\;y \leq -2.3 \cdot 10^{-23}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq -3.9 \cdot 10^{-240}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq -6.5 \cdot 10^{-273}:\\
\;\;\;\;a\\
\mathbf{elif}\;y \leq 6.5 \cdot 10^{-255}:\\
\;\;\;\;\frac{x + y}{\frac{x + t}{z}}\\
\mathbf{elif}\;y \leq 1.36 \cdot 10^{-229}:\\
\;\;\;\;\frac{a \cdot t}{y + \left(x + t\right)}\\
\mathbf{elif}\;y \leq 1.7 \cdot 10^{-89}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if y < -2.3000000000000001e-23 or 1.7e-89 < y Initial program 45.6%
Taylor expanded in y around inf 68.5%
+-commutative68.5%
Simplified68.5%
if -2.3000000000000001e-23 < y < -3.90000000000000015e-240 or 1.36e-229 < y < 1.7e-89Initial program 77.6%
Taylor expanded in x around inf 46.5%
Taylor expanded in y around 0 46.5%
associate-/l*63.0%
Simplified63.0%
if -3.90000000000000015e-240 < y < -6.49999999999999979e-273Initial program 100.0%
Taylor expanded in t around inf 100.0%
if -6.49999999999999979e-273 < y < 6.5e-255Initial program 64.2%
Taylor expanded in z around inf 39.9%
associate-/l*60.3%
Simplified60.3%
Taylor expanded in y around 0 60.3%
+-commutative60.3%
Simplified60.3%
if 6.5e-255 < y < 1.36e-229Initial program 99.6%
Taylor expanded in t around inf 72.4%
Final simplification67.1%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ y (+ x t))))
(if (<= x -1.85e+195)
(/ z (/ (+ x t) x))
(if (<= x -1.5e+143)
(/ (- y) (/ t_1 b))
(if (or (<= x -3.5e+106) (not (<= x 2e+190)))
(* z (/ (+ x y) t_1))
(+ a (/ (- z b) (/ (+ y t) y))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = y + (x + t);
double tmp;
if (x <= -1.85e+195) {
tmp = z / ((x + t) / x);
} else if (x <= -1.5e+143) {
tmp = -y / (t_1 / b);
} else if ((x <= -3.5e+106) || !(x <= 2e+190)) {
tmp = z * ((x + y) / t_1);
} else {
tmp = a + ((z - b) / ((y + 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) :: t_1
real(8) :: tmp
t_1 = y + (x + t)
if (x <= (-1.85d+195)) then
tmp = z / ((x + t) / x)
else if (x <= (-1.5d+143)) then
tmp = -y / (t_1 / b)
else if ((x <= (-3.5d+106)) .or. (.not. (x <= 2d+190))) then
tmp = z * ((x + y) / t_1)
else
tmp = a + ((z - b) / ((y + 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 t_1 = y + (x + t);
double tmp;
if (x <= -1.85e+195) {
tmp = z / ((x + t) / x);
} else if (x <= -1.5e+143) {
tmp = -y / (t_1 / b);
} else if ((x <= -3.5e+106) || !(x <= 2e+190)) {
tmp = z * ((x + y) / t_1);
} else {
tmp = a + ((z - b) / ((y + t) / y));
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = y + (x + t) tmp = 0 if x <= -1.85e+195: tmp = z / ((x + t) / x) elif x <= -1.5e+143: tmp = -y / (t_1 / b) elif (x <= -3.5e+106) or not (x <= 2e+190): tmp = z * ((x + y) / t_1) else: tmp = a + ((z - b) / ((y + t) / y)) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(y + Float64(x + t)) tmp = 0.0 if (x <= -1.85e+195) tmp = Float64(z / Float64(Float64(x + t) / x)); elseif (x <= -1.5e+143) tmp = Float64(Float64(-y) / Float64(t_1 / b)); elseif ((x <= -3.5e+106) || !(x <= 2e+190)) tmp = Float64(z * Float64(Float64(x + y) / t_1)); else tmp = Float64(a + Float64(Float64(z - b) / Float64(Float64(y + t) / y))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = y + (x + t); tmp = 0.0; if (x <= -1.85e+195) tmp = z / ((x + t) / x); elseif (x <= -1.5e+143) tmp = -y / (t_1 / b); elseif ((x <= -3.5e+106) || ~((x <= 2e+190))) tmp = z * ((x + y) / t_1); else tmp = a + ((z - b) / ((y + t) / y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.85e+195], N[(z / N[(N[(x + t), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -1.5e+143], N[((-y) / N[(t$95$1 / b), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[x, -3.5e+106], N[Not[LessEqual[x, 2e+190]], $MachinePrecision]], N[(z * N[(N[(x + y), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision], N[(a + N[(N[(z - b), $MachinePrecision] / N[(N[(y + t), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y + \left(x + t\right)\\
\mathbf{if}\;x \leq -1.85 \cdot 10^{+195}:\\
\;\;\;\;\frac{z}{\frac{x + t}{x}}\\
\mathbf{elif}\;x \leq -1.5 \cdot 10^{+143}:\\
\;\;\;\;\frac{-y}{\frac{t_1}{b}}\\
\mathbf{elif}\;x \leq -3.5 \cdot 10^{+106} \lor \neg \left(x \leq 2 \cdot 10^{+190}\right):\\
\;\;\;\;z \cdot \frac{x + y}{t_1}\\
\mathbf{else}:\\
\;\;\;\;a + \frac{z - b}{\frac{y + t}{y}}\\
\end{array}
\end{array}
if x < -1.85e195Initial program 35.0%
Taylor expanded in x around inf 25.4%
Taylor expanded in y around 0 25.4%
associate-/l*72.4%
Simplified72.4%
if -1.85e195 < x < -1.5e143Initial program 71.8%
Taylor expanded in b around inf 40.1%
mul-1-neg40.1%
associate-/l*51.1%
distribute-neg-frac51.1%
Simplified51.1%
if -1.5e143 < x < -3.49999999999999981e106 or 2.0000000000000001e190 < x Initial program 55.2%
Taylor expanded in z around inf 34.2%
associate-/l*55.8%
Simplified55.8%
associate-/r/63.6%
+-commutative63.6%
+-commutative63.6%
Applied egg-rr63.6%
if -3.49999999999999981e106 < x < 2.0000000000000001e190Initial program 65.0%
Simplified65.4%
Taylor expanded in a around inf 65.0%
associate-/l*76.5%
+-commutative76.5%
associate-/l*96.4%
Simplified96.4%
Taylor expanded in y around inf 90.6%
Taylor expanded in x around 0 55.6%
associate-/l*78.3%
Simplified78.3%
Final simplification73.5%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* z (/ x (+ x t)))) (t_2 (- (+ z a) b)))
(if (<= y -6.1e-27)
t_2
(if (<= y -1.72e-240)
t_1
(if (<= y -1.06e-275) a (if (<= y 2.3e-88) t_1 t_2))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = z * (x / (x + t));
double t_2 = (z + a) - b;
double tmp;
if (y <= -6.1e-27) {
tmp = t_2;
} else if (y <= -1.72e-240) {
tmp = t_1;
} else if (y <= -1.06e-275) {
tmp = a;
} else if (y <= 2.3e-88) {
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 = z * (x / (x + t))
t_2 = (z + a) - b
if (y <= (-6.1d-27)) then
tmp = t_2
else if (y <= (-1.72d-240)) then
tmp = t_1
else if (y <= (-1.06d-275)) then
tmp = a
else if (y <= 2.3d-88) 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 = z * (x / (x + t));
double t_2 = (z + a) - b;
double tmp;
if (y <= -6.1e-27) {
tmp = t_2;
} else if (y <= -1.72e-240) {
tmp = t_1;
} else if (y <= -1.06e-275) {
tmp = a;
} else if (y <= 2.3e-88) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = z * (x / (x + t)) t_2 = (z + a) - b tmp = 0 if y <= -6.1e-27: tmp = t_2 elif y <= -1.72e-240: tmp = t_1 elif y <= -1.06e-275: tmp = a elif y <= 2.3e-88: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(z * Float64(x / Float64(x + t))) t_2 = Float64(Float64(z + a) - b) tmp = 0.0 if (y <= -6.1e-27) tmp = t_2; elseif (y <= -1.72e-240) tmp = t_1; elseif (y <= -1.06e-275) tmp = a; elseif (y <= 2.3e-88) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = z * (x / (x + t)); t_2 = (z + a) - b; tmp = 0.0; if (y <= -6.1e-27) tmp = t_2; elseif (y <= -1.72e-240) tmp = t_1; elseif (y <= -1.06e-275) tmp = a; elseif (y <= 2.3e-88) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(z * N[(x / N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision]}, If[LessEqual[y, -6.1e-27], t$95$2, If[LessEqual[y, -1.72e-240], t$95$1, If[LessEqual[y, -1.06e-275], a, If[LessEqual[y, 2.3e-88], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \frac{x}{x + t}\\
t_2 := \left(z + a\right) - b\\
\mathbf{if}\;y \leq -6.1 \cdot 10^{-27}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq -1.72 \cdot 10^{-240}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq -1.06 \cdot 10^{-275}:\\
\;\;\;\;a\\
\mathbf{elif}\;y \leq 2.3 \cdot 10^{-88}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if y < -6.0999999999999999e-27 or 2.29999999999999986e-88 < y Initial program 45.6%
Taylor expanded in y around inf 68.5%
+-commutative68.5%
Simplified68.5%
if -6.0999999999999999e-27 < y < -1.7199999999999999e-240 or -1.05999999999999994e-275 < y < 2.29999999999999986e-88Initial program 77.0%
Taylor expanded in z around inf 44.7%
associate-/l*54.5%
Simplified54.5%
associate-/r/60.6%
+-commutative60.6%
+-commutative60.6%
Applied egg-rr60.6%
Taylor expanded in y around 0 58.6%
if -1.7199999999999999e-240 < y < -1.05999999999999994e-275Initial program 100.0%
Taylor expanded in t around inf 100.0%
Final simplification65.2%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (- (+ z a) b)))
(if (<= y -1.3e-23)
t_1
(if (<= y -1.75e-240)
(/ z (/ (+ x t) x))
(if (<= y -7e-274) a (if (<= y 1.05e-88) (* z (/ x (+ x t))) t_1))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (z + a) - b;
double tmp;
if (y <= -1.3e-23) {
tmp = t_1;
} else if (y <= -1.75e-240) {
tmp = z / ((x + t) / x);
} else if (y <= -7e-274) {
tmp = a;
} else if (y <= 1.05e-88) {
tmp = z * (x / (x + t));
} 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 = (z + a) - b
if (y <= (-1.3d-23)) then
tmp = t_1
else if (y <= (-1.75d-240)) then
tmp = z / ((x + t) / x)
else if (y <= (-7d-274)) then
tmp = a
else if (y <= 1.05d-88) then
tmp = z * (x / (x + t))
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 = (z + a) - b;
double tmp;
if (y <= -1.3e-23) {
tmp = t_1;
} else if (y <= -1.75e-240) {
tmp = z / ((x + t) / x);
} else if (y <= -7e-274) {
tmp = a;
} else if (y <= 1.05e-88) {
tmp = z * (x / (x + t));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (z + a) - b tmp = 0 if y <= -1.3e-23: tmp = t_1 elif y <= -1.75e-240: tmp = z / ((x + t) / x) elif y <= -7e-274: tmp = a elif y <= 1.05e-88: tmp = z * (x / (x + t)) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(z + a) - b) tmp = 0.0 if (y <= -1.3e-23) tmp = t_1; elseif (y <= -1.75e-240) tmp = Float64(z / Float64(Float64(x + t) / x)); elseif (y <= -7e-274) tmp = a; elseif (y <= 1.05e-88) tmp = Float64(z * Float64(x / Float64(x + t))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (z + a) - b; tmp = 0.0; if (y <= -1.3e-23) tmp = t_1; elseif (y <= -1.75e-240) tmp = z / ((x + t) / x); elseif (y <= -7e-274) tmp = a; elseif (y <= 1.05e-88) tmp = z * (x / (x + t)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision]}, If[LessEqual[y, -1.3e-23], t$95$1, If[LessEqual[y, -1.75e-240], N[(z / N[(N[(x + t), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -7e-274], a, If[LessEqual[y, 1.05e-88], N[(z * N[(x / N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(z + a\right) - b\\
\mathbf{if}\;y \leq -1.3 \cdot 10^{-23}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq -1.75 \cdot 10^{-240}:\\
\;\;\;\;\frac{z}{\frac{x + t}{x}}\\
\mathbf{elif}\;y \leq -7 \cdot 10^{-274}:\\
\;\;\;\;a\\
\mathbf{elif}\;y \leq 1.05 \cdot 10^{-88}:\\
\;\;\;\;z \cdot \frac{x}{x + t}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if y < -1.3e-23 or 1.05e-88 < y Initial program 45.6%
Taylor expanded in y around inf 68.5%
+-commutative68.5%
Simplified68.5%
if -1.3e-23 < y < -1.75000000000000008e-240Initial program 77.0%
Taylor expanded in x around inf 45.6%
Taylor expanded in y around 0 45.7%
associate-/l*64.4%
Simplified64.4%
if -1.75000000000000008e-240 < y < -6.99999999999999963e-274Initial program 100.0%
Taylor expanded in t around inf 100.0%
if -6.99999999999999963e-274 < y < 1.05e-88Initial program 77.0%
Taylor expanded in z around inf 41.8%
associate-/l*47.9%
Simplified47.9%
associate-/r/55.5%
+-commutative55.5%
+-commutative55.5%
Applied egg-rr55.5%
Taylor expanded in y around 0 54.0%
Final simplification65.2%
(FPCore (x y z t a b)
:precision binary64
(if (<= x -4.3e+135)
(+ z (* y (- (/ a x) (/ b x))))
(if (<= x 1.45e+188)
(+ a (/ (- z b) (/ (+ y t) y)))
(* z (/ (+ x y) (+ y (+ x t)))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -4.3e+135) {
tmp = z + (y * ((a / x) - (b / x)));
} else if (x <= 1.45e+188) {
tmp = a + ((z - b) / ((y + t) / y));
} else {
tmp = z * ((x + y) / (y + (x + t)));
}
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 (x <= (-4.3d+135)) then
tmp = z + (y * ((a / x) - (b / x)))
else if (x <= 1.45d+188) then
tmp = a + ((z - b) / ((y + t) / y))
else
tmp = z * ((x + y) / (y + (x + t)))
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 (x <= -4.3e+135) {
tmp = z + (y * ((a / x) - (b / x)));
} else if (x <= 1.45e+188) {
tmp = a + ((z - b) / ((y + t) / y));
} else {
tmp = z * ((x + y) / (y + (x + t)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= -4.3e+135: tmp = z + (y * ((a / x) - (b / x))) elif x <= 1.45e+188: tmp = a + ((z - b) / ((y + t) / y)) else: tmp = z * ((x + y) / (y + (x + t))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -4.3e+135) tmp = Float64(z + Float64(y * Float64(Float64(a / x) - Float64(b / x)))); elseif (x <= 1.45e+188) tmp = Float64(a + Float64(Float64(z - b) / Float64(Float64(y + t) / y))); else tmp = Float64(z * Float64(Float64(x + y) / Float64(y + Float64(x + t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (x <= -4.3e+135) tmp = z + (y * ((a / x) - (b / x))); elseif (x <= 1.45e+188) tmp = a + ((z - b) / ((y + t) / y)); else tmp = z * ((x + y) / (y + (x + t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -4.3e+135], N[(z + N[(y * N[(N[(a / x), $MachinePrecision] - N[(b / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.45e+188], N[(a + N[(N[(z - b), $MachinePrecision] / N[(N[(y + t), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z * N[(N[(x + y), $MachinePrecision] / N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.3 \cdot 10^{+135}:\\
\;\;\;\;z + y \cdot \left(\frac{a}{x} - \frac{b}{x}\right)\\
\mathbf{elif}\;x \leq 1.45 \cdot 10^{+188}:\\
\;\;\;\;a + \frac{z - b}{\frac{y + t}{y}}\\
\mathbf{else}:\\
\;\;\;\;z \cdot \frac{x + y}{y + \left(x + t\right)}\\
\end{array}
\end{array}
if x < -4.29999999999999972e135Initial program 47.5%
Simplified47.7%
Taylor expanded in x around inf 61.9%
associate--l+61.9%
associate-/l*70.4%
sub-neg70.4%
+-commutative70.4%
associate-+r+70.4%
sub-neg70.4%
+-commutative70.4%
associate-+l-70.4%
associate-/l*73.6%
associate-/l*84.6%
Simplified84.6%
Taylor expanded in y around inf 75.3%
if -4.29999999999999972e135 < x < 1.45e188Initial program 64.3%
Simplified64.7%
Taylor expanded in a around inf 64.3%
associate-/l*75.3%
+-commutative75.3%
associate-/l*94.4%
Simplified94.4%
Taylor expanded in y around inf 87.8%
Taylor expanded in x around 0 53.7%
associate-/l*77.0%
Simplified77.0%
if 1.45e188 < x Initial program 55.8%
Taylor expanded in z around inf 33.7%
associate-/l*46.2%
Simplified46.2%
associate-/r/57.1%
+-commutative57.1%
+-commutative57.1%
Applied egg-rr57.1%
Final simplification74.6%
(FPCore (x y z t a b)
:precision binary64
(if (<= x -5e+136)
(+ z (* y (- (/ a x) (/ b x))))
(if (<= x 1.15e+189)
(+ a (/ (- z b) (/ (+ y t) y)))
(+ z (* a (+ (/ y x) (/ t x)))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -5e+136) {
tmp = z + (y * ((a / x) - (b / x)));
} else if (x <= 1.15e+189) {
tmp = a + ((z - b) / ((y + t) / y));
} else {
tmp = z + (a * ((y / x) + (t / 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 (x <= (-5d+136)) then
tmp = z + (y * ((a / x) - (b / x)))
else if (x <= 1.15d+189) then
tmp = a + ((z - b) / ((y + t) / y))
else
tmp = z + (a * ((y / x) + (t / 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 (x <= -5e+136) {
tmp = z + (y * ((a / x) - (b / x)));
} else if (x <= 1.15e+189) {
tmp = a + ((z - b) / ((y + t) / y));
} else {
tmp = z + (a * ((y / x) + (t / x)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= -5e+136: tmp = z + (y * ((a / x) - (b / x))) elif x <= 1.15e+189: tmp = a + ((z - b) / ((y + t) / y)) else: tmp = z + (a * ((y / x) + (t / x))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -5e+136) tmp = Float64(z + Float64(y * Float64(Float64(a / x) - Float64(b / x)))); elseif (x <= 1.15e+189) tmp = Float64(a + Float64(Float64(z - b) / Float64(Float64(y + t) / y))); else tmp = Float64(z + Float64(a * Float64(Float64(y / x) + Float64(t / x)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (x <= -5e+136) tmp = z + (y * ((a / x) - (b / x))); elseif (x <= 1.15e+189) tmp = a + ((z - b) / ((y + t) / y)); else tmp = z + (a * ((y / x) + (t / x))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -5e+136], N[(z + N[(y * N[(N[(a / x), $MachinePrecision] - N[(b / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.15e+189], N[(a + N[(N[(z - b), $MachinePrecision] / N[(N[(y + t), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z + N[(a * N[(N[(y / x), $MachinePrecision] + N[(t / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -5 \cdot 10^{+136}:\\
\;\;\;\;z + y \cdot \left(\frac{a}{x} - \frac{b}{x}\right)\\
\mathbf{elif}\;x \leq 1.15 \cdot 10^{+189}:\\
\;\;\;\;a + \frac{z - b}{\frac{y + t}{y}}\\
\mathbf{else}:\\
\;\;\;\;z + a \cdot \left(\frac{y}{x} + \frac{t}{x}\right)\\
\end{array}
\end{array}
if x < -5.0000000000000002e136Initial program 47.5%
Simplified47.7%
Taylor expanded in x around inf 61.9%
associate--l+61.9%
associate-/l*70.4%
sub-neg70.4%
+-commutative70.4%
associate-+r+70.4%
sub-neg70.4%
+-commutative70.4%
associate-+l-70.4%
associate-/l*73.6%
associate-/l*84.6%
Simplified84.6%
Taylor expanded in y around inf 75.3%
if -5.0000000000000002e136 < x < 1.15e189Initial program 64.3%
Simplified64.7%
Taylor expanded in a around inf 64.3%
associate-/l*75.3%
+-commutative75.3%
associate-/l*94.4%
Simplified94.4%
Taylor expanded in y around inf 87.8%
Taylor expanded in x around 0 53.7%
associate-/l*77.0%
Simplified77.0%
if 1.15e189 < x Initial program 55.8%
Simplified56.4%
Taylor expanded in x around inf 55.8%
associate--l+55.8%
associate-/l*55.5%
sub-neg55.5%
+-commutative55.5%
associate-+r+55.5%
sub-neg55.5%
+-commutative55.5%
associate-+l-55.5%
associate-/l*59.3%
associate-/l*66.7%
Simplified66.7%
Taylor expanded in a around inf 63.8%
Final simplification75.3%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (- (+ z a) b)))
(if (<= y -2.1e-27)
t_1
(if (<= y -3.2e-240)
z
(if (<= y -1.8e-279) a (if (<= y 3.1e+78) (+ z a) t_1))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (z + a) - b;
double tmp;
if (y <= -2.1e-27) {
tmp = t_1;
} else if (y <= -3.2e-240) {
tmp = z;
} else if (y <= -1.8e-279) {
tmp = a;
} else if (y <= 3.1e+78) {
tmp = z + a;
} 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 = (z + a) - b
if (y <= (-2.1d-27)) then
tmp = t_1
else if (y <= (-3.2d-240)) then
tmp = z
else if (y <= (-1.8d-279)) then
tmp = a
else if (y <= 3.1d+78) then
tmp = z + a
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 = (z + a) - b;
double tmp;
if (y <= -2.1e-27) {
tmp = t_1;
} else if (y <= -3.2e-240) {
tmp = z;
} else if (y <= -1.8e-279) {
tmp = a;
} else if (y <= 3.1e+78) {
tmp = z + a;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (z + a) - b tmp = 0 if y <= -2.1e-27: tmp = t_1 elif y <= -3.2e-240: tmp = z elif y <= -1.8e-279: tmp = a elif y <= 3.1e+78: tmp = z + a else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(z + a) - b) tmp = 0.0 if (y <= -2.1e-27) tmp = t_1; elseif (y <= -3.2e-240) tmp = z; elseif (y <= -1.8e-279) tmp = a; elseif (y <= 3.1e+78) tmp = Float64(z + a); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (z + a) - b; tmp = 0.0; if (y <= -2.1e-27) tmp = t_1; elseif (y <= -3.2e-240) tmp = z; elseif (y <= -1.8e-279) tmp = a; elseif (y <= 3.1e+78) tmp = z + a; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision]}, If[LessEqual[y, -2.1e-27], t$95$1, If[LessEqual[y, -3.2e-240], z, If[LessEqual[y, -1.8e-279], a, If[LessEqual[y, 3.1e+78], N[(z + a), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(z + a\right) - b\\
\mathbf{if}\;y \leq -2.1 \cdot 10^{-27}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq -3.2 \cdot 10^{-240}:\\
\;\;\;\;z\\
\mathbf{elif}\;y \leq -1.8 \cdot 10^{-279}:\\
\;\;\;\;a\\
\mathbf{elif}\;y \leq 3.1 \cdot 10^{+78}:\\
\;\;\;\;z + a\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if y < -2.10000000000000015e-27 or 3.1e78 < y Initial program 40.3%
Taylor expanded in y around inf 72.1%
+-commutative72.1%
Simplified72.1%
if -2.10000000000000015e-27 < y < -3.1999999999999999e-240Initial program 77.0%
Taylor expanded in x around inf 53.5%
if -3.1999999999999999e-240 < y < -1.7999999999999998e-279Initial program 100.0%
Taylor expanded in t around inf 100.0%
if -1.7999999999999998e-279 < y < 3.1e78Initial program 73.2%
Simplified73.2%
Taylor expanded in a around inf 73.2%
associate-/l*71.0%
+-commutative71.0%
associate-/l*79.6%
Simplified79.6%
Taylor expanded in y around inf 61.1%
Taylor expanded in x around inf 48.0%
Final simplification61.1%
(FPCore (x y z t a b) :precision binary64 (if (<= a -4.3e+64) a (if (<= a 4e+142) z a)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -4.3e+64) {
tmp = a;
} else if (a <= 4e+142) {
tmp = z;
} else {
tmp = a;
}
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 (a <= (-4.3d+64)) then
tmp = a
else if (a <= 4d+142) then
tmp = z
else
tmp = a
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 (a <= -4.3e+64) {
tmp = a;
} else if (a <= 4e+142) {
tmp = z;
} else {
tmp = a;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if a <= -4.3e+64: tmp = a elif a <= 4e+142: tmp = z else: tmp = a return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (a <= -4.3e+64) tmp = a; elseif (a <= 4e+142) tmp = z; else tmp = a; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (a <= -4.3e+64) tmp = a; elseif (a <= 4e+142) tmp = z; else tmp = a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, -4.3e+64], a, If[LessEqual[a, 4e+142], z, a]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -4.3 \cdot 10^{+64}:\\
\;\;\;\;a\\
\mathbf{elif}\;a \leq 4 \cdot 10^{+142}:\\
\;\;\;\;z\\
\mathbf{else}:\\
\;\;\;\;a\\
\end{array}
\end{array}
if a < -4.2999999999999998e64 or 4.0000000000000002e142 < a Initial program 42.7%
Taylor expanded in t around inf 51.8%
if -4.2999999999999998e64 < a < 4.0000000000000002e142Initial program 67.2%
Taylor expanded in x around inf 44.3%
Final simplification46.6%
(FPCore (x y z t a b) :precision binary64 (if (<= x -2.5e+202) z (+ z a)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -2.5e+202) {
tmp = z;
} else {
tmp = z + a;
}
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 (x <= (-2.5d+202)) then
tmp = z
else
tmp = z + a
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 (x <= -2.5e+202) {
tmp = z;
} else {
tmp = z + a;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= -2.5e+202: tmp = z else: tmp = z + a return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -2.5e+202) tmp = z; else tmp = Float64(z + a); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (x <= -2.5e+202) tmp = z; else tmp = z + a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -2.5e+202], z, N[(z + a), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.5 \cdot 10^{+202}:\\
\;\;\;\;z\\
\mathbf{else}:\\
\;\;\;\;z + a\\
\end{array}
\end{array}
if x < -2.5e202Initial program 34.7%
Taylor expanded in x around inf 74.5%
if -2.5e202 < x Initial program 63.6%
Simplified64.0%
Taylor expanded in a around inf 63.6%
associate-/l*72.2%
+-commutative72.2%
associate-/l*88.8%
Simplified88.8%
Taylor expanded in y around inf 77.5%
Taylor expanded in x around inf 48.3%
Final simplification51.8%
(FPCore (x y z t a b) :precision binary64 a)
double code(double x, double y, double z, double t, double a, double b) {
return a;
}
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 = a
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return a;
}
def code(x, y, z, t, a, b): return a
function code(x, y, z, t, a, b) return a end
function tmp = code(x, y, z, t, a, b) tmp = a; end
code[x_, y_, z_, t_, a_, b_] := a
\begin{array}{l}
\\
a
\end{array}
Initial program 59.6%
Taylor expanded in t around inf 26.9%
Final simplification26.9%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ (+ x t) y))
(t_2 (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)))
(t_3 (/ t_2 t_1))
(t_4 (- (+ z a) b)))
(if (< t_3 -3.5813117084150564e+153)
t_4
(if (< t_3 1.2285964308315609e+82) (/ 1.0 (/ t_1 t_2)) t_4))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x + t) + y;
double t_2 = (((x + y) * z) + ((t + y) * a)) - (y * b);
double t_3 = t_2 / t_1;
double t_4 = (z + a) - b;
double tmp;
if (t_3 < -3.5813117084150564e+153) {
tmp = t_4;
} else if (t_3 < 1.2285964308315609e+82) {
tmp = 1.0 / (t_1 / t_2);
} 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 = (x + t) + y
t_2 = (((x + y) * z) + ((t + y) * a)) - (y * b)
t_3 = t_2 / t_1
t_4 = (z + a) - b
if (t_3 < (-3.5813117084150564d+153)) then
tmp = t_4
else if (t_3 < 1.2285964308315609d+82) then
tmp = 1.0d0 / (t_1 / t_2)
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 = (x + t) + y;
double t_2 = (((x + y) * z) + ((t + y) * a)) - (y * b);
double t_3 = t_2 / t_1;
double t_4 = (z + a) - b;
double tmp;
if (t_3 < -3.5813117084150564e+153) {
tmp = t_4;
} else if (t_3 < 1.2285964308315609e+82) {
tmp = 1.0 / (t_1 / t_2);
} else {
tmp = t_4;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (x + t) + y t_2 = (((x + y) * z) + ((t + y) * a)) - (y * b) t_3 = t_2 / t_1 t_4 = (z + a) - b tmp = 0 if t_3 < -3.5813117084150564e+153: tmp = t_4 elif t_3 < 1.2285964308315609e+82: tmp = 1.0 / (t_1 / t_2) else: tmp = t_4 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(x + t) + y) t_2 = Float64(Float64(Float64(Float64(x + y) * z) + Float64(Float64(t + y) * a)) - Float64(y * b)) t_3 = Float64(t_2 / t_1) t_4 = Float64(Float64(z + a) - b) tmp = 0.0 if (t_3 < -3.5813117084150564e+153) tmp = t_4; elseif (t_3 < 1.2285964308315609e+82) tmp = Float64(1.0 / Float64(t_1 / t_2)); else tmp = t_4; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (x + t) + y; t_2 = (((x + y) * z) + ((t + y) * a)) - (y * b); t_3 = t_2 / t_1; t_4 = (z + a) - b; tmp = 0.0; if (t_3 < -3.5813117084150564e+153) tmp = t_4; elseif (t_3 < 1.2285964308315609e+82) tmp = 1.0 / (t_1 / t_2); else tmp = t_4; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(x + t), $MachinePrecision] + y), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(N[(x + y), $MachinePrecision] * z), $MachinePrecision] + N[(N[(t + y), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(t$95$2 / t$95$1), $MachinePrecision]}, Block[{t$95$4 = N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision]}, If[Less[t$95$3, -3.5813117084150564e+153], t$95$4, If[Less[t$95$3, 1.2285964308315609e+82], N[(1.0 / N[(t$95$1 / t$95$2), $MachinePrecision]), $MachinePrecision], t$95$4]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(x + t\right) + y\\
t_2 := \left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b\\
t_3 := \frac{t_2}{t_1}\\
t_4 := \left(z + a\right) - b\\
\mathbf{if}\;t_3 < -3.5813117084150564 \cdot 10^{+153}:\\
\;\;\;\;t_4\\
\mathbf{elif}\;t_3 < 1.2285964308315609 \cdot 10^{+82}:\\
\;\;\;\;\frac{1}{\frac{t_1}{t_2}}\\
\mathbf{else}:\\
\;\;\;\;t_4\\
\end{array}
\end{array}
herbie shell --seed 2023229
(FPCore (x y z t a b)
:name "AI.Clustering.Hierarchical.Internal:ward from clustering-0.2.1"
:precision binary64
:herbie-target
(if (< (/ (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)) (+ (+ x t) y)) -3.5813117084150564e+153) (- (+ z a) b) (if (< (/ (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)) (+ (+ x t) y)) 1.2285964308315609e+82) (/ 1.0 (/ (+ (+ x t) y) (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)))) (- (+ z a) b)))
(/ (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)) (+ (+ x t) y)))