
(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 11 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 (* z (+ x y)))
(t_2 (/ (- (+ (* (+ y t) a) t_1) (* y b)) (+ y (+ x t))))
(t_3 (+ t (+ x y))))
(if (<= t_2 (- INFINITY))
(+ (* a (+ (/ y t_3) (/ t t_3))) (/ x (/ (+ x t) z)))
(if (<= t_2 1e+287)
(+ (/ a (/ t_3 (+ y t))) (/ (- t_1 (* y b)) t_3))
(+ z (/ y (/ (+ x y) (- a b))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = z * (x + y);
double t_2 = ((((y + t) * a) + t_1) - (y * b)) / (y + (x + t));
double t_3 = t + (x + y);
double tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = (a * ((y / t_3) + (t / t_3))) + (x / ((x + t) / z));
} else if (t_2 <= 1e+287) {
tmp = (a / (t_3 / (y + t))) + ((t_1 - (y * b)) / t_3);
} else {
tmp = z + (y / ((x + y) / (a - b)));
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = z * (x + y);
double t_2 = ((((y + t) * a) + t_1) - (y * b)) / (y + (x + t));
double t_3 = t + (x + y);
double tmp;
if (t_2 <= -Double.POSITIVE_INFINITY) {
tmp = (a * ((y / t_3) + (t / t_3))) + (x / ((x + t) / z));
} else if (t_2 <= 1e+287) {
tmp = (a / (t_3 / (y + t))) + ((t_1 - (y * b)) / t_3);
} else {
tmp = z + (y / ((x + y) / (a - b)));
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = z * (x + y) t_2 = ((((y + t) * a) + t_1) - (y * b)) / (y + (x + t)) t_3 = t + (x + y) tmp = 0 if t_2 <= -math.inf: tmp = (a * ((y / t_3) + (t / t_3))) + (x / ((x + t) / z)) elif t_2 <= 1e+287: tmp = (a / (t_3 / (y + t))) + ((t_1 - (y * b)) / t_3) else: tmp = z + (y / ((x + y) / (a - b))) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(z * Float64(x + y)) t_2 = Float64(Float64(Float64(Float64(Float64(y + t) * a) + t_1) - Float64(y * b)) / Float64(y + Float64(x + t))) t_3 = Float64(t + Float64(x + y)) tmp = 0.0 if (t_2 <= Float64(-Inf)) tmp = Float64(Float64(a * Float64(Float64(y / t_3) + Float64(t / t_3))) + Float64(x / Float64(Float64(x + t) / z))); elseif (t_2 <= 1e+287) tmp = Float64(Float64(a / Float64(t_3 / Float64(y + t))) + Float64(Float64(t_1 - Float64(y * b)) / t_3)); else tmp = Float64(z + Float64(y / Float64(Float64(x + y) / Float64(a - b)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = z * (x + y); t_2 = ((((y + t) * a) + t_1) - (y * b)) / (y + (x + t)); t_3 = t + (x + y); tmp = 0.0; if (t_2 <= -Inf) tmp = (a * ((y / t_3) + (t / t_3))) + (x / ((x + t) / z)); elseif (t_2 <= 1e+287) tmp = (a / (t_3 / (y + t))) + ((t_1 - (y * b)) / t_3); else tmp = z + (y / ((x + y) / (a - b))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(z * N[(x + y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(N[(N[(y + t), $MachinePrecision] * a), $MachinePrecision] + t$95$1), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(t + N[(x + y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], N[(N[(a * N[(N[(y / t$95$3), $MachinePrecision] + N[(t / t$95$3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x / N[(N[(x + t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 1e+287], N[(N[(a / N[(t$95$3 / N[(y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$1 - N[(y * b), $MachinePrecision]), $MachinePrecision] / t$95$3), $MachinePrecision]), $MachinePrecision], N[(z + N[(y / N[(N[(x + y), $MachinePrecision] / N[(a - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \left(x + y\right)\\
t_2 := \frac{\left(\left(y + t\right) \cdot a + t_1\right) - y \cdot b}{y + \left(x + t\right)}\\
t_3 := t + \left(x + y\right)\\
\mathbf{if}\;t_2 \leq -\infty:\\
\;\;\;\;a \cdot \left(\frac{y}{t_3} + \frac{t}{t_3}\right) + \frac{x}{\frac{x + t}{z}}\\
\mathbf{elif}\;t_2 \leq 10^{+287}:\\
\;\;\;\;\frac{a}{\frac{t_3}{y + t}} + \frac{t_1 - y \cdot b}{t_3}\\
\mathbf{else}:\\
\;\;\;\;z + \frac{y}{\frac{x + y}{a - b}}\\
\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 6.5%
Taylor expanded in a around 0 45.4%
associate--l+45.4%
+-commutative45.4%
+-commutative45.4%
+-commutative45.4%
div-sub45.4%
+-commutative45.4%
*-commutative45.4%
+-commutative45.4%
Simplified45.4%
Taylor expanded in y around 0 52.0%
associate-/l*76.4%
Simplified76.4%
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.0000000000000001e287Initial program 99.7%
Taylor expanded in z around inf 99.7%
associate--l+99.7%
associate-/l*99.7%
+-commutative99.7%
div-sub99.7%
+-commutative99.7%
*-commutative99.7%
+-commutative99.7%
Simplified99.7%
if 1.0000000000000001e287 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 5.2%
Taylor expanded in t around 0 8.4%
sub-neg8.4%
+-commutative8.4%
associate-+r+8.4%
+-commutative8.4%
sub-neg8.4%
distribute-rgt-out--8.9%
+-commutative8.9%
+-commutative8.9%
Simplified8.9%
Taylor expanded in z around 0 29.6%
associate-/l*79.8%
+-commutative79.8%
Simplified79.8%
Final simplification90.0%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (- (+ (* (+ y t) a) (* z (+ x y))) (* y b)) (+ y (+ x t)))))
(if (or (<= t_1 (- INFINITY)) (not (<= t_1 1e+287)))
(+ z (/ y (/ (+ x y) (- a b))))
t_1)))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((((y + t) * a) + (z * (x + y))) - (y * b)) / (y + (x + t));
double tmp;
if ((t_1 <= -((double) INFINITY)) || !(t_1 <= 1e+287)) {
tmp = z + (y / ((x + y) / (a - b)));
} else {
tmp = t_1;
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((((y + t) * a) + (z * (x + y))) - (y * b)) / (y + (x + t));
double tmp;
if ((t_1 <= -Double.POSITIVE_INFINITY) || !(t_1 <= 1e+287)) {
tmp = z + (y / ((x + y) / (a - b)));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = ((((y + t) * a) + (z * (x + y))) - (y * b)) / (y + (x + t)) tmp = 0 if (t_1 <= -math.inf) or not (t_1 <= 1e+287): tmp = z + (y / ((x + y) / (a - b))) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(Float64(Float64(y + t) * a) + Float64(z * Float64(x + y))) - Float64(y * b)) / Float64(y + Float64(x + t))) tmp = 0.0 if ((t_1 <= Float64(-Inf)) || !(t_1 <= 1e+287)) tmp = Float64(z + Float64(y / Float64(Float64(x + y) / Float64(a - b)))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = ((((y + t) * a) + (z * (x + y))) - (y * b)) / (y + (x + t)); tmp = 0.0; if ((t_1 <= -Inf) || ~((t_1 <= 1e+287))) tmp = z + (y / ((x + y) / (a - b))); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(N[(N[(y + t), $MachinePrecision] * a), $MachinePrecision] + N[(z * N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$1, (-Infinity)], N[Not[LessEqual[t$95$1, 1e+287]], $MachinePrecision]], N[(z + N[(y / N[(N[(x + y), $MachinePrecision] / N[(a - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\left(\left(y + t\right) \cdot a + z \cdot \left(x + y\right)\right) - y \cdot b}{y + \left(x + t\right)}\\
\mathbf{if}\;t_1 \leq -\infty \lor \neg \left(t_1 \leq 10^{+287}\right):\\
\;\;\;\;z + \frac{y}{\frac{x + y}{a - b}}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\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.0 or 1.0000000000000001e287 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 6.0%
Taylor expanded in t around 0 9.1%
sub-neg9.1%
+-commutative9.1%
associate-+r+9.1%
+-commutative9.1%
sub-neg9.1%
distribute-rgt-out--9.3%
+-commutative9.3%
+-commutative9.3%
Simplified9.3%
Taylor expanded in z around 0 34.9%
associate-/l*77.0%
+-commutative77.0%
Simplified77.0%
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.0000000000000001e287Initial program 99.7%
Final simplification89.6%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (- (+ (* (+ y t) a) (* z (+ x y))) (* y b)) (+ y (+ x t))))
(t_2 (+ t (+ x y))))
(if (<= t_1 (- INFINITY))
(+ (* a (+ (/ y t_2) (/ t t_2))) (/ x (/ (+ x t) z)))
(if (<= t_1 1e+287) t_1 (+ z (/ y (/ (+ x y) (- a b))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((((y + t) * a) + (z * (x + y))) - (y * b)) / (y + (x + t));
double t_2 = t + (x + y);
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = (a * ((y / t_2) + (t / t_2))) + (x / ((x + t) / z));
} else if (t_1 <= 1e+287) {
tmp = t_1;
} else {
tmp = z + (y / ((x + y) / (a - b)));
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((((y + t) * a) + (z * (x + y))) - (y * b)) / (y + (x + t));
double t_2 = t + (x + y);
double tmp;
if (t_1 <= -Double.POSITIVE_INFINITY) {
tmp = (a * ((y / t_2) + (t / t_2))) + (x / ((x + t) / z));
} else if (t_1 <= 1e+287) {
tmp = t_1;
} else {
tmp = z + (y / ((x + y) / (a - b)));
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = ((((y + t) * a) + (z * (x + y))) - (y * b)) / (y + (x + t)) t_2 = t + (x + y) tmp = 0 if t_1 <= -math.inf: tmp = (a * ((y / t_2) + (t / t_2))) + (x / ((x + t) / z)) elif t_1 <= 1e+287: tmp = t_1 else: tmp = z + (y / ((x + y) / (a - b))) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(Float64(Float64(y + t) * a) + Float64(z * Float64(x + y))) - Float64(y * b)) / Float64(y + Float64(x + t))) t_2 = Float64(t + Float64(x + y)) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = Float64(Float64(a * Float64(Float64(y / t_2) + Float64(t / t_2))) + Float64(x / Float64(Float64(x + t) / z))); elseif (t_1 <= 1e+287) tmp = t_1; else tmp = Float64(z + Float64(y / Float64(Float64(x + y) / Float64(a - b)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = ((((y + t) * a) + (z * (x + y))) - (y * b)) / (y + (x + t)); t_2 = t + (x + y); tmp = 0.0; if (t_1 <= -Inf) tmp = (a * ((y / t_2) + (t / t_2))) + (x / ((x + t) / z)); elseif (t_1 <= 1e+287) tmp = t_1; else tmp = z + (y / ((x + y) / (a - b))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(N[(N[(y + t), $MachinePrecision] * a), $MachinePrecision] + N[(z * N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t + N[(x + y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(N[(a * N[(N[(y / t$95$2), $MachinePrecision] + N[(t / t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x / N[(N[(x + t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e+287], t$95$1, N[(z + N[(y / N[(N[(x + y), $MachinePrecision] / N[(a - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\left(\left(y + t\right) \cdot a + z \cdot \left(x + y\right)\right) - y \cdot b}{y + \left(x + t\right)}\\
t_2 := t + \left(x + y\right)\\
\mathbf{if}\;t_1 \leq -\infty:\\
\;\;\;\;a \cdot \left(\frac{y}{t_2} + \frac{t}{t_2}\right) + \frac{x}{\frac{x + t}{z}}\\
\mathbf{elif}\;t_1 \leq 10^{+287}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;z + \frac{y}{\frac{x + y}{a - b}}\\
\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 6.5%
Taylor expanded in a around 0 45.4%
associate--l+45.4%
+-commutative45.4%
+-commutative45.4%
+-commutative45.4%
div-sub45.4%
+-commutative45.4%
*-commutative45.4%
+-commutative45.4%
Simplified45.4%
Taylor expanded in y around 0 52.0%
associate-/l*76.4%
Simplified76.4%
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.0000000000000001e287Initial program 99.7%
if 1.0000000000000001e287 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 5.2%
Taylor expanded in t around 0 8.4%
sub-neg8.4%
+-commutative8.4%
associate-+r+8.4%
+-commutative8.4%
sub-neg8.4%
distribute-rgt-out--8.9%
+-commutative8.9%
+-commutative8.9%
Simplified8.9%
Taylor expanded in z around 0 29.6%
associate-/l*79.8%
+-commutative79.8%
Simplified79.8%
Final simplification90.0%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ a (/ x (/ (+ x t) z)))))
(if (<= t -5.2e+51)
t_1
(if (<= t 2e+40)
(+ z (/ y (/ (+ x y) (- a b))))
(if (or (<= t 5.8e+149) (not (<= t 1.02e+245)))
t_1
(+ a (- (/ y (/ t z)) (/ b (/ t y)))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = a + (x / ((x + t) / z));
double tmp;
if (t <= -5.2e+51) {
tmp = t_1;
} else if (t <= 2e+40) {
tmp = z + (y / ((x + y) / (a - b)));
} else if ((t <= 5.8e+149) || !(t <= 1.02e+245)) {
tmp = t_1;
} else {
tmp = a + ((y / (t / z)) - (b / (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 = a + (x / ((x + t) / z))
if (t <= (-5.2d+51)) then
tmp = t_1
else if (t <= 2d+40) then
tmp = z + (y / ((x + y) / (a - b)))
else if ((t <= 5.8d+149) .or. (.not. (t <= 1.02d+245))) then
tmp = t_1
else
tmp = a + ((y / (t / z)) - (b / (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 = a + (x / ((x + t) / z));
double tmp;
if (t <= -5.2e+51) {
tmp = t_1;
} else if (t <= 2e+40) {
tmp = z + (y / ((x + y) / (a - b)));
} else if ((t <= 5.8e+149) || !(t <= 1.02e+245)) {
tmp = t_1;
} else {
tmp = a + ((y / (t / z)) - (b / (t / y)));
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = a + (x / ((x + t) / z)) tmp = 0 if t <= -5.2e+51: tmp = t_1 elif t <= 2e+40: tmp = z + (y / ((x + y) / (a - b))) elif (t <= 5.8e+149) or not (t <= 1.02e+245): tmp = t_1 else: tmp = a + ((y / (t / z)) - (b / (t / y))) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(a + Float64(x / Float64(Float64(x + t) / z))) tmp = 0.0 if (t <= -5.2e+51) tmp = t_1; elseif (t <= 2e+40) tmp = Float64(z + Float64(y / Float64(Float64(x + y) / Float64(a - b)))); elseif ((t <= 5.8e+149) || !(t <= 1.02e+245)) tmp = t_1; else tmp = Float64(a + Float64(Float64(y / Float64(t / z)) - Float64(b / Float64(t / y)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = a + (x / ((x + t) / z)); tmp = 0.0; if (t <= -5.2e+51) tmp = t_1; elseif (t <= 2e+40) tmp = z + (y / ((x + y) / (a - b))); elseif ((t <= 5.8e+149) || ~((t <= 1.02e+245))) tmp = t_1; else tmp = a + ((y / (t / z)) - (b / (t / y))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(a + N[(x / N[(N[(x + t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -5.2e+51], t$95$1, If[LessEqual[t, 2e+40], N[(z + N[(y / N[(N[(x + y), $MachinePrecision] / N[(a - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[t, 5.8e+149], N[Not[LessEqual[t, 1.02e+245]], $MachinePrecision]], t$95$1, N[(a + N[(N[(y / N[(t / z), $MachinePrecision]), $MachinePrecision] - N[(b / N[(t / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a + \frac{x}{\frac{x + t}{z}}\\
\mathbf{if}\;t \leq -5.2 \cdot 10^{+51}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 2 \cdot 10^{+40}:\\
\;\;\;\;z + \frac{y}{\frac{x + y}{a - b}}\\
\mathbf{elif}\;t \leq 5.8 \cdot 10^{+149} \lor \neg \left(t \leq 1.02 \cdot 10^{+245}\right):\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;a + \left(\frac{y}{\frac{t}{z}} - \frac{b}{\frac{t}{y}}\right)\\
\end{array}
\end{array}
if t < -5.2000000000000002e51 or 2.00000000000000006e40 < t < 5.8000000000000004e149 or 1.01999999999999997e245 < t Initial program 53.4%
Taylor expanded in a around 0 76.3%
associate--l+76.3%
+-commutative76.3%
+-commutative76.3%
+-commutative76.3%
div-sub76.3%
+-commutative76.3%
*-commutative76.3%
+-commutative76.3%
Simplified76.3%
Taylor expanded in y around 0 69.3%
associate-/l*80.9%
Simplified80.9%
Taylor expanded in y around inf 75.2%
if -5.2000000000000002e51 < t < 2.00000000000000006e40Initial program 63.2%
Taylor expanded in t around 0 51.8%
sub-neg51.8%
+-commutative51.8%
associate-+r+51.8%
+-commutative51.8%
sub-neg51.8%
distribute-rgt-out--51.9%
+-commutative51.9%
+-commutative51.9%
Simplified51.9%
Taylor expanded in z around 0 63.7%
associate-/l*84.5%
+-commutative84.5%
Simplified84.5%
if 5.8000000000000004e149 < t < 1.01999999999999997e245Initial program 38.7%
Taylor expanded in t around inf 42.8%
associate-+r+42.8%
associate-/l*43.4%
+-commutative43.4%
associate-/l*54.7%
+-commutative54.7%
associate-/l*71.5%
Simplified71.5%
Taylor expanded in x around 0 60.3%
associate--l+60.3%
associate-/l*60.7%
associate-/l*77.5%
Simplified77.5%
Final simplification80.6%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ a (/ x (/ (+ x t) z)))))
(if (<= x -6.5e+37)
(+ z (/ y (/ x (- a b))))
(if (<= x -7.5e-192)
t_1
(if (<= x 2.9e-58)
(- (+ z a) b)
(if (<= x 5.1e+135) t_1 (+ z (* y (- (/ a x) (/ b x))))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = a + (x / ((x + t) / z));
double tmp;
if (x <= -6.5e+37) {
tmp = z + (y / (x / (a - b)));
} else if (x <= -7.5e-192) {
tmp = t_1;
} else if (x <= 2.9e-58) {
tmp = (z + a) - b;
} else if (x <= 5.1e+135) {
tmp = t_1;
} else {
tmp = z + (y * ((a / x) - (b / 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 + (x / ((x + t) / z))
if (x <= (-6.5d+37)) then
tmp = z + (y / (x / (a - b)))
else if (x <= (-7.5d-192)) then
tmp = t_1
else if (x <= 2.9d-58) then
tmp = (z + a) - b
else if (x <= 5.1d+135) then
tmp = t_1
else
tmp = z + (y * ((a / x) - (b / 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 + (x / ((x + t) / z));
double tmp;
if (x <= -6.5e+37) {
tmp = z + (y / (x / (a - b)));
} else if (x <= -7.5e-192) {
tmp = t_1;
} else if (x <= 2.9e-58) {
tmp = (z + a) - b;
} else if (x <= 5.1e+135) {
tmp = t_1;
} else {
tmp = z + (y * ((a / x) - (b / x)));
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = a + (x / ((x + t) / z)) tmp = 0 if x <= -6.5e+37: tmp = z + (y / (x / (a - b))) elif x <= -7.5e-192: tmp = t_1 elif x <= 2.9e-58: tmp = (z + a) - b elif x <= 5.1e+135: tmp = t_1 else: tmp = z + (y * ((a / x) - (b / x))) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(a + Float64(x / Float64(Float64(x + t) / z))) tmp = 0.0 if (x <= -6.5e+37) tmp = Float64(z + Float64(y / Float64(x / Float64(a - b)))); elseif (x <= -7.5e-192) tmp = t_1; elseif (x <= 2.9e-58) tmp = Float64(Float64(z + a) - b); elseif (x <= 5.1e+135) tmp = t_1; else tmp = Float64(z + Float64(y * Float64(Float64(a / x) - Float64(b / x)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = a + (x / ((x + t) / z)); tmp = 0.0; if (x <= -6.5e+37) tmp = z + (y / (x / (a - b))); elseif (x <= -7.5e-192) tmp = t_1; elseif (x <= 2.9e-58) tmp = (z + a) - b; elseif (x <= 5.1e+135) tmp = t_1; else tmp = z + (y * ((a / x) - (b / x))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(a + N[(x / N[(N[(x + t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -6.5e+37], N[(z + N[(y / N[(x / N[(a - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -7.5e-192], t$95$1, If[LessEqual[x, 2.9e-58], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision], If[LessEqual[x, 5.1e+135], t$95$1, N[(z + N[(y * N[(N[(a / x), $MachinePrecision] - N[(b / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a + \frac{x}{\frac{x + t}{z}}\\
\mathbf{if}\;x \leq -6.5 \cdot 10^{+37}:\\
\;\;\;\;z + \frac{y}{\frac{x}{a - b}}\\
\mathbf{elif}\;x \leq -7.5 \cdot 10^{-192}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 2.9 \cdot 10^{-58}:\\
\;\;\;\;\left(z + a\right) - b\\
\mathbf{elif}\;x \leq 5.1 \cdot 10^{+135}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;z + y \cdot \left(\frac{a}{x} - \frac{b}{x}\right)\\
\end{array}
\end{array}
if x < -6.4999999999999998e37Initial program 49.7%
Taylor expanded in t around 0 35.3%
sub-neg35.3%
+-commutative35.3%
associate-+r+35.3%
+-commutative35.3%
sub-neg35.3%
distribute-rgt-out--35.5%
+-commutative35.5%
+-commutative35.5%
Simplified35.5%
Taylor expanded in x around inf 54.4%
associate-/l*62.6%
Simplified62.6%
if -6.4999999999999998e37 < x < -7.5000000000000001e-192 or 2.8999999999999999e-58 < x < 5.09999999999999982e135Initial program 61.1%
Taylor expanded in a around 0 85.2%
associate--l+85.2%
+-commutative85.2%
+-commutative85.2%
+-commutative85.2%
div-sub85.2%
+-commutative85.2%
*-commutative85.2%
+-commutative85.2%
Simplified85.2%
Taylor expanded in y around 0 78.2%
associate-/l*79.3%
Simplified79.3%
Taylor expanded in y around inf 76.3%
if -7.5000000000000001e-192 < x < 2.8999999999999999e-58Initial program 62.4%
Taylor expanded in y around inf 73.7%
if 5.09999999999999982e135 < x Initial program 52.8%
Taylor expanded in t around 0 45.0%
sub-neg45.0%
+-commutative45.0%
associate-+r+45.0%
+-commutative45.0%
sub-neg45.0%
distribute-rgt-out--45.1%
+-commutative45.1%
+-commutative45.1%
Simplified45.1%
Taylor expanded in y around 0 82.0%
Final simplification74.1%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ a (/ x (/ (+ x t) z)))) (t_2 (+ z (/ y (/ x (- a b))))))
(if (<= x -6.5e+37)
t_2
(if (<= x -4.4e-191)
t_1
(if (<= x 1e-58) (- (+ z a) b) (if (<= x 9.2e+134) t_1 t_2))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = a + (x / ((x + t) / z));
double t_2 = z + (y / (x / (a - b)));
double tmp;
if (x <= -6.5e+37) {
tmp = t_2;
} else if (x <= -4.4e-191) {
tmp = t_1;
} else if (x <= 1e-58) {
tmp = (z + a) - b;
} else if (x <= 9.2e+134) {
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 + (x / ((x + t) / z))
t_2 = z + (y / (x / (a - b)))
if (x <= (-6.5d+37)) then
tmp = t_2
else if (x <= (-4.4d-191)) then
tmp = t_1
else if (x <= 1d-58) then
tmp = (z + a) - b
else if (x <= 9.2d+134) 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 + (x / ((x + t) / z));
double t_2 = z + (y / (x / (a - b)));
double tmp;
if (x <= -6.5e+37) {
tmp = t_2;
} else if (x <= -4.4e-191) {
tmp = t_1;
} else if (x <= 1e-58) {
tmp = (z + a) - b;
} else if (x <= 9.2e+134) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = a + (x / ((x + t) / z)) t_2 = z + (y / (x / (a - b))) tmp = 0 if x <= -6.5e+37: tmp = t_2 elif x <= -4.4e-191: tmp = t_1 elif x <= 1e-58: tmp = (z + a) - b elif x <= 9.2e+134: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(a + Float64(x / Float64(Float64(x + t) / z))) t_2 = Float64(z + Float64(y / Float64(x / Float64(a - b)))) tmp = 0.0 if (x <= -6.5e+37) tmp = t_2; elseif (x <= -4.4e-191) tmp = t_1; elseif (x <= 1e-58) tmp = Float64(Float64(z + a) - b); elseif (x <= 9.2e+134) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = a + (x / ((x + t) / z)); t_2 = z + (y / (x / (a - b))); tmp = 0.0; if (x <= -6.5e+37) tmp = t_2; elseif (x <= -4.4e-191) tmp = t_1; elseif (x <= 1e-58) tmp = (z + a) - b; elseif (x <= 9.2e+134) 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 + N[(x / N[(N[(x + t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(z + N[(y / N[(x / N[(a - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -6.5e+37], t$95$2, If[LessEqual[x, -4.4e-191], t$95$1, If[LessEqual[x, 1e-58], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision], If[LessEqual[x, 9.2e+134], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a + \frac{x}{\frac{x + t}{z}}\\
t_2 := z + \frac{y}{\frac{x}{a - b}}\\
\mathbf{if}\;x \leq -6.5 \cdot 10^{+37}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq -4.4 \cdot 10^{-191}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 10^{-58}:\\
\;\;\;\;\left(z + a\right) - b\\
\mathbf{elif}\;x \leq 9.2 \cdot 10^{+134}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if x < -6.4999999999999998e37 or 9.1999999999999992e134 < x Initial program 51.2%
Taylor expanded in t around 0 40.0%
sub-neg40.0%
+-commutative40.0%
associate-+r+40.0%
+-commutative40.0%
sub-neg40.0%
distribute-rgt-out--40.2%
+-commutative40.2%
+-commutative40.2%
Simplified40.2%
Taylor expanded in x around inf 59.9%
associate-/l*71.4%
Simplified71.4%
if -6.4999999999999998e37 < x < -4.39999999999999996e-191 or 1e-58 < x < 9.1999999999999992e134Initial program 61.1%
Taylor expanded in a around 0 85.2%
associate--l+85.2%
+-commutative85.2%
+-commutative85.2%
+-commutative85.2%
div-sub85.2%
+-commutative85.2%
*-commutative85.2%
+-commutative85.2%
Simplified85.2%
Taylor expanded in y around 0 78.2%
associate-/l*79.3%
Simplified79.3%
Taylor expanded in y around inf 76.3%
if -4.39999999999999996e-191 < x < 1e-58Initial program 62.4%
Taylor expanded in y around inf 73.7%
Final simplification73.9%
(FPCore (x y z t a b) :precision binary64 (if (or (<= t -2.2e+51) (not (<= t 6.5e+39))) (+ a (/ x (/ (+ x t) z))) (+ z (/ y (/ (+ x y) (- a b))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -2.2e+51) || !(t <= 6.5e+39)) {
tmp = a + (x / ((x + t) / z));
} else {
tmp = z + (y / ((x + y) / (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 ((t <= (-2.2d+51)) .or. (.not. (t <= 6.5d+39))) then
tmp = a + (x / ((x + t) / z))
else
tmp = z + (y / ((x + y) / (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 ((t <= -2.2e+51) || !(t <= 6.5e+39)) {
tmp = a + (x / ((x + t) / z));
} else {
tmp = z + (y / ((x + y) / (a - b)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (t <= -2.2e+51) or not (t <= 6.5e+39): tmp = a + (x / ((x + t) / z)) else: tmp = z + (y / ((x + y) / (a - b))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((t <= -2.2e+51) || !(t <= 6.5e+39)) tmp = Float64(a + Float64(x / Float64(Float64(x + t) / z))); else tmp = Float64(z + Float64(y / Float64(Float64(x + y) / Float64(a - b)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((t <= -2.2e+51) || ~((t <= 6.5e+39))) tmp = a + (x / ((x + t) / z)); else tmp = z + (y / ((x + y) / (a - b))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[t, -2.2e+51], N[Not[LessEqual[t, 6.5e+39]], $MachinePrecision]], N[(a + N[(x / N[(N[(x + t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z + N[(y / N[(N[(x + y), $MachinePrecision] / N[(a - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.2 \cdot 10^{+51} \lor \neg \left(t \leq 6.5 \cdot 10^{+39}\right):\\
\;\;\;\;a + \frac{x}{\frac{x + t}{z}}\\
\mathbf{else}:\\
\;\;\;\;z + \frac{y}{\frac{x + y}{a - b}}\\
\end{array}
\end{array}
if t < -2.19999999999999992e51 or 6.5000000000000001e39 < t Initial program 51.2%
Taylor expanded in a around 0 75.6%
associate--l+75.6%
+-commutative75.6%
+-commutative75.6%
+-commutative75.6%
div-sub75.6%
+-commutative75.6%
*-commutative75.6%
+-commutative75.6%
Simplified75.6%
Taylor expanded in y around 0 68.7%
associate-/l*78.6%
Simplified78.6%
Taylor expanded in y around inf 71.9%
if -2.19999999999999992e51 < t < 6.5000000000000001e39Initial program 63.2%
Taylor expanded in t around 0 51.8%
sub-neg51.8%
+-commutative51.8%
associate-+r+51.8%
+-commutative51.8%
sub-neg51.8%
distribute-rgt-out--51.9%
+-commutative51.9%
+-commutative51.9%
Simplified51.9%
Taylor expanded in z around 0 63.7%
associate-/l*84.5%
+-commutative84.5%
Simplified84.5%
Final simplification79.0%
(FPCore (x y z t a b) :precision binary64 (if (or (<= t -4.8e-141) (not (<= t 2.9e+38))) (+ a (/ x (/ (+ x t) z))) (- (+ z a) b)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -4.8e-141) || !(t <= 2.9e+38)) {
tmp = a + (x / ((x + t) / z));
} else {
tmp = (z + 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 ((t <= (-4.8d-141)) .or. (.not. (t <= 2.9d+38))) then
tmp = a + (x / ((x + t) / z))
else
tmp = (z + 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 ((t <= -4.8e-141) || !(t <= 2.9e+38)) {
tmp = a + (x / ((x + t) / z));
} else {
tmp = (z + a) - b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (t <= -4.8e-141) or not (t <= 2.9e+38): tmp = a + (x / ((x + t) / z)) else: tmp = (z + a) - b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((t <= -4.8e-141) || !(t <= 2.9e+38)) tmp = Float64(a + Float64(x / Float64(Float64(x + t) / z))); else tmp = Float64(Float64(z + a) - b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((t <= -4.8e-141) || ~((t <= 2.9e+38))) tmp = a + (x / ((x + t) / z)); else tmp = (z + a) - b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[t, -4.8e-141], N[Not[LessEqual[t, 2.9e+38]], $MachinePrecision]], N[(a + N[(x / N[(N[(x + t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4.8 \cdot 10^{-141} \lor \neg \left(t \leq 2.9 \cdot 10^{+38}\right):\\
\;\;\;\;a + \frac{x}{\frac{x + t}{z}}\\
\mathbf{else}:\\
\;\;\;\;\left(z + a\right) - b\\
\end{array}
\end{array}
if t < -4.8000000000000002e-141 or 2.90000000000000007e38 < t Initial program 56.7%
Taylor expanded in a around 0 76.8%
associate--l+76.8%
+-commutative76.8%
+-commutative76.8%
+-commutative76.8%
div-sub76.8%
+-commutative76.8%
*-commutative76.8%
+-commutative76.8%
Simplified76.8%
Taylor expanded in y around 0 67.0%
associate-/l*75.5%
Simplified75.5%
Taylor expanded in y around inf 66.5%
if -4.8000000000000002e-141 < t < 2.90000000000000007e38Initial program 59.9%
Taylor expanded in y around inf 69.0%
Final simplification67.5%
(FPCore (x y z t a b) :precision binary64 (if (<= x -5e+35) z (if (<= x 165000.0) a (if (<= x 2.3e+40) z (if (<= x 1.8e+162) a z)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -5e+35) {
tmp = z;
} else if (x <= 165000.0) {
tmp = a;
} else if (x <= 2.3e+40) {
tmp = z;
} else if (x <= 1.8e+162) {
tmp = a;
} else {
tmp = 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 (x <= (-5d+35)) then
tmp = z
else if (x <= 165000.0d0) then
tmp = a
else if (x <= 2.3d+40) then
tmp = z
else if (x <= 1.8d+162) then
tmp = a
else
tmp = 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 (x <= -5e+35) {
tmp = z;
} else if (x <= 165000.0) {
tmp = a;
} else if (x <= 2.3e+40) {
tmp = z;
} else if (x <= 1.8e+162) {
tmp = a;
} else {
tmp = z;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= -5e+35: tmp = z elif x <= 165000.0: tmp = a elif x <= 2.3e+40: tmp = z elif x <= 1.8e+162: tmp = a else: tmp = z return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -5e+35) tmp = z; elseif (x <= 165000.0) tmp = a; elseif (x <= 2.3e+40) tmp = z; elseif (x <= 1.8e+162) tmp = a; else tmp = z; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (x <= -5e+35) tmp = z; elseif (x <= 165000.0) tmp = a; elseif (x <= 2.3e+40) tmp = z; elseif (x <= 1.8e+162) tmp = a; else tmp = z; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -5e+35], z, If[LessEqual[x, 165000.0], a, If[LessEqual[x, 2.3e+40], z, If[LessEqual[x, 1.8e+162], a, z]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -5 \cdot 10^{+35}:\\
\;\;\;\;z\\
\mathbf{elif}\;x \leq 165000:\\
\;\;\;\;a\\
\mathbf{elif}\;x \leq 2.3 \cdot 10^{+40}:\\
\;\;\;\;z\\
\mathbf{elif}\;x \leq 1.8 \cdot 10^{+162}:\\
\;\;\;\;a\\
\mathbf{else}:\\
\;\;\;\;z\\
\end{array}
\end{array}
if x < -5.00000000000000021e35 or 165000 < x < 2.29999999999999994e40 or 1.79999999999999997e162 < x Initial program 51.7%
Taylor expanded in x around inf 53.5%
if -5.00000000000000021e35 < x < 165000 or 2.29999999999999994e40 < x < 1.79999999999999997e162Initial program 61.7%
Taylor expanded in t around inf 53.4%
Final simplification53.4%
(FPCore (x y z t a b) :precision binary64 (if (<= x -1.85e+108) z (if (<= x 1.45e+162) (- (+ z a) b) z)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -1.85e+108) {
tmp = z;
} else if (x <= 1.45e+162) {
tmp = (z + a) - b;
} else {
tmp = 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 (x <= (-1.85d+108)) then
tmp = z
else if (x <= 1.45d+162) then
tmp = (z + a) - b
else
tmp = 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 (x <= -1.85e+108) {
tmp = z;
} else if (x <= 1.45e+162) {
tmp = (z + a) - b;
} else {
tmp = z;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= -1.85e+108: tmp = z elif x <= 1.45e+162: tmp = (z + a) - b else: tmp = z return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -1.85e+108) tmp = z; elseif (x <= 1.45e+162) tmp = Float64(Float64(z + a) - b); else tmp = z; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (x <= -1.85e+108) tmp = z; elseif (x <= 1.45e+162) tmp = (z + a) - b; else tmp = z; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -1.85e+108], z, If[LessEqual[x, 1.45e+162], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision], z]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.85 \cdot 10^{+108}:\\
\;\;\;\;z\\
\mathbf{elif}\;x \leq 1.45 \cdot 10^{+162}:\\
\;\;\;\;\left(z + a\right) - b\\
\mathbf{else}:\\
\;\;\;\;z\\
\end{array}
\end{array}
if x < -1.8499999999999999e108 or 1.45000000000000003e162 < x Initial program 50.8%
Taylor expanded in x around inf 54.0%
if -1.8499999999999999e108 < x < 1.45000000000000003e162Initial program 61.0%
Taylor expanded in y around inf 64.7%
Final simplification61.5%
(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 58.0%
Taylor expanded in t around inf 35.4%
Final simplification35.4%
(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 2023320
(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)))