
(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 13 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b) :precision binary64 (/ (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)) (+ (+ x t) y)))
double code(double x, double y, double z, double t, double a, double b) {
return ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y);
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y);
}
def code(x, y, z, t, a, b): return ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y)
function code(x, y, z, t, a, b) return Float64(Float64(Float64(Float64(Float64(x + y) * z) + Float64(Float64(t + y) * a)) - Float64(y * b)) / Float64(Float64(x + t) + y)) end
function tmp = code(x, y, z, t, a, b) tmp = ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(N[(N[(x + y), $MachinePrecision] * z), $MachinePrecision] + N[(N[(t + y), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / N[(N[(x + t), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b}{\left(x + t\right) + y}
\end{array}
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (+ y t) a))
(t_2 (+ (+ x y) t))
(t_3 (/ y t_2))
(t_4 (/ (- (+ (* (+ x y) z) t_1) (* y b)) (+ y (+ x t)))))
(if (or (<= t_4 -1e+304) (not (<= t_4 5e+268)))
(- (+ z (* a (+ (/ t t_2) t_3))) (/ b (/ (+ x y) y)))
(- (+ (* z (+ t_3 (/ x t_2))) (/ t_1 t_2)) (/ (* y b) t_2)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (y + t) * a;
double t_2 = (x + y) + t;
double t_3 = y / t_2;
double t_4 = ((((x + y) * z) + t_1) - (y * b)) / (y + (x + t));
double tmp;
if ((t_4 <= -1e+304) || !(t_4 <= 5e+268)) {
tmp = (z + (a * ((t / t_2) + t_3))) - (b / ((x + y) / y));
} else {
tmp = ((z * (t_3 + (x / t_2))) + (t_1 / t_2)) - ((y * b) / 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) :: t_3
real(8) :: t_4
real(8) :: tmp
t_1 = (y + t) * a
t_2 = (x + y) + t
t_3 = y / t_2
t_4 = ((((x + y) * z) + t_1) - (y * b)) / (y + (x + t))
if ((t_4 <= (-1d+304)) .or. (.not. (t_4 <= 5d+268))) then
tmp = (z + (a * ((t / t_2) + t_3))) - (b / ((x + y) / y))
else
tmp = ((z * (t_3 + (x / t_2))) + (t_1 / t_2)) - ((y * b) / t_2)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (y + t) * a;
double t_2 = (x + y) + t;
double t_3 = y / t_2;
double t_4 = ((((x + y) * z) + t_1) - (y * b)) / (y + (x + t));
double tmp;
if ((t_4 <= -1e+304) || !(t_4 <= 5e+268)) {
tmp = (z + (a * ((t / t_2) + t_3))) - (b / ((x + y) / y));
} else {
tmp = ((z * (t_3 + (x / t_2))) + (t_1 / t_2)) - ((y * b) / t_2);
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (y + t) * a t_2 = (x + y) + t t_3 = y / t_2 t_4 = ((((x + y) * z) + t_1) - (y * b)) / (y + (x + t)) tmp = 0 if (t_4 <= -1e+304) or not (t_4 <= 5e+268): tmp = (z + (a * ((t / t_2) + t_3))) - (b / ((x + y) / y)) else: tmp = ((z * (t_3 + (x / t_2))) + (t_1 / t_2)) - ((y * b) / t_2) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(y + t) * a) t_2 = Float64(Float64(x + y) + t) t_3 = Float64(y / t_2) t_4 = Float64(Float64(Float64(Float64(Float64(x + y) * z) + t_1) - Float64(y * b)) / Float64(y + Float64(x + t))) tmp = 0.0 if ((t_4 <= -1e+304) || !(t_4 <= 5e+268)) tmp = Float64(Float64(z + Float64(a * Float64(Float64(t / t_2) + t_3))) - Float64(b / Float64(Float64(x + y) / y))); else tmp = Float64(Float64(Float64(z * Float64(t_3 + Float64(x / t_2))) + Float64(t_1 / t_2)) - Float64(Float64(y * b) / t_2)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (y + t) * a; t_2 = (x + y) + t; t_3 = y / t_2; t_4 = ((((x + y) * z) + t_1) - (y * b)) / (y + (x + t)); tmp = 0.0; if ((t_4 <= -1e+304) || ~((t_4 <= 5e+268))) tmp = (z + (a * ((t / t_2) + t_3))) - (b / ((x + y) / y)); else tmp = ((z * (t_3 + (x / t_2))) + (t_1 / t_2)) - ((y * b) / t_2); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(y + t), $MachinePrecision] * a), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x + y), $MachinePrecision] + t), $MachinePrecision]}, Block[{t$95$3 = N[(y / t$95$2), $MachinePrecision]}, Block[{t$95$4 = N[(N[(N[(N[(N[(x + y), $MachinePrecision] * z), $MachinePrecision] + t$95$1), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$4, -1e+304], N[Not[LessEqual[t$95$4, 5e+268]], $MachinePrecision]], N[(N[(z + N[(a * N[(N[(t / t$95$2), $MachinePrecision] + t$95$3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(b / N[(N[(x + y), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(z * N[(t$95$3 + N[(x / t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 / t$95$2), $MachinePrecision]), $MachinePrecision] - N[(N[(y * b), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(y + t\right) \cdot a\\
t_2 := \left(x + y\right) + t\\
t_3 := \frac{y}{t_2}\\
t_4 := \frac{\left(\left(x + y\right) \cdot z + t_1\right) - y \cdot b}{y + \left(x + t\right)}\\
\mathbf{if}\;t_4 \leq -1 \cdot 10^{+304} \lor \neg \left(t_4 \leq 5 \cdot 10^{+268}\right):\\
\;\;\;\;\left(z + a \cdot \left(\frac{t}{t_2} + t_3\right)\right) - \frac{b}{\frac{x + y}{y}}\\
\mathbf{else}:\\
\;\;\;\;\left(z \cdot \left(t_3 + \frac{x}{t_2}\right) + \frac{t_1}{t_2}\right) - \frac{y \cdot b}{t_2}\\
\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)) < -9.9999999999999994e303 or 5.0000000000000002e268 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 6.7%
Taylor expanded in a around 0 39.8%
Taylor expanded in x around inf 65.8%
Taylor expanded in t around 0 64.9%
associate-/l*87.3%
+-commutative87.3%
Simplified87.3%
if -9.9999999999999994e303 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 5.0000000000000002e268Initial program 99.0%
Taylor expanded in z around 0 99.1%
Final simplification94.0%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ (+ x y) t))
(t_2 (/ (- (+ (* (+ x y) z) (* (+ y t) a)) (* y b)) (+ y (+ x t)))))
(if (or (<= t_2 -1e+304) (not (<= t_2 5e+268)))
(- (+ z (* a (+ (/ t t_1) (/ y t_1)))) (/ b (/ (+ x y) y)))
t_2)))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x + y) + t;
double t_2 = ((((x + y) * z) + ((y + t) * a)) - (y * b)) / (y + (x + t));
double tmp;
if ((t_2 <= -1e+304) || !(t_2 <= 5e+268)) {
tmp = (z + (a * ((t / t_1) + (y / t_1)))) - (b / ((x + y) / y));
} 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 = (x + y) + t
t_2 = ((((x + y) * z) + ((y + t) * a)) - (y * b)) / (y + (x + t))
if ((t_2 <= (-1d+304)) .or. (.not. (t_2 <= 5d+268))) then
tmp = (z + (a * ((t / t_1) + (y / t_1)))) - (b / ((x + y) / y))
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 = (x + y) + t;
double t_2 = ((((x + y) * z) + ((y + t) * a)) - (y * b)) / (y + (x + t));
double tmp;
if ((t_2 <= -1e+304) || !(t_2 <= 5e+268)) {
tmp = (z + (a * ((t / t_1) + (y / t_1)))) - (b / ((x + y) / y));
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (x + y) + t t_2 = ((((x + y) * z) + ((y + t) * a)) - (y * b)) / (y + (x + t)) tmp = 0 if (t_2 <= -1e+304) or not (t_2 <= 5e+268): tmp = (z + (a * ((t / t_1) + (y / t_1)))) - (b / ((x + y) / y)) else: tmp = t_2 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(x + y) + t) t_2 = Float64(Float64(Float64(Float64(Float64(x + y) * z) + Float64(Float64(y + t) * a)) - Float64(y * b)) / Float64(y + Float64(x + t))) tmp = 0.0 if ((t_2 <= -1e+304) || !(t_2 <= 5e+268)) tmp = Float64(Float64(z + Float64(a * Float64(Float64(t / t_1) + Float64(y / t_1)))) - Float64(b / Float64(Float64(x + y) / y))); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (x + y) + t; t_2 = ((((x + y) * z) + ((y + t) * a)) - (y * b)) / (y + (x + t)); tmp = 0.0; if ((t_2 <= -1e+304) || ~((t_2 <= 5e+268))) tmp = (z + (a * ((t / t_1) + (y / t_1)))) - (b / ((x + y) / y)); else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(x + y), $MachinePrecision] + t), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(N[(N[(x + y), $MachinePrecision] * z), $MachinePrecision] + N[(N[(y + t), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$2, -1e+304], N[Not[LessEqual[t$95$2, 5e+268]], $MachinePrecision]], N[(N[(z + N[(a * N[(N[(t / t$95$1), $MachinePrecision] + N[(y / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(b / N[(N[(x + y), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(x + y\right) + t\\
t_2 := \frac{\left(\left(x + y\right) \cdot z + \left(y + t\right) \cdot a\right) - y \cdot b}{y + \left(x + t\right)}\\
\mathbf{if}\;t_2 \leq -1 \cdot 10^{+304} \lor \neg \left(t_2 \leq 5 \cdot 10^{+268}\right):\\
\;\;\;\;\left(z + a \cdot \left(\frac{t}{t_1} + \frac{y}{t_1}\right)\right) - \frac{b}{\frac{x + y}{y}}\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\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)) < -9.9999999999999994e303 or 5.0000000000000002e268 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 6.7%
Taylor expanded in a around 0 39.8%
Taylor expanded in x around inf 65.8%
Taylor expanded in t around 0 64.9%
associate-/l*87.3%
+-commutative87.3%
Simplified87.3%
if -9.9999999999999994e303 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 5.0000000000000002e268Initial program 99.0%
Final simplification94.0%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (- (+ (* (+ x y) z) (* (+ y t) a)) (* y b)) (+ y (+ x t)))))
(if (<= t_1 -1e+304)
(- (+ z a) b)
(if (<= t_1 5e+268) t_1 (- (+ z a) (/ b (/ (+ x y) y)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((((x + y) * z) + ((y + t) * a)) - (y * b)) / (y + (x + t));
double tmp;
if (t_1 <= -1e+304) {
tmp = (z + a) - b;
} else if (t_1 <= 5e+268) {
tmp = t_1;
} else {
tmp = (z + a) - (b / ((x + y) / 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 = ((((x + y) * z) + ((y + t) * a)) - (y * b)) / (y + (x + t))
if (t_1 <= (-1d+304)) then
tmp = (z + a) - b
else if (t_1 <= 5d+268) then
tmp = t_1
else
tmp = (z + a) - (b / ((x + y) / 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 = ((((x + y) * z) + ((y + t) * a)) - (y * b)) / (y + (x + t));
double tmp;
if (t_1 <= -1e+304) {
tmp = (z + a) - b;
} else if (t_1 <= 5e+268) {
tmp = t_1;
} else {
tmp = (z + a) - (b / ((x + y) / y));
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = ((((x + y) * z) + ((y + t) * a)) - (y * b)) / (y + (x + t)) tmp = 0 if t_1 <= -1e+304: tmp = (z + a) - b elif t_1 <= 5e+268: tmp = t_1 else: tmp = (z + a) - (b / ((x + y) / y)) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(Float64(Float64(x + y) * z) + Float64(Float64(y + t) * a)) - Float64(y * b)) / Float64(y + Float64(x + t))) tmp = 0.0 if (t_1 <= -1e+304) tmp = Float64(Float64(z + a) - b); elseif (t_1 <= 5e+268) tmp = t_1; else tmp = Float64(Float64(z + a) - Float64(b / Float64(Float64(x + y) / y))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = ((((x + y) * z) + ((y + t) * a)) - (y * b)) / (y + (x + t)); tmp = 0.0; if (t_1 <= -1e+304) tmp = (z + a) - b; elseif (t_1 <= 5e+268) tmp = t_1; else tmp = (z + a) - (b / ((x + y) / y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(N[(N[(x + y), $MachinePrecision] * z), $MachinePrecision] + N[(N[(y + t), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -1e+304], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision], If[LessEqual[t$95$1, 5e+268], t$95$1, N[(N[(z + a), $MachinePrecision] - N[(b / N[(N[(x + y), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\left(\left(x + y\right) \cdot z + \left(y + t\right) \cdot a\right) - y \cdot b}{y + \left(x + t\right)}\\
\mathbf{if}\;t_1 \leq -1 \cdot 10^{+304}:\\
\;\;\;\;\left(z + a\right) - b\\
\mathbf{elif}\;t_1 \leq 5 \cdot 10^{+268}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\left(z + a\right) - \frac{b}{\frac{x + y}{y}}\\
\end{array}
\end{array}
if (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < -9.9999999999999994e303Initial program 8.5%
Taylor expanded in y around inf 85.4%
if -9.9999999999999994e303 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 5.0000000000000002e268Initial program 99.0%
if 5.0000000000000002e268 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 5.9%
Taylor expanded in a around 0 33.1%
Taylor expanded in x around inf 61.2%
Taylor expanded in t around 0 60.0%
associate-/l*88.2%
+-commutative88.2%
Simplified88.2%
Taylor expanded in t around inf 79.1%
Final simplification91.3%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* a (/ (+ y t) (+ y (+ x t))))))
(if (<= t -2.5e+106)
t_1
(if (<= t 4.8e-89)
(- (+ z a) b)
(if (<= t 2.1e+118) (/ z (+ (/ t (+ x y)) 1.0)) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = a * ((y + t) / (y + (x + t)));
double tmp;
if (t <= -2.5e+106) {
tmp = t_1;
} else if (t <= 4.8e-89) {
tmp = (z + a) - b;
} else if (t <= 2.1e+118) {
tmp = z / ((t / (x + y)) + 1.0);
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = a * ((y + t) / (y + (x + t)))
if (t <= (-2.5d+106)) then
tmp = t_1
else if (t <= 4.8d-89) then
tmp = (z + a) - b
else if (t <= 2.1d+118) then
tmp = z / ((t / (x + y)) + 1.0d0)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = a * ((y + t) / (y + (x + t)));
double tmp;
if (t <= -2.5e+106) {
tmp = t_1;
} else if (t <= 4.8e-89) {
tmp = (z + a) - b;
} else if (t <= 2.1e+118) {
tmp = z / ((t / (x + y)) + 1.0);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = a * ((y + t) / (y + (x + t))) tmp = 0 if t <= -2.5e+106: tmp = t_1 elif t <= 4.8e-89: tmp = (z + a) - b elif t <= 2.1e+118: tmp = z / ((t / (x + y)) + 1.0) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(a * Float64(Float64(y + t) / Float64(y + Float64(x + t)))) tmp = 0.0 if (t <= -2.5e+106) tmp = t_1; elseif (t <= 4.8e-89) tmp = Float64(Float64(z + a) - b); elseif (t <= 2.1e+118) tmp = Float64(z / Float64(Float64(t / Float64(x + y)) + 1.0)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = a * ((y + t) / (y + (x + t))); tmp = 0.0; if (t <= -2.5e+106) tmp = t_1; elseif (t <= 4.8e-89) tmp = (z + a) - b; elseif (t <= 2.1e+118) tmp = z / ((t / (x + y)) + 1.0); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(a * N[(N[(y + t), $MachinePrecision] / N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -2.5e+106], t$95$1, If[LessEqual[t, 4.8e-89], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision], If[LessEqual[t, 2.1e+118], N[(z / N[(N[(t / N[(x + y), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot \frac{y + t}{y + \left(x + t\right)}\\
\mathbf{if}\;t \leq -2.5 \cdot 10^{+106}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 4.8 \cdot 10^{-89}:\\
\;\;\;\;\left(z + a\right) - b\\
\mathbf{elif}\;t \leq 2.1 \cdot 10^{+118}:\\
\;\;\;\;\frac{z}{\frac{t}{x + y} + 1}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if t < -2.4999999999999999e106 or 2.1e118 < t Initial program 46.3%
Taylor expanded in a around inf 31.7%
div-inv31.6%
+-commutative31.6%
associate-+l+31.6%
+-commutative31.6%
Applied egg-rr31.6%
Taylor expanded in a around 0 31.7%
associate-+r+31.7%
+-commutative31.7%
+-commutative31.7%
associate-*r/67.6%
+-commutative67.6%
Simplified67.6%
if -2.4999999999999999e106 < t < 4.80000000000000032e-89Initial program 67.4%
Taylor expanded in y around inf 65.7%
if 4.80000000000000032e-89 < t < 2.1e118Initial program 63.4%
+-commutative63.4%
associate--l+63.4%
fma-def63.7%
+-commutative63.7%
+-commutative63.7%
Simplified63.7%
div-inv63.7%
fma-udef63.4%
*-commutative63.4%
fma-def63.7%
+-commutative63.7%
associate-+l+63.7%
+-commutative63.7%
Applied egg-rr63.7%
Taylor expanded in z around inf 38.0%
associate-/l*60.2%
+-commutative60.2%
associate-+r+60.2%
+-commutative60.2%
+-commutative60.2%
+-commutative60.2%
+-commutative60.2%
Simplified60.2%
Taylor expanded in t around 0 60.2%
+-commutative60.2%
Simplified60.2%
Final simplification65.6%
(FPCore (x y z t a b)
:precision binary64
(if (<= t -7e+148)
(+ a (* x (- (/ z t) (/ a t))))
(if (<= t 3.55e-81)
(- (+ z a) b)
(if (<= t 8.2e+118)
(/ z (+ (/ t (+ x y)) 1.0))
(* a (/ (+ y t) (+ y (+ x t))))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -7e+148) {
tmp = a + (x * ((z / t) - (a / t)));
} else if (t <= 3.55e-81) {
tmp = (z + a) - b;
} else if (t <= 8.2e+118) {
tmp = z / ((t / (x + y)) + 1.0);
} else {
tmp = a * ((y + t) / (y + (x + t)));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (t <= (-7d+148)) then
tmp = a + (x * ((z / t) - (a / t)))
else if (t <= 3.55d-81) then
tmp = (z + a) - b
else if (t <= 8.2d+118) then
tmp = z / ((t / (x + y)) + 1.0d0)
else
tmp = a * ((y + t) / (y + (x + t)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -7e+148) {
tmp = a + (x * ((z / t) - (a / t)));
} else if (t <= 3.55e-81) {
tmp = (z + a) - b;
} else if (t <= 8.2e+118) {
tmp = z / ((t / (x + y)) + 1.0);
} else {
tmp = a * ((y + t) / (y + (x + t)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if t <= -7e+148: tmp = a + (x * ((z / t) - (a / t))) elif t <= 3.55e-81: tmp = (z + a) - b elif t <= 8.2e+118: tmp = z / ((t / (x + y)) + 1.0) else: tmp = a * ((y + t) / (y + (x + t))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (t <= -7e+148) tmp = Float64(a + Float64(x * Float64(Float64(z / t) - Float64(a / t)))); elseif (t <= 3.55e-81) tmp = Float64(Float64(z + a) - b); elseif (t <= 8.2e+118) tmp = Float64(z / Float64(Float64(t / Float64(x + y)) + 1.0)); else tmp = Float64(a * Float64(Float64(y + t) / Float64(y + Float64(x + t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (t <= -7e+148) tmp = a + (x * ((z / t) - (a / t))); elseif (t <= 3.55e-81) tmp = (z + a) - b; elseif (t <= 8.2e+118) tmp = z / ((t / (x + y)) + 1.0); else tmp = a * ((y + t) / (y + (x + t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -7e+148], N[(a + N[(x * N[(N[(z / t), $MachinePrecision] - N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3.55e-81], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision], If[LessEqual[t, 8.2e+118], N[(z / N[(N[(t / N[(x + y), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], N[(a * N[(N[(y + t), $MachinePrecision] / N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -7 \cdot 10^{+148}:\\
\;\;\;\;a + x \cdot \left(\frac{z}{t} - \frac{a}{t}\right)\\
\mathbf{elif}\;t \leq 3.55 \cdot 10^{-81}:\\
\;\;\;\;\left(z + a\right) - b\\
\mathbf{elif}\;t \leq 8.2 \cdot 10^{+118}:\\
\;\;\;\;\frac{z}{\frac{t}{x + y} + 1}\\
\mathbf{else}:\\
\;\;\;\;a \cdot \frac{y + t}{y + \left(x + t\right)}\\
\end{array}
\end{array}
if t < -6.9999999999999998e148Initial program 45.6%
Taylor expanded in t around inf 66.0%
associate--l+66.0%
associate-/l*66.8%
+-commutative66.8%
associate-/l*72.8%
+-commutative72.8%
associate-/l*73.7%
Simplified73.7%
Taylor expanded in x around inf 69.2%
if -6.9999999999999998e148 < t < 3.5500000000000001e-81Initial program 68.3%
Taylor expanded in y around inf 64.0%
if 3.5500000000000001e-81 < t < 8.1999999999999994e118Initial program 63.4%
+-commutative63.4%
associate--l+63.4%
fma-def63.7%
+-commutative63.7%
+-commutative63.7%
Simplified63.7%
div-inv63.7%
fma-udef63.4%
*-commutative63.4%
fma-def63.7%
+-commutative63.7%
associate-+l+63.7%
+-commutative63.7%
Applied egg-rr63.7%
Taylor expanded in z around inf 38.0%
associate-/l*60.2%
+-commutative60.2%
associate-+r+60.2%
+-commutative60.2%
+-commutative60.2%
+-commutative60.2%
+-commutative60.2%
Simplified60.2%
Taylor expanded in t around 0 60.2%
+-commutative60.2%
Simplified60.2%
if 8.1999999999999994e118 < t Initial program 39.7%
Taylor expanded in a around inf 29.9%
div-inv29.9%
+-commutative29.9%
associate-+l+29.9%
+-commutative29.9%
Applied egg-rr29.9%
Taylor expanded in a around 0 29.9%
associate-+r+29.9%
+-commutative29.9%
+-commutative29.9%
associate-*r/74.0%
+-commutative74.0%
Simplified74.0%
Final simplification66.0%
(FPCore (x y z t a b)
:precision binary64
(if (<= t -1.5e+141)
(+ a (* z (+ (/ y t) (/ x t))))
(if (<= t 8e-84)
(- (+ z a) b)
(if (<= t 8.8e+117)
(/ z (+ (/ t (+ x y)) 1.0))
(* a (/ (+ y t) (+ y (+ x t))))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -1.5e+141) {
tmp = a + (z * ((y / t) + (x / t)));
} else if (t <= 8e-84) {
tmp = (z + a) - b;
} else if (t <= 8.8e+117) {
tmp = z / ((t / (x + y)) + 1.0);
} else {
tmp = a * ((y + t) / (y + (x + t)));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (t <= (-1.5d+141)) then
tmp = a + (z * ((y / t) + (x / t)))
else if (t <= 8d-84) then
tmp = (z + a) - b
else if (t <= 8.8d+117) then
tmp = z / ((t / (x + y)) + 1.0d0)
else
tmp = a * ((y + t) / (y + (x + t)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -1.5e+141) {
tmp = a + (z * ((y / t) + (x / t)));
} else if (t <= 8e-84) {
tmp = (z + a) - b;
} else if (t <= 8.8e+117) {
tmp = z / ((t / (x + y)) + 1.0);
} else {
tmp = a * ((y + t) / (y + (x + t)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if t <= -1.5e+141: tmp = a + (z * ((y / t) + (x / t))) elif t <= 8e-84: tmp = (z + a) - b elif t <= 8.8e+117: tmp = z / ((t / (x + y)) + 1.0) else: tmp = a * ((y + t) / (y + (x + t))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (t <= -1.5e+141) tmp = Float64(a + Float64(z * Float64(Float64(y / t) + Float64(x / t)))); elseif (t <= 8e-84) tmp = Float64(Float64(z + a) - b); elseif (t <= 8.8e+117) tmp = Float64(z / Float64(Float64(t / Float64(x + y)) + 1.0)); else tmp = Float64(a * Float64(Float64(y + t) / Float64(y + Float64(x + t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (t <= -1.5e+141) tmp = a + (z * ((y / t) + (x / t))); elseif (t <= 8e-84) tmp = (z + a) - b; elseif (t <= 8.8e+117) tmp = z / ((t / (x + y)) + 1.0); else tmp = a * ((y + t) / (y + (x + t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -1.5e+141], N[(a + N[(z * N[(N[(y / t), $MachinePrecision] + N[(x / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 8e-84], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision], If[LessEqual[t, 8.8e+117], N[(z / N[(N[(t / N[(x + y), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], N[(a * N[(N[(y + t), $MachinePrecision] / N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.5 \cdot 10^{+141}:\\
\;\;\;\;a + z \cdot \left(\frac{y}{t} + \frac{x}{t}\right)\\
\mathbf{elif}\;t \leq 8 \cdot 10^{-84}:\\
\;\;\;\;\left(z + a\right) - b\\
\mathbf{elif}\;t \leq 8.8 \cdot 10^{+117}:\\
\;\;\;\;\frac{z}{\frac{t}{x + y} + 1}\\
\mathbf{else}:\\
\;\;\;\;a \cdot \frac{y + t}{y + \left(x + t\right)}\\
\end{array}
\end{array}
if t < -1.4999999999999999e141Initial program 46.2%
Taylor expanded in t around inf 65.1%
associate--l+65.1%
associate-/l*65.9%
+-commutative65.9%
associate-/l*71.6%
+-commutative71.6%
associate-/l*72.4%
Simplified72.4%
Taylor expanded in z around inf 74.4%
+-commutative74.4%
Simplified74.4%
if -1.4999999999999999e141 < t < 8.0000000000000003e-84Initial program 68.5%
Taylor expanded in y around inf 64.2%
if 8.0000000000000003e-84 < t < 8.80000000000000056e117Initial program 63.4%
+-commutative63.4%
associate--l+63.4%
fma-def63.7%
+-commutative63.7%
+-commutative63.7%
Simplified63.7%
div-inv63.7%
fma-udef63.4%
*-commutative63.4%
fma-def63.7%
+-commutative63.7%
associate-+l+63.7%
+-commutative63.7%
Applied egg-rr63.7%
Taylor expanded in z around inf 38.0%
associate-/l*60.2%
+-commutative60.2%
associate-+r+60.2%
+-commutative60.2%
+-commutative60.2%
+-commutative60.2%
+-commutative60.2%
Simplified60.2%
Taylor expanded in t around 0 60.2%
+-commutative60.2%
Simplified60.2%
if 8.80000000000000056e117 < t Initial program 39.7%
Taylor expanded in a around inf 29.9%
div-inv29.9%
+-commutative29.9%
associate-+l+29.9%
+-commutative29.9%
Applied egg-rr29.9%
Taylor expanded in a around 0 29.9%
associate-+r+29.9%
+-commutative29.9%
+-commutative29.9%
associate-*r/74.0%
+-commutative74.0%
Simplified74.0%
Final simplification66.9%
(FPCore (x y z t a b)
:precision binary64
(if (<= t -2.45e+113)
(/ a (/ (+ x t) t))
(if (<= t 2.5e-81)
(- (+ z a) b)
(if (<= t 1.55e+119) (/ z (+ (/ t (+ x y)) 1.0)) (- a (* y (/ b t)))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -2.45e+113) {
tmp = a / ((x + t) / t);
} else if (t <= 2.5e-81) {
tmp = (z + a) - b;
} else if (t <= 1.55e+119) {
tmp = z / ((t / (x + y)) + 1.0);
} else {
tmp = a - (y * (b / 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 (t <= (-2.45d+113)) then
tmp = a / ((x + t) / t)
else if (t <= 2.5d-81) then
tmp = (z + a) - b
else if (t <= 1.55d+119) then
tmp = z / ((t / (x + y)) + 1.0d0)
else
tmp = a - (y * (b / 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 (t <= -2.45e+113) {
tmp = a / ((x + t) / t);
} else if (t <= 2.5e-81) {
tmp = (z + a) - b;
} else if (t <= 1.55e+119) {
tmp = z / ((t / (x + y)) + 1.0);
} else {
tmp = a - (y * (b / t));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if t <= -2.45e+113: tmp = a / ((x + t) / t) elif t <= 2.5e-81: tmp = (z + a) - b elif t <= 1.55e+119: tmp = z / ((t / (x + y)) + 1.0) else: tmp = a - (y * (b / t)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (t <= -2.45e+113) tmp = Float64(a / Float64(Float64(x + t) / t)); elseif (t <= 2.5e-81) tmp = Float64(Float64(z + a) - b); elseif (t <= 1.55e+119) tmp = Float64(z / Float64(Float64(t / Float64(x + y)) + 1.0)); else tmp = Float64(a - Float64(y * Float64(b / t))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (t <= -2.45e+113) tmp = a / ((x + t) / t); elseif (t <= 2.5e-81) tmp = (z + a) - b; elseif (t <= 1.55e+119) tmp = z / ((t / (x + y)) + 1.0); else tmp = a - (y * (b / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -2.45e+113], N[(a / N[(N[(x + t), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.5e-81], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision], If[LessEqual[t, 1.55e+119], N[(z / N[(N[(t / N[(x + y), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], N[(a - N[(y * N[(b / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.45 \cdot 10^{+113}:\\
\;\;\;\;\frac{a}{\frac{x + t}{t}}\\
\mathbf{elif}\;t \leq 2.5 \cdot 10^{-81}:\\
\;\;\;\;\left(z + a\right) - b\\
\mathbf{elif}\;t \leq 1.55 \cdot 10^{+119}:\\
\;\;\;\;\frac{z}{\frac{t}{x + y} + 1}\\
\mathbf{else}:\\
\;\;\;\;a - y \cdot \frac{b}{t}\\
\end{array}
\end{array}
if t < -2.45000000000000011e113Initial program 54.0%
Taylor expanded in a around inf 33.7%
div-inv33.6%
+-commutative33.6%
associate-+l+33.6%
+-commutative33.6%
Applied egg-rr33.6%
Taylor expanded in y around 0 33.7%
associate-/l*60.2%
+-commutative60.2%
Simplified60.2%
if -2.45000000000000011e113 < t < 2.4999999999999999e-81Initial program 67.4%
Taylor expanded in y around inf 65.7%
if 2.4999999999999999e-81 < t < 1.54999999999999998e119Initial program 63.4%
+-commutative63.4%
associate--l+63.4%
fma-def63.7%
+-commutative63.7%
+-commutative63.7%
Simplified63.7%
div-inv63.7%
fma-udef63.4%
*-commutative63.4%
fma-def63.7%
+-commutative63.7%
associate-+l+63.7%
+-commutative63.7%
Applied egg-rr63.7%
Taylor expanded in z around inf 38.0%
associate-/l*60.2%
+-commutative60.2%
associate-+r+60.2%
+-commutative60.2%
+-commutative60.2%
+-commutative60.2%
+-commutative60.2%
Simplified60.2%
Taylor expanded in t around 0 60.2%
+-commutative60.2%
Simplified60.2%
if 1.54999999999999998e119 < t Initial program 39.7%
Taylor expanded in t around inf 54.9%
associate--l+55.5%
associate-/l*55.7%
+-commutative55.7%
associate-/l*63.7%
+-commutative63.7%
associate-/l*65.7%
Simplified65.7%
Taylor expanded in b around inf 70.0%
mul-1-neg70.0%
associate-*l/72.2%
*-commutative72.2%
distribute-lft-neg-in72.2%
Simplified72.2%
Taylor expanded in a around 0 70.0%
associate-*r/70.0%
mul-1-neg70.0%
*-commutative70.0%
distribute-lft-neg-out70.0%
associate-*r/72.2%
*-commutative72.2%
distribute-rgt-neg-in72.2%
associate-/r/72.1%
unsub-neg72.1%
associate-/r/72.2%
*-commutative72.2%
Simplified72.2%
Final simplification65.3%
(FPCore (x y z t a b)
:precision binary64
(if (<= t -1.2e+141)
(+ a (* z (+ (/ y t) (/ x t))))
(if (<= t 1.35e+120)
(- (+ z a) (/ b (/ (+ x y) y)))
(* a (/ (+ y t) (+ y (+ x t)))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -1.2e+141) {
tmp = a + (z * ((y / t) + (x / t)));
} else if (t <= 1.35e+120) {
tmp = (z + a) - (b / ((x + y) / y));
} else {
tmp = a * ((y + t) / (y + (x + t)));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (t <= (-1.2d+141)) then
tmp = a + (z * ((y / t) + (x / t)))
else if (t <= 1.35d+120) then
tmp = (z + a) - (b / ((x + y) / y))
else
tmp = a * ((y + t) / (y + (x + t)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -1.2e+141) {
tmp = a + (z * ((y / t) + (x / t)));
} else if (t <= 1.35e+120) {
tmp = (z + a) - (b / ((x + y) / y));
} else {
tmp = a * ((y + t) / (y + (x + t)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if t <= -1.2e+141: tmp = a + (z * ((y / t) + (x / t))) elif t <= 1.35e+120: tmp = (z + a) - (b / ((x + y) / y)) else: tmp = a * ((y + t) / (y + (x + t))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (t <= -1.2e+141) tmp = Float64(a + Float64(z * Float64(Float64(y / t) + Float64(x / t)))); elseif (t <= 1.35e+120) tmp = Float64(Float64(z + a) - Float64(b / Float64(Float64(x + y) / y))); else tmp = Float64(a * Float64(Float64(y + t) / Float64(y + Float64(x + t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (t <= -1.2e+141) tmp = a + (z * ((y / t) + (x / t))); elseif (t <= 1.35e+120) tmp = (z + a) - (b / ((x + y) / y)); else tmp = a * ((y + t) / (y + (x + t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -1.2e+141], N[(a + N[(z * N[(N[(y / t), $MachinePrecision] + N[(x / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.35e+120], N[(N[(z + a), $MachinePrecision] - N[(b / N[(N[(x + y), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * N[(N[(y + t), $MachinePrecision] / N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.2 \cdot 10^{+141}:\\
\;\;\;\;a + z \cdot \left(\frac{y}{t} + \frac{x}{t}\right)\\
\mathbf{elif}\;t \leq 1.35 \cdot 10^{+120}:\\
\;\;\;\;\left(z + a\right) - \frac{b}{\frac{x + y}{y}}\\
\mathbf{else}:\\
\;\;\;\;a \cdot \frac{y + t}{y + \left(x + t\right)}\\
\end{array}
\end{array}
if t < -1.19999999999999999e141Initial program 46.2%
Taylor expanded in t around inf 65.1%
associate--l+65.1%
associate-/l*65.9%
+-commutative65.9%
associate-/l*71.6%
+-commutative71.6%
associate-/l*72.4%
Simplified72.4%
Taylor expanded in z around inf 74.4%
+-commutative74.4%
Simplified74.4%
if -1.19999999999999999e141 < t < 1.35e120Initial program 67.5%
Taylor expanded in a around 0 71.6%
Taylor expanded in x around inf 80.5%
Taylor expanded in t around 0 76.1%
associate-/l*87.4%
+-commutative87.4%
Simplified87.4%
Taylor expanded in t around inf 73.5%
if 1.35e120 < t Initial program 39.7%
Taylor expanded in a around inf 29.9%
div-inv29.9%
+-commutative29.9%
associate-+l+29.9%
+-commutative29.9%
Applied egg-rr29.9%
Taylor expanded in a around 0 29.9%
associate-+r+29.9%
+-commutative29.9%
+-commutative29.9%
associate-*r/74.0%
+-commutative74.0%
Simplified74.0%
Final simplification73.7%
(FPCore (x y z t a b) :precision binary64 (if (or (<= t -1.32e+141) (not (<= t 5.4e+119))) (- a (* y (/ b t))) (- (+ z a) b)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -1.32e+141) || !(t <= 5.4e+119)) {
tmp = a - (y * (b / t));
} 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 <= (-1.32d+141)) .or. (.not. (t <= 5.4d+119))) then
tmp = a - (y * (b / t))
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 <= -1.32e+141) || !(t <= 5.4e+119)) {
tmp = a - (y * (b / t));
} else {
tmp = (z + a) - b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (t <= -1.32e+141) or not (t <= 5.4e+119): tmp = a - (y * (b / t)) else: tmp = (z + a) - b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((t <= -1.32e+141) || !(t <= 5.4e+119)) tmp = Float64(a - Float64(y * Float64(b / t))); 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 <= -1.32e+141) || ~((t <= 5.4e+119))) tmp = a - (y * (b / t)); else tmp = (z + a) - b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[t, -1.32e+141], N[Not[LessEqual[t, 5.4e+119]], $MachinePrecision]], N[(a - N[(y * N[(b / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.32 \cdot 10^{+141} \lor \neg \left(t \leq 5.4 \cdot 10^{+119}\right):\\
\;\;\;\;a - y \cdot \frac{b}{t}\\
\mathbf{else}:\\
\;\;\;\;\left(z + a\right) - b\\
\end{array}
\end{array}
if t < -1.3200000000000001e141 or 5.3999999999999997e119 < t Initial program 42.4%
Taylor expanded in t around inf 59.1%
associate--l+59.4%
associate-/l*59.9%
+-commutative59.9%
associate-/l*66.9%
+-commutative66.9%
associate-/l*68.4%
Simplified68.4%
Taylor expanded in b around inf 65.8%
mul-1-neg65.8%
associate-*l/67.4%
*-commutative67.4%
distribute-lft-neg-in67.4%
Simplified67.4%
Taylor expanded in a around 0 65.8%
associate-*r/65.8%
mul-1-neg65.8%
*-commutative65.8%
distribute-lft-neg-out65.8%
associate-*r/67.4%
*-commutative67.4%
distribute-rgt-neg-in67.4%
associate-/r/67.4%
unsub-neg67.4%
associate-/r/67.4%
*-commutative67.4%
Simplified67.4%
if -1.3200000000000001e141 < t < 5.3999999999999997e119Initial program 67.5%
Taylor expanded in y around inf 60.7%
Final simplification62.8%
(FPCore (x y z t a b) :precision binary64 (if (<= t -1.6e+107) (/ a (/ (+ x t) t)) (if (<= t 2e+119) (- (+ z a) b) (- a (* y (/ b t))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -1.6e+107) {
tmp = a / ((x + t) / t);
} else if (t <= 2e+119) {
tmp = (z + a) - b;
} else {
tmp = a - (y * (b / 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 (t <= (-1.6d+107)) then
tmp = a / ((x + t) / t)
else if (t <= 2d+119) then
tmp = (z + a) - b
else
tmp = a - (y * (b / 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 (t <= -1.6e+107) {
tmp = a / ((x + t) / t);
} else if (t <= 2e+119) {
tmp = (z + a) - b;
} else {
tmp = a - (y * (b / t));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if t <= -1.6e+107: tmp = a / ((x + t) / t) elif t <= 2e+119: tmp = (z + a) - b else: tmp = a - (y * (b / t)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (t <= -1.6e+107) tmp = Float64(a / Float64(Float64(x + t) / t)); elseif (t <= 2e+119) tmp = Float64(Float64(z + a) - b); else tmp = Float64(a - Float64(y * Float64(b / t))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (t <= -1.6e+107) tmp = a / ((x + t) / t); elseif (t <= 2e+119) tmp = (z + a) - b; else tmp = a - (y * (b / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -1.6e+107], N[(a / N[(N[(x + t), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2e+119], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision], N[(a - N[(y * N[(b / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.6 \cdot 10^{+107}:\\
\;\;\;\;\frac{a}{\frac{x + t}{t}}\\
\mathbf{elif}\;t \leq 2 \cdot 10^{+119}:\\
\;\;\;\;\left(z + a\right) - b\\
\mathbf{else}:\\
\;\;\;\;a - y \cdot \frac{b}{t}\\
\end{array}
\end{array}
if t < -1.60000000000000015e107Initial program 54.0%
Taylor expanded in a around inf 33.7%
div-inv33.6%
+-commutative33.6%
associate-+l+33.6%
+-commutative33.6%
Applied egg-rr33.6%
Taylor expanded in y around 0 33.7%
associate-/l*60.2%
+-commutative60.2%
Simplified60.2%
if -1.60000000000000015e107 < t < 1.99999999999999989e119Initial program 66.5%
Taylor expanded in y around inf 61.7%
if 1.99999999999999989e119 < t Initial program 39.7%
Taylor expanded in t around inf 54.9%
associate--l+55.5%
associate-/l*55.7%
+-commutative55.7%
associate-/l*63.7%
+-commutative63.7%
associate-/l*65.7%
Simplified65.7%
Taylor expanded in b around inf 70.0%
mul-1-neg70.0%
associate-*l/72.2%
*-commutative72.2%
distribute-lft-neg-in72.2%
Simplified72.2%
Taylor expanded in a around 0 70.0%
associate-*r/70.0%
mul-1-neg70.0%
*-commutative70.0%
distribute-lft-neg-out70.0%
associate-*r/72.2%
*-commutative72.2%
distribute-rgt-neg-in72.2%
associate-/r/72.1%
unsub-neg72.1%
associate-/r/72.2%
*-commutative72.2%
Simplified72.2%
Final simplification63.4%
(FPCore (x y z t a b) :precision binary64 (if (<= t -7e+141) a (if (<= t 5.8e+119) (- (+ z a) b) a)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -7e+141) {
tmp = a;
} else if (t <= 5.8e+119) {
tmp = (z + a) - b;
} 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 (t <= (-7d+141)) then
tmp = a
else if (t <= 5.8d+119) then
tmp = (z + a) - b
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 (t <= -7e+141) {
tmp = a;
} else if (t <= 5.8e+119) {
tmp = (z + a) - b;
} else {
tmp = a;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if t <= -7e+141: tmp = a elif t <= 5.8e+119: tmp = (z + a) - b else: tmp = a return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (t <= -7e+141) tmp = a; elseif (t <= 5.8e+119) tmp = Float64(Float64(z + a) - b); else tmp = a; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (t <= -7e+141) tmp = a; elseif (t <= 5.8e+119) tmp = (z + a) - b; else tmp = a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -7e+141], a, If[LessEqual[t, 5.8e+119], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision], a]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -7 \cdot 10^{+141}:\\
\;\;\;\;a\\
\mathbf{elif}\;t \leq 5.8 \cdot 10^{+119}:\\
\;\;\;\;\left(z + a\right) - b\\
\mathbf{else}:\\
\;\;\;\;a\\
\end{array}
\end{array}
if t < -6.9999999999999999e141 or 5.80000000000000014e119 < t Initial program 42.4%
Taylor expanded in t around inf 63.4%
if -6.9999999999999999e141 < t < 5.80000000000000014e119Initial program 67.5%
Taylor expanded in y around inf 60.7%
Final simplification61.5%
(FPCore (x y z t a b) :precision binary64 (if (<= a -2.5e+46) a (if (<= a 1.2e-34) z a)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -2.5e+46) {
tmp = a;
} else if (a <= 1.2e-34) {
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 <= (-2.5d+46)) then
tmp = a
else if (a <= 1.2d-34) 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 <= -2.5e+46) {
tmp = a;
} else if (a <= 1.2e-34) {
tmp = z;
} else {
tmp = a;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if a <= -2.5e+46: tmp = a elif a <= 1.2e-34: tmp = z else: tmp = a return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (a <= -2.5e+46) tmp = a; elseif (a <= 1.2e-34) tmp = z; else tmp = a; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (a <= -2.5e+46) tmp = a; elseif (a <= 1.2e-34) tmp = z; else tmp = a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, -2.5e+46], a, If[LessEqual[a, 1.2e-34], z, a]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.5 \cdot 10^{+46}:\\
\;\;\;\;a\\
\mathbf{elif}\;a \leq 1.2 \cdot 10^{-34}:\\
\;\;\;\;z\\
\mathbf{else}:\\
\;\;\;\;a\\
\end{array}
\end{array}
if a < -2.5000000000000001e46 or 1.19999999999999996e-34 < a Initial program 48.0%
Taylor expanded in t around inf 57.2%
if -2.5000000000000001e46 < a < 1.19999999999999996e-34Initial program 71.4%
Taylor expanded in x around inf 46.6%
Final simplification52.1%
(FPCore (x y z t a b) :precision binary64 a)
double code(double x, double y, double z, double t, double a, double b) {
return a;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = a
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return a;
}
def code(x, y, z, t, a, b): return a
function code(x, y, z, t, a, b) return a end
function tmp = code(x, y, z, t, a, b) tmp = a; end
code[x_, y_, z_, t_, a_, b_] := a
\begin{array}{l}
\\
a
\end{array}
Initial program 59.4%
Taylor expanded in t around inf 36.5%
Final simplification36.5%
(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 2023271
(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)))