
(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 (+ t (+ x y)))
(t_2 (+ y (+ x t)))
(t_3 (/ (- (+ (* (+ y t) a) (* z (+ x y))) (* y b)) t_2)))
(if (or (<= t_3 (- INFINITY)) (not (<= t_3 2e+255)))
(+ (* a (+ (/ y t_1) (/ t t_1))) (/ z (/ t_2 (+ x y))))
t_3)))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = t + (x + y);
double t_2 = y + (x + t);
double t_3 = ((((y + t) * a) + (z * (x + y))) - (y * b)) / t_2;
double tmp;
if ((t_3 <= -((double) INFINITY)) || !(t_3 <= 2e+255)) {
tmp = (a * ((y / t_1) + (t / t_1))) + (z / (t_2 / (x + y)));
} else {
tmp = t_3;
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = t + (x + y);
double t_2 = y + (x + t);
double t_3 = ((((y + t) * a) + (z * (x + y))) - (y * b)) / t_2;
double tmp;
if ((t_3 <= -Double.POSITIVE_INFINITY) || !(t_3 <= 2e+255)) {
tmp = (a * ((y / t_1) + (t / t_1))) + (z / (t_2 / (x + y)));
} else {
tmp = t_3;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = t + (x + y) t_2 = y + (x + t) t_3 = ((((y + t) * a) + (z * (x + y))) - (y * b)) / t_2 tmp = 0 if (t_3 <= -math.inf) or not (t_3 <= 2e+255): tmp = (a * ((y / t_1) + (t / t_1))) + (z / (t_2 / (x + y))) else: tmp = t_3 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(t + Float64(x + y)) t_2 = Float64(y + Float64(x + t)) t_3 = Float64(Float64(Float64(Float64(Float64(y + t) * a) + Float64(z * Float64(x + y))) - Float64(y * b)) / t_2) tmp = 0.0 if ((t_3 <= Float64(-Inf)) || !(t_3 <= 2e+255)) tmp = Float64(Float64(a * Float64(Float64(y / t_1) + Float64(t / t_1))) + Float64(z / Float64(t_2 / Float64(x + y)))); else tmp = t_3; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = t + (x + y); t_2 = y + (x + t); t_3 = ((((y + t) * a) + (z * (x + y))) - (y * b)) / t_2; tmp = 0.0; if ((t_3 <= -Inf) || ~((t_3 <= 2e+255))) tmp = (a * ((y / t_1) + (t / t_1))) + (z / (t_2 / (x + y))); else tmp = t_3; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(t + N[(x + y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(N[(N[(y + t), $MachinePrecision] * a), $MachinePrecision] + N[(z * N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / t$95$2), $MachinePrecision]}, If[Or[LessEqual[t$95$3, (-Infinity)], N[Not[LessEqual[t$95$3, 2e+255]], $MachinePrecision]], N[(N[(a * N[(N[(y / t$95$1), $MachinePrecision] + N[(t / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(z / N[(t$95$2 / N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$3]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t + \left(x + y\right)\\
t_2 := y + \left(x + t\right)\\
t_3 := \frac{\left(\left(y + t\right) \cdot a + z \cdot \left(x + y\right)\right) - y \cdot b}{t_2}\\
\mathbf{if}\;t_3 \leq -\infty \lor \neg \left(t_3 \leq 2 \cdot 10^{+255}\right):\\
\;\;\;\;a \cdot \left(\frac{y}{t_1} + \frac{t}{t_1}\right) + \frac{z}{\frac{t_2}{x + y}}\\
\mathbf{else}:\\
\;\;\;\;t_3\\
\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.99999999999999998e255 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 11.5%
Taylor expanded in a around 0 35.8%
associate--l+35.8%
+-commutative35.8%
+-commutative35.8%
+-commutative35.8%
div-sub35.8%
+-commutative35.8%
*-commutative35.8%
+-commutative35.8%
Simplified35.8%
Taylor expanded in z around inf 39.4%
associate-/l*85.1%
+-commutative85.1%
+-commutative85.1%
+-commutative85.1%
associate-+r+85.1%
+-commutative85.1%
Simplified85.1%
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.99999999999999998e255Initial program 99.8%
Final simplification93.7%
(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+278)))
(+ a (/ z (+ 1.0 (/ t (+ x y)))))
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+278)) {
tmp = a + (z / (1.0 + (t / (x + y))));
} 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+278)) {
tmp = a + (z / (1.0 + (t / (x + y))));
} 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+278): tmp = a + (z / (1.0 + (t / (x + y)))) 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+278)) tmp = Float64(a + Float64(z / Float64(1.0 + Float64(t / Float64(x + y))))); 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+278))) tmp = a + (z / (1.0 + (t / (x + y)))); 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+278]], $MachinePrecision]], N[(a + N[(z / N[(1.0 + N[(t / N[(x + y), $MachinePrecision]), $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^{+278}\right):\\
\;\;\;\;a + \frac{z}{1 + \frac{t}{x + y}}\\
\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 9.99999999999999964e277 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 8.0%
Taylor expanded in a around 0 33.3%
associate--l+33.3%
+-commutative33.3%
+-commutative33.3%
+-commutative33.3%
div-sub33.3%
+-commutative33.3%
*-commutative33.3%
+-commutative33.3%
Simplified33.3%
Taylor expanded in z around inf 37.0%
associate-/l*84.5%
+-commutative84.5%
+-commutative84.5%
+-commutative84.5%
associate-+r+84.5%
+-commutative84.5%
Simplified84.5%
Taylor expanded in y around inf 77.8%
Taylor expanded in t around 0 77.8%
if -inf.0 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 9.99999999999999964e277Initial program 99.7%
Final simplification91.0%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -2.6e-220) (not (<= z 3.8e-16))) (+ a (/ z (+ 1.0 (/ t (+ x y))))) (/ (+ (* y (- a b)) (* z (+ x y))) (+ x y))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -2.6e-220) || !(z <= 3.8e-16)) {
tmp = a + (z / (1.0 + (t / (x + y))));
} else {
tmp = ((y * (a - b)) + (z * (x + y))) / (x + y);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((z <= (-2.6d-220)) .or. (.not. (z <= 3.8d-16))) then
tmp = a + (z / (1.0d0 + (t / (x + y))))
else
tmp = ((y * (a - b)) + (z * (x + y))) / (x + y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -2.6e-220) || !(z <= 3.8e-16)) {
tmp = a + (z / (1.0 + (t / (x + y))));
} else {
tmp = ((y * (a - b)) + (z * (x + y))) / (x + y);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -2.6e-220) or not (z <= 3.8e-16): tmp = a + (z / (1.0 + (t / (x + y)))) else: tmp = ((y * (a - b)) + (z * (x + y))) / (x + y) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -2.6e-220) || !(z <= 3.8e-16)) tmp = Float64(a + Float64(z / Float64(1.0 + Float64(t / Float64(x + y))))); else tmp = Float64(Float64(Float64(y * Float64(a - b)) + Float64(z * Float64(x + y))) / Float64(x + y)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((z <= -2.6e-220) || ~((z <= 3.8e-16))) tmp = a + (z / (1.0 + (t / (x + y)))); else tmp = ((y * (a - b)) + (z * (x + y))) / (x + y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -2.6e-220], N[Not[LessEqual[z, 3.8e-16]], $MachinePrecision]], N[(a + N[(z / N[(1.0 + N[(t / N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(y * N[(a - b), $MachinePrecision]), $MachinePrecision] + N[(z * N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.6 \cdot 10^{-220} \lor \neg \left(z \leq 3.8 \cdot 10^{-16}\right):\\
\;\;\;\;a + \frac{z}{1 + \frac{t}{x + y}}\\
\mathbf{else}:\\
\;\;\;\;\frac{y \cdot \left(a - b\right) + z \cdot \left(x + y\right)}{x + y}\\
\end{array}
\end{array}
if z < -2.6e-220 or 3.80000000000000012e-16 < z Initial program 56.2%
Taylor expanded in a around 0 65.3%
associate--l+65.3%
+-commutative65.3%
+-commutative65.3%
+-commutative65.3%
div-sub65.2%
+-commutative65.2%
*-commutative65.2%
+-commutative65.2%
Simplified65.2%
Taylor expanded in z around inf 57.9%
associate-/l*84.8%
+-commutative84.8%
+-commutative84.8%
+-commutative84.8%
associate-+r+84.8%
+-commutative84.8%
Simplified84.8%
Taylor expanded in y around inf 77.4%
Taylor expanded in t around 0 77.4%
if -2.6e-220 < z < 3.80000000000000012e-16Initial program 79.8%
Taylor expanded in t around 0 65.1%
sub-neg65.1%
+-commutative65.1%
associate-+r+65.1%
+-commutative65.1%
sub-neg65.1%
distribute-rgt-out--65.3%
+-commutative65.3%
+-commutative65.3%
Simplified65.3%
Final simplification73.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (- (+ z a) b)) (t_2 (/ t (+ x y))) (t_3 (/ z (+ 1.0 t_2))))
(if (<= x -8.5e+67)
t_3
(if (<= x 5.5e-275)
t_1
(if (<= x 3.4e-174) (+ a (/ z t_2)) (if (<= x 1.05e+143) t_1 t_3))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (z + a) - b;
double t_2 = t / (x + y);
double t_3 = z / (1.0 + t_2);
double tmp;
if (x <= -8.5e+67) {
tmp = t_3;
} else if (x <= 5.5e-275) {
tmp = t_1;
} else if (x <= 3.4e-174) {
tmp = a + (z / t_2);
} else if (x <= 1.05e+143) {
tmp = t_1;
} else {
tmp = t_3;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = (z + a) - b
t_2 = t / (x + y)
t_3 = z / (1.0d0 + t_2)
if (x <= (-8.5d+67)) then
tmp = t_3
else if (x <= 5.5d-275) then
tmp = t_1
else if (x <= 3.4d-174) then
tmp = a + (z / t_2)
else if (x <= 1.05d+143) then
tmp = t_1
else
tmp = t_3
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (z + a) - b;
double t_2 = t / (x + y);
double t_3 = z / (1.0 + t_2);
double tmp;
if (x <= -8.5e+67) {
tmp = t_3;
} else if (x <= 5.5e-275) {
tmp = t_1;
} else if (x <= 3.4e-174) {
tmp = a + (z / t_2);
} else if (x <= 1.05e+143) {
tmp = t_1;
} else {
tmp = t_3;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (z + a) - b t_2 = t / (x + y) t_3 = z / (1.0 + t_2) tmp = 0 if x <= -8.5e+67: tmp = t_3 elif x <= 5.5e-275: tmp = t_1 elif x <= 3.4e-174: tmp = a + (z / t_2) elif x <= 1.05e+143: tmp = t_1 else: tmp = t_3 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(z + a) - b) t_2 = Float64(t / Float64(x + y)) t_3 = Float64(z / Float64(1.0 + t_2)) tmp = 0.0 if (x <= -8.5e+67) tmp = t_3; elseif (x <= 5.5e-275) tmp = t_1; elseif (x <= 3.4e-174) tmp = Float64(a + Float64(z / t_2)); elseif (x <= 1.05e+143) tmp = t_1; else tmp = t_3; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (z + a) - b; t_2 = t / (x + y); t_3 = z / (1.0 + t_2); tmp = 0.0; if (x <= -8.5e+67) tmp = t_3; elseif (x <= 5.5e-275) tmp = t_1; elseif (x <= 3.4e-174) tmp = a + (z / t_2); elseif (x <= 1.05e+143) tmp = t_1; else tmp = t_3; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision]}, Block[{t$95$2 = N[(t / N[(x + y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(z / N[(1.0 + t$95$2), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -8.5e+67], t$95$3, If[LessEqual[x, 5.5e-275], t$95$1, If[LessEqual[x, 3.4e-174], N[(a + N[(z / t$95$2), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.05e+143], t$95$1, t$95$3]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(z + a\right) - b\\
t_2 := \frac{t}{x + y}\\
t_3 := \frac{z}{1 + t_2}\\
\mathbf{if}\;x \leq -8.5 \cdot 10^{+67}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;x \leq 5.5 \cdot 10^{-275}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 3.4 \cdot 10^{-174}:\\
\;\;\;\;a + \frac{z}{t_2}\\
\mathbf{elif}\;x \leq 1.05 \cdot 10^{+143}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_3\\
\end{array}
\end{array}
if x < -8.50000000000000038e67 or 1.04999999999999994e143 < x Initial program 55.6%
Taylor expanded in z around inf 37.0%
associate-/l*61.4%
+-commutative61.4%
+-commutative61.4%
Simplified61.4%
Taylor expanded in t around 0 61.4%
+-commutative61.4%
Simplified61.4%
if -8.50000000000000038e67 < x < 5.49999999999999988e-275 or 3.4000000000000002e-174 < x < 1.04999999999999994e143Initial program 66.7%
Taylor expanded in y around inf 66.3%
if 5.49999999999999988e-275 < x < 3.4000000000000002e-174Initial program 73.9%
Taylor expanded in a around 0 87.2%
associate--l+87.2%
+-commutative87.2%
+-commutative87.2%
+-commutative87.2%
div-sub87.2%
+-commutative87.2%
*-commutative87.2%
+-commutative87.2%
Simplified87.2%
Taylor expanded in z around inf 82.9%
associate-/l*86.9%
+-commutative86.9%
+-commutative86.9%
+-commutative86.9%
associate-+r+86.9%
+-commutative86.9%
Simplified86.9%
Taylor expanded in y around inf 82.4%
Taylor expanded in t around inf 69.5%
Final simplification64.8%
(FPCore (x y z t a b) :precision binary64 (if (or (<= x -1.65e+185) (not (<= x 3.4e+120))) (- (+ z (/ (* y a) x)) (/ (* y b) x)) (+ a (/ z (+ 1.0 (/ t (+ x y)))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((x <= -1.65e+185) || !(x <= 3.4e+120)) {
tmp = (z + ((y * a) / x)) - ((y * b) / x);
} else {
tmp = a + (z / (1.0 + (t / (x + y))));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((x <= (-1.65d+185)) .or. (.not. (x <= 3.4d+120))) then
tmp = (z + ((y * a) / x)) - ((y * b) / x)
else
tmp = a + (z / (1.0d0 + (t / (x + y))))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((x <= -1.65e+185) || !(x <= 3.4e+120)) {
tmp = (z + ((y * a) / x)) - ((y * b) / x);
} else {
tmp = a + (z / (1.0 + (t / (x + y))));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (x <= -1.65e+185) or not (x <= 3.4e+120): tmp = (z + ((y * a) / x)) - ((y * b) / x) else: tmp = a + (z / (1.0 + (t / (x + y)))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((x <= -1.65e+185) || !(x <= 3.4e+120)) tmp = Float64(Float64(z + Float64(Float64(y * a) / x)) - Float64(Float64(y * b) / x)); else tmp = Float64(a + Float64(z / Float64(1.0 + Float64(t / Float64(x + y))))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((x <= -1.65e+185) || ~((x <= 3.4e+120))) tmp = (z + ((y * a) / x)) - ((y * b) / x); else tmp = a + (z / (1.0 + (t / (x + y)))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[x, -1.65e+185], N[Not[LessEqual[x, 3.4e+120]], $MachinePrecision]], N[(N[(z + N[(N[(y * a), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] - N[(N[(y * b), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], N[(a + N[(z / N[(1.0 + N[(t / N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.65 \cdot 10^{+185} \lor \neg \left(x \leq 3.4 \cdot 10^{+120}\right):\\
\;\;\;\;\left(z + \frac{y \cdot a}{x}\right) - \frac{y \cdot b}{x}\\
\mathbf{else}:\\
\;\;\;\;a + \frac{z}{1 + \frac{t}{x + y}}\\
\end{array}
\end{array}
if x < -1.65000000000000006e185 or 3.39999999999999999e120 < x Initial program 57.2%
Taylor expanded in x around inf 64.0%
Taylor expanded in t around 0 64.3%
if -1.65000000000000006e185 < x < 3.39999999999999999e120Initial program 65.6%
Taylor expanded in a around 0 77.6%
associate--l+77.6%
+-commutative77.6%
+-commutative77.6%
+-commutative77.6%
div-sub77.6%
+-commutative77.6%
*-commutative77.6%
+-commutative77.6%
Simplified77.6%
Taylor expanded in z around inf 64.4%
associate-/l*81.7%
+-commutative81.7%
+-commutative81.7%
+-commutative81.7%
associate-+r+81.7%
+-commutative81.7%
Simplified81.7%
Taylor expanded in y around inf 74.5%
Taylor expanded in t around 0 74.5%
Final simplification71.5%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (- (+ z a) b)) (t_2 (/ z (/ (+ x t) x))))
(if (<= x -9e+138)
t_2
(if (<= x 5.5e-275)
t_1
(if (<= x 2.9e-173)
(+ a (/ z (/ t (+ x y))))
(if (<= x 1.15e+145) t_1 t_2))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (z + a) - b;
double t_2 = z / ((x + t) / x);
double tmp;
if (x <= -9e+138) {
tmp = t_2;
} else if (x <= 5.5e-275) {
tmp = t_1;
} else if (x <= 2.9e-173) {
tmp = a + (z / (t / (x + y)));
} else if (x <= 1.15e+145) {
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 + a) - b
t_2 = z / ((x + t) / x)
if (x <= (-9d+138)) then
tmp = t_2
else if (x <= 5.5d-275) then
tmp = t_1
else if (x <= 2.9d-173) then
tmp = a + (z / (t / (x + y)))
else if (x <= 1.15d+145) 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 + a) - b;
double t_2 = z / ((x + t) / x);
double tmp;
if (x <= -9e+138) {
tmp = t_2;
} else if (x <= 5.5e-275) {
tmp = t_1;
} else if (x <= 2.9e-173) {
tmp = a + (z / (t / (x + y)));
} else if (x <= 1.15e+145) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (z + a) - b t_2 = z / ((x + t) / x) tmp = 0 if x <= -9e+138: tmp = t_2 elif x <= 5.5e-275: tmp = t_1 elif x <= 2.9e-173: tmp = a + (z / (t / (x + y))) elif x <= 1.15e+145: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(z + a) - b) t_2 = Float64(z / Float64(Float64(x + t) / x)) tmp = 0.0 if (x <= -9e+138) tmp = t_2; elseif (x <= 5.5e-275) tmp = t_1; elseif (x <= 2.9e-173) tmp = Float64(a + Float64(z / Float64(t / Float64(x + y)))); elseif (x <= 1.15e+145) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (z + a) - b; t_2 = z / ((x + t) / x); tmp = 0.0; if (x <= -9e+138) tmp = t_2; elseif (x <= 5.5e-275) tmp = t_1; elseif (x <= 2.9e-173) tmp = a + (z / (t / (x + y))); elseif (x <= 1.15e+145) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision]}, Block[{t$95$2 = N[(z / N[(N[(x + t), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -9e+138], t$95$2, If[LessEqual[x, 5.5e-275], t$95$1, If[LessEqual[x, 2.9e-173], N[(a + N[(z / N[(t / N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.15e+145], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(z + a\right) - b\\
t_2 := \frac{z}{\frac{x + t}{x}}\\
\mathbf{if}\;x \leq -9 \cdot 10^{+138}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq 5.5 \cdot 10^{-275}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 2.9 \cdot 10^{-173}:\\
\;\;\;\;a + \frac{z}{\frac{t}{x + y}}\\
\mathbf{elif}\;x \leq 1.15 \cdot 10^{+145}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if x < -8.99999999999999963e138 or 1.15e145 < x Initial program 59.0%
Taylor expanded in z around inf 39.6%
associate-/l*60.3%
+-commutative60.3%
+-commutative60.3%
Simplified60.3%
Taylor expanded in y around 0 60.3%
if -8.99999999999999963e138 < x < 5.49999999999999988e-275 or 2.8999999999999998e-173 < x < 1.15e145Initial program 63.8%
Taylor expanded in y around inf 65.9%
if 5.49999999999999988e-275 < x < 2.8999999999999998e-173Initial program 73.9%
Taylor expanded in a around 0 87.2%
associate--l+87.2%
+-commutative87.2%
+-commutative87.2%
+-commutative87.2%
div-sub87.2%
+-commutative87.2%
*-commutative87.2%
+-commutative87.2%
Simplified87.2%
Taylor expanded in z around inf 82.9%
associate-/l*86.9%
+-commutative86.9%
+-commutative86.9%
+-commutative86.9%
associate-+r+86.9%
+-commutative86.9%
Simplified86.9%
Taylor expanded in y around inf 82.4%
Taylor expanded in t around inf 69.5%
Final simplification64.4%
(FPCore (x y z t a b)
:precision binary64
(if (<= b -4.1e+178)
(/ (- b) (/ (+ t (+ x y)) y))
(if (<= b -5.1e-77)
(- (+ z a) b)
(if (<= b -2.7e-243) (/ z (+ 1.0 (/ t (+ x y)))) (+ z a)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= -4.1e+178) {
tmp = -b / ((t + (x + y)) / y);
} else if (b <= -5.1e-77) {
tmp = (z + a) - b;
} else if (b <= -2.7e-243) {
tmp = z / (1.0 + (t / (x + y)));
} 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 (b <= (-4.1d+178)) then
tmp = -b / ((t + (x + y)) / y)
else if (b <= (-5.1d-77)) then
tmp = (z + a) - b
else if (b <= (-2.7d-243)) then
tmp = z / (1.0d0 + (t / (x + y)))
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 (b <= -4.1e+178) {
tmp = -b / ((t + (x + y)) / y);
} else if (b <= -5.1e-77) {
tmp = (z + a) - b;
} else if (b <= -2.7e-243) {
tmp = z / (1.0 + (t / (x + y)));
} else {
tmp = z + a;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if b <= -4.1e+178: tmp = -b / ((t + (x + y)) / y) elif b <= -5.1e-77: tmp = (z + a) - b elif b <= -2.7e-243: tmp = z / (1.0 + (t / (x + y))) else: tmp = z + a return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (b <= -4.1e+178) tmp = Float64(Float64(-b) / Float64(Float64(t + Float64(x + y)) / y)); elseif (b <= -5.1e-77) tmp = Float64(Float64(z + a) - b); elseif (b <= -2.7e-243) tmp = Float64(z / Float64(1.0 + Float64(t / Float64(x + y)))); else tmp = Float64(z + a); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (b <= -4.1e+178) tmp = -b / ((t + (x + y)) / y); elseif (b <= -5.1e-77) tmp = (z + a) - b; elseif (b <= -2.7e-243) tmp = z / (1.0 + (t / (x + y))); else tmp = z + a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[b, -4.1e+178], N[((-b) / N[(N[(t + N[(x + y), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, -5.1e-77], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision], If[LessEqual[b, -2.7e-243], N[(z / N[(1.0 + N[(t / N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z + a), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -4.1 \cdot 10^{+178}:\\
\;\;\;\;\frac{-b}{\frac{t + \left(x + y\right)}{y}}\\
\mathbf{elif}\;b \leq -5.1 \cdot 10^{-77}:\\
\;\;\;\;\left(z + a\right) - b\\
\mathbf{elif}\;b \leq -2.7 \cdot 10^{-243}:\\
\;\;\;\;\frac{z}{1 + \frac{t}{x + y}}\\
\mathbf{else}:\\
\;\;\;\;z + a\\
\end{array}
\end{array}
if b < -4.09999999999999996e178Initial program 57.2%
Taylor expanded in b around inf 29.0%
mul-1-neg29.0%
associate-/l*54.3%
distribute-neg-frac54.3%
+-commutative54.3%
Simplified54.3%
if -4.09999999999999996e178 < b < -5.10000000000000032e-77Initial program 61.2%
Taylor expanded in y around inf 67.3%
if -5.10000000000000032e-77 < b < -2.7000000000000001e-243Initial program 71.1%
Taylor expanded in z around inf 52.3%
associate-/l*71.0%
+-commutative71.0%
+-commutative71.0%
Simplified71.0%
Taylor expanded in t around 0 71.0%
+-commutative71.0%
Simplified71.0%
if -2.7000000000000001e-243 < b Initial program 62.7%
Taylor expanded in y around inf 58.3%
Taylor expanded in b around 0 62.1%
+-commutative62.1%
Simplified62.1%
Final simplification63.7%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -6.8e-126) (not (<= z 4.4e-148))) (+ a (/ z (+ 1.0 (/ t (+ x y))))) (/ a (/ (+ t (+ x y)) (+ y t)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -6.8e-126) || !(z <= 4.4e-148)) {
tmp = a + (z / (1.0 + (t / (x + y))));
} else {
tmp = a / ((t + (x + y)) / (y + 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 ((z <= (-6.8d-126)) .or. (.not. (z <= 4.4d-148))) then
tmp = a + (z / (1.0d0 + (t / (x + y))))
else
tmp = a / ((t + (x + y)) / (y + 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 ((z <= -6.8e-126) || !(z <= 4.4e-148)) {
tmp = a + (z / (1.0 + (t / (x + y))));
} else {
tmp = a / ((t + (x + y)) / (y + t));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -6.8e-126) or not (z <= 4.4e-148): tmp = a + (z / (1.0 + (t / (x + y)))) else: tmp = a / ((t + (x + y)) / (y + t)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -6.8e-126) || !(z <= 4.4e-148)) tmp = Float64(a + Float64(z / Float64(1.0 + Float64(t / Float64(x + y))))); else tmp = Float64(a / Float64(Float64(t + Float64(x + y)) / Float64(y + t))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((z <= -6.8e-126) || ~((z <= 4.4e-148))) tmp = a + (z / (1.0 + (t / (x + y)))); else tmp = a / ((t + (x + y)) / (y + t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -6.8e-126], N[Not[LessEqual[z, 4.4e-148]], $MachinePrecision]], N[(a + N[(z / N[(1.0 + N[(t / N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a / N[(N[(t + N[(x + y), $MachinePrecision]), $MachinePrecision] / N[(y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6.8 \cdot 10^{-126} \lor \neg \left(z \leq 4.4 \cdot 10^{-148}\right):\\
\;\;\;\;a + \frac{z}{1 + \frac{t}{x + y}}\\
\mathbf{else}:\\
\;\;\;\;\frac{a}{\frac{t + \left(x + y\right)}{y + t}}\\
\end{array}
\end{array}
if z < -6.8e-126 or 4.40000000000000034e-148 < z Initial program 59.2%
Taylor expanded in a around 0 68.7%
associate--l+68.7%
+-commutative68.7%
+-commutative68.7%
+-commutative68.7%
div-sub68.6%
+-commutative68.6%
*-commutative68.6%
+-commutative68.6%
Simplified68.6%
Taylor expanded in z around inf 61.0%
associate-/l*85.9%
+-commutative85.9%
+-commutative85.9%
+-commutative85.9%
associate-+r+85.9%
+-commutative85.9%
Simplified85.9%
Taylor expanded in y around inf 76.1%
Taylor expanded in t around 0 76.1%
if -6.8e-126 < z < 4.40000000000000034e-148Initial program 75.6%
Taylor expanded in a around inf 39.2%
associate-/l*53.9%
+-commutative53.9%
Simplified53.9%
Final simplification70.7%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (/ z (+ 1.0 (/ t (+ x y)))))) (if (<= x 1.55e+196) (+ a t_1) t_1)))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = z / (1.0 + (t / (x + y)));
double tmp;
if (x <= 1.55e+196) {
tmp = a + t_1;
} 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 / (1.0d0 + (t / (x + y)))
if (x <= 1.55d+196) then
tmp = a + t_1
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 / (1.0 + (t / (x + y)));
double tmp;
if (x <= 1.55e+196) {
tmp = a + t_1;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = z / (1.0 + (t / (x + y))) tmp = 0 if x <= 1.55e+196: tmp = a + t_1 else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(z / Float64(1.0 + Float64(t / Float64(x + y)))) tmp = 0.0 if (x <= 1.55e+196) tmp = Float64(a + t_1); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = z / (1.0 + (t / (x + y))); tmp = 0.0; if (x <= 1.55e+196) tmp = a + t_1; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(z / N[(1.0 + N[(t / N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, 1.55e+196], N[(a + t$95$1), $MachinePrecision], t$95$1]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{z}{1 + \frac{t}{x + y}}\\
\mathbf{if}\;x \leq 1.55 \cdot 10^{+196}:\\
\;\;\;\;a + t_1\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if x < 1.55000000000000005e196Initial program 63.4%
Taylor expanded in a around 0 74.6%
associate--l+74.6%
+-commutative74.6%
+-commutative74.6%
+-commutative74.6%
div-sub74.6%
+-commutative74.6%
*-commutative74.6%
+-commutative74.6%
Simplified74.6%
Taylor expanded in z around inf 63.0%
associate-/l*81.1%
+-commutative81.1%
+-commutative81.1%
+-commutative81.1%
associate-+r+81.1%
+-commutative81.1%
Simplified81.1%
Taylor expanded in y around inf 68.2%
Taylor expanded in t around 0 68.2%
if 1.55000000000000005e196 < x Initial program 61.6%
Taylor expanded in z around inf 48.1%
associate-/l*71.3%
+-commutative71.3%
+-commutative71.3%
Simplified71.3%
Taylor expanded in t around 0 71.3%
+-commutative71.3%
Simplified71.3%
Final simplification68.6%
(FPCore (x y z t a b) :precision binary64 (if (or (<= x -6.8e+139) (not (<= x 6e+143))) (/ z (/ (+ x t) x)) (- (+ z a) b)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((x <= -6.8e+139) || !(x <= 6e+143)) {
tmp = z / ((x + t) / x);
} 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 ((x <= (-6.8d+139)) .or. (.not. (x <= 6d+143))) then
tmp = z / ((x + t) / x)
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 ((x <= -6.8e+139) || !(x <= 6e+143)) {
tmp = z / ((x + t) / x);
} else {
tmp = (z + a) - b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (x <= -6.8e+139) or not (x <= 6e+143): tmp = z / ((x + t) / x) else: tmp = (z + a) - b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((x <= -6.8e+139) || !(x <= 6e+143)) tmp = Float64(z / Float64(Float64(x + t) / x)); 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 ((x <= -6.8e+139) || ~((x <= 6e+143))) tmp = z / ((x + t) / x); else tmp = (z + a) - b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[x, -6.8e+139], N[Not[LessEqual[x, 6e+143]], $MachinePrecision]], N[(z / N[(N[(x + t), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -6.8 \cdot 10^{+139} \lor \neg \left(x \leq 6 \cdot 10^{+143}\right):\\
\;\;\;\;\frac{z}{\frac{x + t}{x}}\\
\mathbf{else}:\\
\;\;\;\;\left(z + a\right) - b\\
\end{array}
\end{array}
if x < -6.8000000000000005e139 or 6.0000000000000001e143 < x Initial program 59.0%
Taylor expanded in z around inf 39.6%
associate-/l*60.3%
+-commutative60.3%
+-commutative60.3%
Simplified60.3%
Taylor expanded in y around 0 60.3%
if -6.8000000000000005e139 < x < 6.0000000000000001e143Initial program 65.1%
Taylor expanded in y around inf 63.4%
Final simplification62.4%
(FPCore (x y z t a b) :precision binary64 (if (<= x -9.6e+159) z (if (<= x 3.1e+146) (- (+ z a) b) (* z (- 1.0 (/ t x))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -9.6e+159) {
tmp = z;
} else if (x <= 3.1e+146) {
tmp = (z + a) - b;
} else {
tmp = z * (1.0 - (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 <= (-9.6d+159)) then
tmp = z
else if (x <= 3.1d+146) then
tmp = (z + a) - b
else
tmp = z * (1.0d0 - (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 <= -9.6e+159) {
tmp = z;
} else if (x <= 3.1e+146) {
tmp = (z + a) - b;
} else {
tmp = z * (1.0 - (t / x));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= -9.6e+159: tmp = z elif x <= 3.1e+146: tmp = (z + a) - b else: tmp = z * (1.0 - (t / x)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -9.6e+159) tmp = z; elseif (x <= 3.1e+146) tmp = Float64(Float64(z + a) - b); else tmp = Float64(z * Float64(1.0 - Float64(t / x))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (x <= -9.6e+159) tmp = z; elseif (x <= 3.1e+146) tmp = (z + a) - b; else tmp = z * (1.0 - (t / x)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -9.6e+159], z, If[LessEqual[x, 3.1e+146], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision], N[(z * N[(1.0 - N[(t / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -9.6 \cdot 10^{+159}:\\
\;\;\;\;z\\
\mathbf{elif}\;x \leq 3.1 \cdot 10^{+146}:\\
\;\;\;\;\left(z + a\right) - b\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(1 - \frac{t}{x}\right)\\
\end{array}
\end{array}
if x < -9.5999999999999999e159Initial program 58.7%
Taylor expanded in x around inf 56.7%
if -9.5999999999999999e159 < x < 3.1000000000000002e146Initial program 65.3%
Taylor expanded in y around inf 62.1%
if 3.1000000000000002e146 < x Initial program 57.2%
Taylor expanded in x around inf 66.7%
Taylor expanded in z around inf 61.2%
Final simplification61.4%
(FPCore (x y z t a b) :precision binary64 (if (<= x -1.55e-257) (+ z a) (if (<= x 5.6e-274) (- a b) (if (<= x 8.5e+194) (+ z a) z))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -1.55e-257) {
tmp = z + a;
} else if (x <= 5.6e-274) {
tmp = a - b;
} else if (x <= 8.5e+194) {
tmp = z + 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 <= (-1.55d-257)) then
tmp = z + a
else if (x <= 5.6d-274) then
tmp = a - b
else if (x <= 8.5d+194) then
tmp = z + 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 <= -1.55e-257) {
tmp = z + a;
} else if (x <= 5.6e-274) {
tmp = a - b;
} else if (x <= 8.5e+194) {
tmp = z + a;
} else {
tmp = z;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= -1.55e-257: tmp = z + a elif x <= 5.6e-274: tmp = a - b elif x <= 8.5e+194: tmp = z + a else: tmp = z return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -1.55e-257) tmp = Float64(z + a); elseif (x <= 5.6e-274) tmp = Float64(a - b); elseif (x <= 8.5e+194) tmp = Float64(z + a); else tmp = z; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (x <= -1.55e-257) tmp = z + a; elseif (x <= 5.6e-274) tmp = a - b; elseif (x <= 8.5e+194) tmp = z + a; else tmp = z; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -1.55e-257], N[(z + a), $MachinePrecision], If[LessEqual[x, 5.6e-274], N[(a - b), $MachinePrecision], If[LessEqual[x, 8.5e+194], N[(z + a), $MachinePrecision], z]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.55 \cdot 10^{-257}:\\
\;\;\;\;z + a\\
\mathbf{elif}\;x \leq 5.6 \cdot 10^{-274}:\\
\;\;\;\;a - b\\
\mathbf{elif}\;x \leq 8.5 \cdot 10^{+194}:\\
\;\;\;\;z + a\\
\mathbf{else}:\\
\;\;\;\;z\\
\end{array}
\end{array}
if x < -1.55000000000000004e-257 or 5.5999999999999995e-274 < x < 8.50000000000000026e194Initial program 62.0%
Taylor expanded in y around inf 55.5%
Taylor expanded in b around 0 54.4%
+-commutative54.4%
Simplified54.4%
if -1.55000000000000004e-257 < x < 5.5999999999999995e-274Initial program 82.2%
Taylor expanded in y around inf 73.6%
Taylor expanded in z around 0 76.0%
if 8.50000000000000026e194 < x Initial program 61.6%
Taylor expanded in x around inf 68.6%
Final simplification57.7%
(FPCore (x y z t a b) :precision binary64 (if (<= x -7.2e+159) z (if (<= x 8.2e+144) (- (+ z a) b) z)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -7.2e+159) {
tmp = z;
} else if (x <= 8.2e+144) {
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 <= (-7.2d+159)) then
tmp = z
else if (x <= 8.2d+144) 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 <= -7.2e+159) {
tmp = z;
} else if (x <= 8.2e+144) {
tmp = (z + a) - b;
} else {
tmp = z;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= -7.2e+159: tmp = z elif x <= 8.2e+144: tmp = (z + a) - b else: tmp = z return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -7.2e+159) tmp = z; elseif (x <= 8.2e+144) 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 <= -7.2e+159) tmp = z; elseif (x <= 8.2e+144) tmp = (z + a) - b; else tmp = z; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -7.2e+159], z, If[LessEqual[x, 8.2e+144], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision], z]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -7.2 \cdot 10^{+159}:\\
\;\;\;\;z\\
\mathbf{elif}\;x \leq 8.2 \cdot 10^{+144}:\\
\;\;\;\;\left(z + a\right) - b\\
\mathbf{else}:\\
\;\;\;\;z\\
\end{array}
\end{array}
if x < -7.20000000000000073e159 or 8.20000000000000002e144 < x Initial program 57.8%
Taylor expanded in x around inf 59.1%
if -7.20000000000000073e159 < x < 8.20000000000000002e144Initial program 65.3%
Taylor expanded in y around inf 62.1%
Final simplification61.3%
(FPCore (x y z t a b) :precision binary64 (if (<= a -4.1e+54) a (if (<= a 1.7e+117) z a)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -4.1e+54) {
tmp = a;
} else if (a <= 1.7e+117) {
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.1d+54)) then
tmp = a
else if (a <= 1.7d+117) 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.1e+54) {
tmp = a;
} else if (a <= 1.7e+117) {
tmp = z;
} else {
tmp = a;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if a <= -4.1e+54: tmp = a elif a <= 1.7e+117: tmp = z else: tmp = a return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (a <= -4.1e+54) tmp = a; elseif (a <= 1.7e+117) 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.1e+54) tmp = a; elseif (a <= 1.7e+117) tmp = z; else tmp = a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, -4.1e+54], a, If[LessEqual[a, 1.7e+117], z, a]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -4.1 \cdot 10^{+54}:\\
\;\;\;\;a\\
\mathbf{elif}\;a \leq 1.7 \cdot 10^{+117}:\\
\;\;\;\;z\\
\mathbf{else}:\\
\;\;\;\;a\\
\end{array}
\end{array}
if a < -4.09999999999999967e54 or 1.7e117 < a Initial program 42.4%
Taylor expanded in t around inf 51.2%
if -4.09999999999999967e54 < a < 1.7e117Initial program 75.3%
Taylor expanded in x around inf 52.1%
Final simplification51.8%
(FPCore (x y z t a b) :precision binary64 (if (<= x 2.2e+194) (+ z a) z))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= 2.2e+194) {
tmp = z + 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 <= 2.2d+194) then
tmp = z + 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 <= 2.2e+194) {
tmp = z + a;
} else {
tmp = z;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= 2.2e+194: tmp = z + a else: tmp = z return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= 2.2e+194) tmp = Float64(z + a); else tmp = z; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (x <= 2.2e+194) tmp = z + a; else tmp = z; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, 2.2e+194], N[(z + a), $MachinePrecision], z]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 2.2 \cdot 10^{+194}:\\
\;\;\;\;z + a\\
\mathbf{else}:\\
\;\;\;\;z\\
\end{array}
\end{array}
if x < 2.2000000000000001e194Initial program 63.4%
Taylor expanded in y around inf 56.8%
Taylor expanded in b around 0 53.3%
+-commutative53.3%
Simplified53.3%
if 2.2000000000000001e194 < x Initial program 61.6%
Taylor expanded in x around inf 68.6%
Final simplification55.4%
(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 63.2%
Taylor expanded in t around inf 29.8%
Final simplification29.8%
(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 2023306
(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)))