
(FPCore (x y z t a b) :precision binary64 (/ (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)) (+ (+ x t) y)))
double code(double x, double y, double z, double t, double a, double b) {
return ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y);
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y);
}
def code(x, y, z, t, a, b): return ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y)
function code(x, y, z, t, a, b) return Float64(Float64(Float64(Float64(Float64(x + y) * z) + Float64(Float64(t + y) * a)) - Float64(y * b)) / Float64(Float64(x + t) + y)) end
function tmp = code(x, y, z, t, a, b) tmp = ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(N[(N[(x + y), $MachinePrecision] * z), $MachinePrecision] + N[(N[(t + y), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / N[(N[(x + t), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b}{\left(x + t\right) + y}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 16 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b) :precision binary64 (/ (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)) (+ (+ x t) y)))
double code(double x, double y, double z, double t, double a, double b) {
return ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y);
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y);
}
def code(x, y, z, t, a, b): return ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y)
function code(x, y, z, t, a, b) return Float64(Float64(Float64(Float64(Float64(x + y) * z) + Float64(Float64(t + y) * a)) - Float64(y * b)) / Float64(Float64(x + t) + y)) end
function tmp = code(x, y, z, t, a, b) tmp = ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(N[(N[(x + y), $MachinePrecision] * z), $MachinePrecision] + N[(N[(t + y), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / N[(N[(x + t), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b}{\left(x + t\right) + y}
\end{array}
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ y (+ x t)))
(t_2 (/ (- (+ (* z (+ x y)) (* (+ y t) a)) (* y b)) t_1)))
(if (or (<= t_2 (- INFINITY)) (not (<= t_2 2e+304)))
(* b (- (/ (fma z (/ (+ x y) t_1) (* a (/ (+ y t) t_1))) b) (/ y t_1)))
t_2)))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = y + (x + t);
double t_2 = (((z * (x + y)) + ((y + t) * a)) - (y * b)) / t_1;
double tmp;
if ((t_2 <= -((double) INFINITY)) || !(t_2 <= 2e+304)) {
tmp = b * ((fma(z, ((x + y) / t_1), (a * ((y + t) / t_1))) / b) - (y / t_1));
} else {
tmp = t_2;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(y + Float64(x + t)) t_2 = Float64(Float64(Float64(Float64(z * Float64(x + y)) + Float64(Float64(y + t) * a)) - Float64(y * b)) / t_1) tmp = 0.0 if ((t_2 <= Float64(-Inf)) || !(t_2 <= 2e+304)) tmp = Float64(b * Float64(Float64(fma(z, Float64(Float64(x + y) / t_1), Float64(a * Float64(Float64(y + t) / t_1))) / b) - Float64(y / t_1))); else tmp = t_2; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(N[(z * N[(x + y), $MachinePrecision]), $MachinePrecision] + N[(N[(y + t), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]}, If[Or[LessEqual[t$95$2, (-Infinity)], N[Not[LessEqual[t$95$2, 2e+304]], $MachinePrecision]], N[(b * N[(N[(N[(z * N[(N[(x + y), $MachinePrecision] / t$95$1), $MachinePrecision] + N[(a * N[(N[(y + t), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / b), $MachinePrecision] - N[(y / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y + \left(x + t\right)\\
t_2 := \frac{\left(z \cdot \left(x + y\right) + \left(y + t\right) \cdot a\right) - y \cdot b}{t\_1}\\
\mathbf{if}\;t\_2 \leq -\infty \lor \neg \left(t\_2 \leq 2 \cdot 10^{+304}\right):\\
\;\;\;\;b \cdot \left(\frac{\mathsf{fma}\left(z, \frac{x + y}{t\_1}, a \cdot \frac{y + t}{t\_1}\right)}{b} - \frac{y}{t\_1}\right)\\
\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)) < -inf.0 or 1.9999999999999999e304 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 5.0%
Taylor expanded in b around -inf 20.3%
mul-1-neg20.3%
*-commutative20.3%
distribute-rgt-neg-in20.3%
Simplified83.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.9999999999999999e304Initial program 99.8%
Final simplification93.2%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ t (+ x y)))
(t_2 (+ y (+ x t)))
(t_3 (/ (- (+ (* z (+ x y)) (* (+ y t) a)) (* y b)) t_2)))
(if (<= t_3 (- INFINITY))
(- (+ z a) b)
(if (<= t_3 2e+304)
t_3
(*
b
(-
(/ (* z (+ (/ (+ x y) t_1) (* (/ a z) (/ (+ y t) t_1)))) b)
(/ y t_2)))))))
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 = (((z * (x + y)) + ((y + t) * a)) - (y * b)) / t_2;
double tmp;
if (t_3 <= -((double) INFINITY)) {
tmp = (z + a) - b;
} else if (t_3 <= 2e+304) {
tmp = t_3;
} else {
tmp = b * (((z * (((x + y) / t_1) + ((a / z) * ((y + t) / t_1)))) / b) - (y / t_2));
}
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 = (((z * (x + y)) + ((y + t) * a)) - (y * b)) / t_2;
double tmp;
if (t_3 <= -Double.POSITIVE_INFINITY) {
tmp = (z + a) - b;
} else if (t_3 <= 2e+304) {
tmp = t_3;
} else {
tmp = b * (((z * (((x + y) / t_1) + ((a / z) * ((y + t) / t_1)))) / b) - (y / t_2));
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = t + (x + y) t_2 = y + (x + t) t_3 = (((z * (x + y)) + ((y + t) * a)) - (y * b)) / t_2 tmp = 0 if t_3 <= -math.inf: tmp = (z + a) - b elif t_3 <= 2e+304: tmp = t_3 else: tmp = b * (((z * (((x + y) / t_1) + ((a / z) * ((y + t) / t_1)))) / b) - (y / t_2)) 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(z * Float64(x + y)) + Float64(Float64(y + t) * a)) - Float64(y * b)) / t_2) tmp = 0.0 if (t_3 <= Float64(-Inf)) tmp = Float64(Float64(z + a) - b); elseif (t_3 <= 2e+304) tmp = t_3; else tmp = Float64(b * Float64(Float64(Float64(z * Float64(Float64(Float64(x + y) / t_1) + Float64(Float64(a / z) * Float64(Float64(y + t) / t_1)))) / b) - Float64(y / t_2))); 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 = (((z * (x + y)) + ((y + t) * a)) - (y * b)) / t_2; tmp = 0.0; if (t_3 <= -Inf) tmp = (z + a) - b; elseif (t_3 <= 2e+304) tmp = t_3; else tmp = b * (((z * (((x + y) / t_1) + ((a / z) * ((y + t) / t_1)))) / b) - (y / t_2)); 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[(z * N[(x + y), $MachinePrecision]), $MachinePrecision] + N[(N[(y + t), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / t$95$2), $MachinePrecision]}, If[LessEqual[t$95$3, (-Infinity)], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision], If[LessEqual[t$95$3, 2e+304], t$95$3, N[(b * N[(N[(N[(z * N[(N[(N[(x + y), $MachinePrecision] / t$95$1), $MachinePrecision] + N[(N[(a / z), $MachinePrecision] * N[(N[(y + t), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / b), $MachinePrecision] - N[(y / t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t + \left(x + y\right)\\
t_2 := y + \left(x + t\right)\\
t_3 := \frac{\left(z \cdot \left(x + y\right) + \left(y + t\right) \cdot a\right) - y \cdot b}{t\_2}\\
\mathbf{if}\;t\_3 \leq -\infty:\\
\;\;\;\;\left(z + a\right) - b\\
\mathbf{elif}\;t\_3 \leq 2 \cdot 10^{+304}:\\
\;\;\;\;t\_3\\
\mathbf{else}:\\
\;\;\;\;b \cdot \left(\frac{z \cdot \left(\frac{x + y}{t\_1} + \frac{a}{z} \cdot \frac{y + t}{t\_1}\right)}{b} - \frac{y}{t\_2}\right)\\
\end{array}
\end{array}
if (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < -inf.0Initial program 6.0%
Taylor expanded in y around inf 77.7%
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.9999999999999999e304Initial program 99.8%
if 1.9999999999999999e304 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 4.2%
Taylor expanded in b around -inf 19.8%
mul-1-neg19.8%
*-commutative19.8%
distribute-rgt-neg-in19.8%
Simplified81.8%
Taylor expanded in z around -inf 44.1%
mul-1-neg44.1%
distribute-lft-out44.1%
times-frac75.1%
Simplified75.1%
Final simplification90.5%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (/ (- (+ (* z (+ x y)) (* (+ y t) a)) (* y b)) (+ y (+ x t))))) (if (or (<= t_1 (- INFINITY)) (not (<= t_1 5e+274))) (- (+ z a) b) t_1)))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (((z * (x + y)) + ((y + t) * a)) - (y * b)) / (y + (x + t));
double tmp;
if ((t_1 <= -((double) INFINITY)) || !(t_1 <= 5e+274)) {
tmp = (z + a) - b;
} else {
tmp = t_1;
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (((z * (x + y)) + ((y + t) * a)) - (y * b)) / (y + (x + t));
double tmp;
if ((t_1 <= -Double.POSITIVE_INFINITY) || !(t_1 <= 5e+274)) {
tmp = (z + a) - b;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (((z * (x + y)) + ((y + t) * a)) - (y * b)) / (y + (x + t)) tmp = 0 if (t_1 <= -math.inf) or not (t_1 <= 5e+274): tmp = (z + a) - b else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(Float64(z * Float64(x + y)) + Float64(Float64(y + t) * a)) - Float64(y * b)) / Float64(y + Float64(x + t))) tmp = 0.0 if ((t_1 <= Float64(-Inf)) || !(t_1 <= 5e+274)) tmp = Float64(Float64(z + a) - b); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (((z * (x + y)) + ((y + t) * a)) - (y * b)) / (y + (x + t)); tmp = 0.0; if ((t_1 <= -Inf) || ~((t_1 <= 5e+274))) tmp = (z + a) - b; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(N[(z * N[(x + y), $MachinePrecision]), $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$1, (-Infinity)], N[Not[LessEqual[t$95$1, 5e+274]], $MachinePrecision]], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision], t$95$1]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\left(z \cdot \left(x + y\right) + \left(y + t\right) \cdot a\right) - y \cdot b}{y + \left(x + t\right)}\\
\mathbf{if}\;t\_1 \leq -\infty \lor \neg \left(t\_1 \leq 5 \cdot 10^{+274}\right):\\
\;\;\;\;\left(z + a\right) - b\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < -inf.0 or 4.9999999999999998e274 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 6.8%
Taylor expanded in y around inf 73.5%
if -inf.0 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 4.9999999999999998e274Initial program 99.8%
Final simplification89.2%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ y (+ x t)))
(t_2 (/ (- (+ (* z (+ x y)) (* (+ y t) a)) (* y b)) t_1)))
(if (<= t_2 (- INFINITY))
(- (+ z a) b)
(if (<= t_2 2e+304)
t_2
(* b (- (/ (+ a (* y (/ z (+ y t)))) b) (/ y t_1)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = y + (x + t);
double t_2 = (((z * (x + y)) + ((y + t) * a)) - (y * b)) / t_1;
double tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = (z + a) - b;
} else if (t_2 <= 2e+304) {
tmp = t_2;
} else {
tmp = b * (((a + (y * (z / (y + t)))) / b) - (y / t_1));
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = y + (x + t);
double t_2 = (((z * (x + y)) + ((y + t) * a)) - (y * b)) / t_1;
double tmp;
if (t_2 <= -Double.POSITIVE_INFINITY) {
tmp = (z + a) - b;
} else if (t_2 <= 2e+304) {
tmp = t_2;
} else {
tmp = b * (((a + (y * (z / (y + t)))) / b) - (y / t_1));
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = y + (x + t) t_2 = (((z * (x + y)) + ((y + t) * a)) - (y * b)) / t_1 tmp = 0 if t_2 <= -math.inf: tmp = (z + a) - b elif t_2 <= 2e+304: tmp = t_2 else: tmp = b * (((a + (y * (z / (y + t)))) / b) - (y / t_1)) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(y + Float64(x + t)) t_2 = Float64(Float64(Float64(Float64(z * Float64(x + y)) + Float64(Float64(y + t) * a)) - Float64(y * b)) / t_1) tmp = 0.0 if (t_2 <= Float64(-Inf)) tmp = Float64(Float64(z + a) - b); elseif (t_2 <= 2e+304) tmp = t_2; else tmp = Float64(b * Float64(Float64(Float64(a + Float64(y * Float64(z / Float64(y + t)))) / b) - Float64(y / t_1))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = y + (x + t); t_2 = (((z * (x + y)) + ((y + t) * a)) - (y * b)) / t_1; tmp = 0.0; if (t_2 <= -Inf) tmp = (z + a) - b; elseif (t_2 <= 2e+304) tmp = t_2; else tmp = b * (((a + (y * (z / (y + t)))) / b) - (y / t_1)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(N[(z * N[(x + y), $MachinePrecision]), $MachinePrecision] + N[(N[(y + t), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision], If[LessEqual[t$95$2, 2e+304], t$95$2, N[(b * N[(N[(N[(a + N[(y * N[(z / N[(y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / b), $MachinePrecision] - N[(y / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y + \left(x + t\right)\\
t_2 := \frac{\left(z \cdot \left(x + y\right) + \left(y + t\right) \cdot a\right) - y \cdot b}{t\_1}\\
\mathbf{if}\;t\_2 \leq -\infty:\\
\;\;\;\;\left(z + a\right) - b\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+304}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;b \cdot \left(\frac{a + y \cdot \frac{z}{y + t}}{b} - \frac{y}{t\_1}\right)\\
\end{array}
\end{array}
if (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < -inf.0Initial program 6.0%
Taylor expanded in y around inf 77.7%
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.9999999999999999e304Initial program 99.8%
if 1.9999999999999999e304 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 4.2%
Taylor expanded in b around -inf 19.8%
mul-1-neg19.8%
*-commutative19.8%
distribute-rgt-neg-in19.8%
Simplified81.8%
Taylor expanded in x around 0 39.4%
associate-/l*69.6%
Simplified69.6%
Final simplification89.3%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ t (+ x y))) (t_2 (/ (+ x y) t_1)))
(if (or (<= a -1.2e-53) (not (<= a 3.9e-38)))
(*
a
(+ (/ t t_1) (- (+ (/ y t_1) (* (/ z a) t_2)) (* b (/ y (* a t_1))))))
(*
b
(-
(/ (* z (+ t_2 (* (/ a z) (/ (+ y t) t_1)))) b)
(/ y (+ y (+ x t))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = t + (x + y);
double t_2 = (x + y) / t_1;
double tmp;
if ((a <= -1.2e-53) || !(a <= 3.9e-38)) {
tmp = a * ((t / t_1) + (((y / t_1) + ((z / a) * t_2)) - (b * (y / (a * t_1)))));
} else {
tmp = b * (((z * (t_2 + ((a / z) * ((y + t) / t_1)))) / b) - (y / (y + (x + t))));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = t + (x + y)
t_2 = (x + y) / t_1
if ((a <= (-1.2d-53)) .or. (.not. (a <= 3.9d-38))) then
tmp = a * ((t / t_1) + (((y / t_1) + ((z / a) * t_2)) - (b * (y / (a * t_1)))))
else
tmp = b * (((z * (t_2 + ((a / z) * ((y + t) / t_1)))) / b) - (y / (y + (x + t))))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = t + (x + y);
double t_2 = (x + y) / t_1;
double tmp;
if ((a <= -1.2e-53) || !(a <= 3.9e-38)) {
tmp = a * ((t / t_1) + (((y / t_1) + ((z / a) * t_2)) - (b * (y / (a * t_1)))));
} else {
tmp = b * (((z * (t_2 + ((a / z) * ((y + t) / t_1)))) / b) - (y / (y + (x + t))));
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = t + (x + y) t_2 = (x + y) / t_1 tmp = 0 if (a <= -1.2e-53) or not (a <= 3.9e-38): tmp = a * ((t / t_1) + (((y / t_1) + ((z / a) * t_2)) - (b * (y / (a * t_1))))) else: tmp = b * (((z * (t_2 + ((a / z) * ((y + t) / t_1)))) / b) - (y / (y + (x + t)))) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(t + Float64(x + y)) t_2 = Float64(Float64(x + y) / t_1) tmp = 0.0 if ((a <= -1.2e-53) || !(a <= 3.9e-38)) tmp = Float64(a * Float64(Float64(t / t_1) + Float64(Float64(Float64(y / t_1) + Float64(Float64(z / a) * t_2)) - Float64(b * Float64(y / Float64(a * t_1)))))); else tmp = Float64(b * Float64(Float64(Float64(z * Float64(t_2 + Float64(Float64(a / z) * Float64(Float64(y + t) / t_1)))) / b) - Float64(y / Float64(y + Float64(x + t))))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = t + (x + y); t_2 = (x + y) / t_1; tmp = 0.0; if ((a <= -1.2e-53) || ~((a <= 3.9e-38))) tmp = a * ((t / t_1) + (((y / t_1) + ((z / a) * t_2)) - (b * (y / (a * t_1))))); else tmp = b * (((z * (t_2 + ((a / z) * ((y + t) / t_1)))) / b) - (y / (y + (x + t)))); 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[(N[(x + y), $MachinePrecision] / t$95$1), $MachinePrecision]}, If[Or[LessEqual[a, -1.2e-53], N[Not[LessEqual[a, 3.9e-38]], $MachinePrecision]], N[(a * N[(N[(t / t$95$1), $MachinePrecision] + N[(N[(N[(y / t$95$1), $MachinePrecision] + N[(N[(z / a), $MachinePrecision] * t$95$2), $MachinePrecision]), $MachinePrecision] - N[(b * N[(y / N[(a * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(b * N[(N[(N[(z * N[(t$95$2 + N[(N[(a / z), $MachinePrecision] * N[(N[(y + t), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / b), $MachinePrecision] - N[(y / N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t + \left(x + y\right)\\
t_2 := \frac{x + y}{t\_1}\\
\mathbf{if}\;a \leq -1.2 \cdot 10^{-53} \lor \neg \left(a \leq 3.9 \cdot 10^{-38}\right):\\
\;\;\;\;a \cdot \left(\frac{t}{t\_1} + \left(\left(\frac{y}{t\_1} + \frac{z}{a} \cdot t\_2\right) - b \cdot \frac{y}{a \cdot t\_1}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;b \cdot \left(\frac{z \cdot \left(t\_2 + \frac{a}{z} \cdot \frac{y + t}{t\_1}\right)}{b} - \frac{y}{y + \left(x + t\right)}\right)\\
\end{array}
\end{array}
if a < -1.20000000000000004e-53 or 3.8999999999999999e-38 < a Initial program 58.4%
Taylor expanded in a around inf 73.5%
associate--l+73.5%
+-commutative73.5%
+-commutative73.5%
times-frac86.8%
+-commutative86.8%
+-commutative86.8%
associate-/l*94.7%
+-commutative94.7%
Simplified94.7%
if -1.20000000000000004e-53 < a < 3.8999999999999999e-38Initial program 66.7%
Taylor expanded in b around -inf 71.4%
mul-1-neg71.4%
*-commutative71.4%
distribute-rgt-neg-in71.4%
Simplified86.7%
Taylor expanded in z around -inf 83.5%
mul-1-neg83.5%
distribute-lft-out83.5%
times-frac86.7%
Simplified86.7%
Final simplification90.9%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -7.4e+55) (not (<= y 5.5e-43))) (- (+ z a) b) (* z (+ (/ x (+ x t)) (* (/ a z) (/ t (+ x t)))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -7.4e+55) || !(y <= 5.5e-43)) {
tmp = (z + a) - b;
} else {
tmp = z * ((x / (x + t)) + ((a / z) * (t / (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 ((y <= (-7.4d+55)) .or. (.not. (y <= 5.5d-43))) then
tmp = (z + a) - b
else
tmp = z * ((x / (x + t)) + ((a / z) * (t / (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 ((y <= -7.4e+55) || !(y <= 5.5e-43)) {
tmp = (z + a) - b;
} else {
tmp = z * ((x / (x + t)) + ((a / z) * (t / (x + t))));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -7.4e+55) or not (y <= 5.5e-43): tmp = (z + a) - b else: tmp = z * ((x / (x + t)) + ((a / z) * (t / (x + t)))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -7.4e+55) || !(y <= 5.5e-43)) tmp = Float64(Float64(z + a) - b); else tmp = Float64(z * Float64(Float64(x / Float64(x + t)) + Float64(Float64(a / z) * Float64(t / Float64(x + t))))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -7.4e+55) || ~((y <= 5.5e-43))) tmp = (z + a) - b; else tmp = z * ((x / (x + t)) + ((a / z) * (t / (x + t)))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -7.4e+55], N[Not[LessEqual[y, 5.5e-43]], $MachinePrecision]], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision], N[(z * N[(N[(x / N[(x + t), $MachinePrecision]), $MachinePrecision] + N[(N[(a / z), $MachinePrecision] * N[(t / N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -7.4 \cdot 10^{+55} \lor \neg \left(y \leq 5.5 \cdot 10^{-43}\right):\\
\;\;\;\;\left(z + a\right) - b\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(\frac{x}{x + t} + \frac{a}{z} \cdot \frac{t}{x + t}\right)\\
\end{array}
\end{array}
if y < -7.4000000000000004e55 or 5.50000000000000013e-43 < y Initial program 49.3%
Taylor expanded in y around inf 73.4%
if -7.4000000000000004e55 < y < 5.50000000000000013e-43Initial program 74.8%
Taylor expanded in b around -inf 68.2%
mul-1-neg68.2%
*-commutative68.2%
distribute-rgt-neg-in68.2%
Simplified83.1%
Taylor expanded in z around -inf 61.4%
mul-1-neg61.4%
distribute-lft-out61.4%
times-frac72.9%
Simplified72.9%
Taylor expanded in y around 0 55.5%
+-commutative55.5%
times-frac69.8%
+-commutative69.8%
Simplified69.8%
Final simplification71.6%
(FPCore (x y z t a b)
:precision binary64
(if (<= z -4.4e+42)
z
(if (<= z 4.4e-215)
(- a b)
(if (<= z 7.7e-109) a (if (<= z 1.15e+116) (- a b) z)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -4.4e+42) {
tmp = z;
} else if (z <= 4.4e-215) {
tmp = a - b;
} else if (z <= 7.7e-109) {
tmp = a;
} else if (z <= 1.15e+116) {
tmp = 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 (z <= (-4.4d+42)) then
tmp = z
else if (z <= 4.4d-215) then
tmp = a - b
else if (z <= 7.7d-109) then
tmp = a
else if (z <= 1.15d+116) then
tmp = 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 (z <= -4.4e+42) {
tmp = z;
} else if (z <= 4.4e-215) {
tmp = a - b;
} else if (z <= 7.7e-109) {
tmp = a;
} else if (z <= 1.15e+116) {
tmp = a - b;
} else {
tmp = z;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= -4.4e+42: tmp = z elif z <= 4.4e-215: tmp = a - b elif z <= 7.7e-109: tmp = a elif z <= 1.15e+116: tmp = a - b else: tmp = z return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -4.4e+42) tmp = z; elseif (z <= 4.4e-215) tmp = Float64(a - b); elseif (z <= 7.7e-109) tmp = a; elseif (z <= 1.15e+116) tmp = Float64(a - b); else tmp = z; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (z <= -4.4e+42) tmp = z; elseif (z <= 4.4e-215) tmp = a - b; elseif (z <= 7.7e-109) tmp = a; elseif (z <= 1.15e+116) tmp = a - b; else tmp = z; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -4.4e+42], z, If[LessEqual[z, 4.4e-215], N[(a - b), $MachinePrecision], If[LessEqual[z, 7.7e-109], a, If[LessEqual[z, 1.15e+116], N[(a - b), $MachinePrecision], z]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.4 \cdot 10^{+42}:\\
\;\;\;\;z\\
\mathbf{elif}\;z \leq 4.4 \cdot 10^{-215}:\\
\;\;\;\;a - b\\
\mathbf{elif}\;z \leq 7.7 \cdot 10^{-109}:\\
\;\;\;\;a\\
\mathbf{elif}\;z \leq 1.15 \cdot 10^{+116}:\\
\;\;\;\;a - b\\
\mathbf{else}:\\
\;\;\;\;z\\
\end{array}
\end{array}
if z < -4.4000000000000003e42 or 1.14999999999999997e116 < z Initial program 45.9%
Taylor expanded in x around inf 50.7%
if -4.4000000000000003e42 < z < 4.39999999999999993e-215 or 7.70000000000000025e-109 < z < 1.14999999999999997e116Initial program 73.5%
Taylor expanded in z around 0 59.2%
*-commutative59.2%
Simplified59.2%
Taylor expanded in y around inf 49.5%
if 4.39999999999999993e-215 < z < 7.70000000000000025e-109Initial program 80.7%
Taylor expanded in t around inf 61.4%
(FPCore (x y z t a b) :precision binary64 (if (or (<= b -1e+67) (not (<= b 2e+48))) (* b (- (/ a b) (/ y (+ y (+ x t))))) (- (+ z a) b)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((b <= -1e+67) || !(b <= 2e+48)) {
tmp = b * ((a / b) - (y / (y + (x + 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 ((b <= (-1d+67)) .or. (.not. (b <= 2d+48))) then
tmp = b * ((a / b) - (y / (y + (x + 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 ((b <= -1e+67) || !(b <= 2e+48)) {
tmp = b * ((a / b) - (y / (y + (x + t))));
} else {
tmp = (z + a) - b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (b <= -1e+67) or not (b <= 2e+48): tmp = b * ((a / b) - (y / (y + (x + t)))) else: tmp = (z + a) - b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((b <= -1e+67) || !(b <= 2e+48)) tmp = Float64(b * Float64(Float64(a / b) - Float64(y / Float64(y + Float64(x + 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 ((b <= -1e+67) || ~((b <= 2e+48))) tmp = b * ((a / b) - (y / (y + (x + t)))); else tmp = (z + a) - b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[b, -1e+67], N[Not[LessEqual[b, 2e+48]], $MachinePrecision]], N[(b * N[(N[(a / b), $MachinePrecision] - N[(y / N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -1 \cdot 10^{+67} \lor \neg \left(b \leq 2 \cdot 10^{+48}\right):\\
\;\;\;\;b \cdot \left(\frac{a}{b} - \frac{y}{y + \left(x + t\right)}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(z + a\right) - b\\
\end{array}
\end{array}
if b < -9.99999999999999983e66 or 2.00000000000000009e48 < b Initial program 58.8%
Taylor expanded in b around -inf 68.2%
mul-1-neg68.2%
*-commutative68.2%
distribute-rgt-neg-in68.2%
Simplified95.5%
Taylor expanded in t around inf 72.1%
if -9.99999999999999983e66 < b < 2.00000000000000009e48Initial program 65.2%
Taylor expanded in y around inf 65.1%
Final simplification68.2%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -4.4e-64) (not (<= y 1.6e-42))) (- (+ z a) b) (/ (+ (* t a) (* x z)) (+ x t))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -4.4e-64) || !(y <= 1.6e-42)) {
tmp = (z + a) - b;
} else {
tmp = ((t * a) + (x * z)) / (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 ((y <= (-4.4d-64)) .or. (.not. (y <= 1.6d-42))) then
tmp = (z + a) - b
else
tmp = ((t * a) + (x * z)) / (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 ((y <= -4.4e-64) || !(y <= 1.6e-42)) {
tmp = (z + a) - b;
} else {
tmp = ((t * a) + (x * z)) / (x + t);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -4.4e-64) or not (y <= 1.6e-42): tmp = (z + a) - b else: tmp = ((t * a) + (x * z)) / (x + t) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -4.4e-64) || !(y <= 1.6e-42)) tmp = Float64(Float64(z + a) - b); else tmp = Float64(Float64(Float64(t * a) + Float64(x * z)) / Float64(x + t)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -4.4e-64) || ~((y <= 1.6e-42))) tmp = (z + a) - b; else tmp = ((t * a) + (x * z)) / (x + t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -4.4e-64], N[Not[LessEqual[y, 1.6e-42]], $MachinePrecision]], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision], N[(N[(N[(t * a), $MachinePrecision] + N[(x * z), $MachinePrecision]), $MachinePrecision] / N[(x + t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.4 \cdot 10^{-64} \lor \neg \left(y \leq 1.6 \cdot 10^{-42}\right):\\
\;\;\;\;\left(z + a\right) - b\\
\mathbf{else}:\\
\;\;\;\;\frac{t \cdot a + x \cdot z}{x + t}\\
\end{array}
\end{array}
if y < -4.3999999999999999e-64 or 1.60000000000000012e-42 < y Initial program 48.1%
Taylor expanded in y around inf 72.9%
if -4.3999999999999999e-64 < y < 1.60000000000000012e-42Initial program 80.1%
Taylor expanded in y around 0 60.8%
Final simplification67.5%
(FPCore (x y z t a b)
:precision binary64
(if (<= z -6e-19)
(- (+ z a) b)
(if (<= z 2.3e+110)
(* b (- (/ a b) (/ y (+ y t))))
(* z (/ (+ x y) (+ y (+ x t)))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -6e-19) {
tmp = (z + a) - b;
} else if (z <= 2.3e+110) {
tmp = b * ((a / b) - (y / (y + t)));
} else {
tmp = z * ((x + y) / (y + (x + t)));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (z <= (-6d-19)) then
tmp = (z + a) - b
else if (z <= 2.3d+110) then
tmp = b * ((a / b) - (y / (y + t)))
else
tmp = z * ((x + y) / (y + (x + t)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -6e-19) {
tmp = (z + a) - b;
} else if (z <= 2.3e+110) {
tmp = b * ((a / b) - (y / (y + t)));
} else {
tmp = z * ((x + y) / (y + (x + t)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= -6e-19: tmp = (z + a) - b elif z <= 2.3e+110: tmp = b * ((a / b) - (y / (y + t))) else: tmp = z * ((x + y) / (y + (x + t))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -6e-19) tmp = Float64(Float64(z + a) - b); elseif (z <= 2.3e+110) tmp = Float64(b * Float64(Float64(a / b) - Float64(y / Float64(y + t)))); else tmp = Float64(z * Float64(Float64(x + y) / Float64(y + Float64(x + t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (z <= -6e-19) tmp = (z + a) - b; elseif (z <= 2.3e+110) tmp = b * ((a / b) - (y / (y + t))); else tmp = z * ((x + y) / (y + (x + t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -6e-19], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision], If[LessEqual[z, 2.3e+110], N[(b * N[(N[(a / b), $MachinePrecision] - N[(y / N[(y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z * N[(N[(x + y), $MachinePrecision] / N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6 \cdot 10^{-19}:\\
\;\;\;\;\left(z + a\right) - b\\
\mathbf{elif}\;z \leq 2.3 \cdot 10^{+110}:\\
\;\;\;\;b \cdot \left(\frac{a}{b} - \frac{y}{y + t}\right)\\
\mathbf{else}:\\
\;\;\;\;z \cdot \frac{x + y}{y + \left(x + t\right)}\\
\end{array}
\end{array}
if z < -5.99999999999999985e-19Initial program 49.4%
Taylor expanded in y around inf 66.4%
if -5.99999999999999985e-19 < z < 2.3e110Initial program 73.4%
Taylor expanded in z around 0 61.4%
*-commutative61.4%
Simplified61.4%
Taylor expanded in x around 0 46.6%
Taylor expanded in a around -inf 52.7%
associate-*r*52.7%
mul-1-neg52.7%
sub-neg52.7%
associate-/l*61.7%
metadata-eval61.7%
Simplified61.7%
Taylor expanded in b around inf 66.3%
+-commutative66.3%
mul-1-neg66.3%
unsub-neg66.3%
+-commutative66.3%
Simplified66.3%
if 2.3e110 < z Initial program 50.2%
Taylor expanded in z around inf 36.4%
associate-/l*69.9%
+-commutative69.9%
associate-+r+69.9%
Simplified69.9%
Final simplification67.0%
(FPCore (x y z t a b) :precision binary64 (if (<= t -2e+86) (- a (* b (/ y t))) (if (<= t 2.4e+115) (- (+ z a) b) (* b (- (/ a b) (/ y (+ y t)))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -2e+86) {
tmp = a - (b * (y / t));
} else if (t <= 2.4e+115) {
tmp = (z + a) - b;
} else {
tmp = b * ((a / b) - (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 (t <= (-2d+86)) then
tmp = a - (b * (y / t))
else if (t <= 2.4d+115) then
tmp = (z + a) - b
else
tmp = b * ((a / b) - (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 (t <= -2e+86) {
tmp = a - (b * (y / t));
} else if (t <= 2.4e+115) {
tmp = (z + a) - b;
} else {
tmp = b * ((a / b) - (y / (y + t)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if t <= -2e+86: tmp = a - (b * (y / t)) elif t <= 2.4e+115: tmp = (z + a) - b else: tmp = b * ((a / b) - (y / (y + t))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (t <= -2e+86) tmp = Float64(a - Float64(b * Float64(y / t))); elseif (t <= 2.4e+115) tmp = Float64(Float64(z + a) - b); else tmp = Float64(b * Float64(Float64(a / b) - Float64(y / Float64(y + t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (t <= -2e+86) tmp = a - (b * (y / t)); elseif (t <= 2.4e+115) tmp = (z + a) - b; else tmp = b * ((a / b) - (y / (y + t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -2e+86], N[(a - N[(b * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.4e+115], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision], N[(b * N[(N[(a / b), $MachinePrecision] - N[(y / N[(y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2 \cdot 10^{+86}:\\
\;\;\;\;a - b \cdot \frac{y}{t}\\
\mathbf{elif}\;t \leq 2.4 \cdot 10^{+115}:\\
\;\;\;\;\left(z + a\right) - b\\
\mathbf{else}:\\
\;\;\;\;b \cdot \left(\frac{a}{b} - \frac{y}{y + t}\right)\\
\end{array}
\end{array}
if t < -2e86Initial program 48.0%
Taylor expanded in z around 0 39.4%
*-commutative39.4%
Simplified39.4%
Taylor expanded in x around 0 37.2%
Taylor expanded in a around -inf 58.4%
associate-*r*58.4%
mul-1-neg58.4%
sub-neg58.4%
associate-/l*67.1%
metadata-eval67.1%
Simplified67.1%
Taylor expanded in y around 0 60.9%
mul-1-neg60.9%
unsub-neg60.9%
associate-/l*73.9%
Simplified73.9%
if -2e86 < t < 2.4e115Initial program 68.3%
Taylor expanded in y around inf 66.2%
if 2.4e115 < t Initial program 54.0%
Taylor expanded in z around 0 40.9%
*-commutative40.9%
Simplified40.9%
Taylor expanded in x around 0 38.2%
Taylor expanded in a around -inf 53.3%
associate-*r*53.3%
mul-1-neg53.3%
sub-neg53.3%
associate-/l*57.9%
metadata-eval57.9%
Simplified57.9%
Taylor expanded in b around inf 57.7%
+-commutative57.7%
mul-1-neg57.7%
unsub-neg57.7%
+-commutative57.7%
Simplified57.7%
Final simplification66.1%
(FPCore (x y z t a b) :precision binary64 (if (<= t -8.5e+86) (- a (* b (/ y t))) (if (<= t 4e+141) (- (+ z a) b) (* a (/ (+ y t) (+ y (+ x t)))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -8.5e+86) {
tmp = a - (b * (y / t));
} else if (t <= 4e+141) {
tmp = (z + a) - b;
} 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 <= (-8.5d+86)) then
tmp = a - (b * (y / t))
else if (t <= 4d+141) then
tmp = (z + a) - b
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 <= -8.5e+86) {
tmp = a - (b * (y / t));
} else if (t <= 4e+141) {
tmp = (z + a) - b;
} else {
tmp = a * ((y + t) / (y + (x + t)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if t <= -8.5e+86: tmp = a - (b * (y / t)) elif t <= 4e+141: tmp = (z + a) - b else: tmp = a * ((y + t) / (y + (x + t))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (t <= -8.5e+86) tmp = Float64(a - Float64(b * Float64(y / t))); elseif (t <= 4e+141) tmp = Float64(Float64(z + a) - b); 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 <= -8.5e+86) tmp = a - (b * (y / t)); elseif (t <= 4e+141) tmp = (z + a) - b; else tmp = a * ((y + t) / (y + (x + t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -8.5e+86], N[(a - N[(b * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 4e+141], N[(N[(z + a), $MachinePrecision] - b), $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 -8.5 \cdot 10^{+86}:\\
\;\;\;\;a - b \cdot \frac{y}{t}\\
\mathbf{elif}\;t \leq 4 \cdot 10^{+141}:\\
\;\;\;\;\left(z + a\right) - b\\
\mathbf{else}:\\
\;\;\;\;a \cdot \frac{y + t}{y + \left(x + t\right)}\\
\end{array}
\end{array}
if t < -8.5000000000000005e86Initial program 48.0%
Taylor expanded in z around 0 39.4%
*-commutative39.4%
Simplified39.4%
Taylor expanded in x around 0 37.2%
Taylor expanded in a around -inf 58.4%
associate-*r*58.4%
mul-1-neg58.4%
sub-neg58.4%
associate-/l*67.1%
metadata-eval67.1%
Simplified67.1%
Taylor expanded in y around 0 60.9%
mul-1-neg60.9%
unsub-neg60.9%
associate-/l*73.9%
Simplified73.9%
if -8.5000000000000005e86 < t < 4.00000000000000007e141Initial program 68.5%
Taylor expanded in y around inf 64.7%
if 4.00000000000000007e141 < t Initial program 50.5%
Taylor expanded in a around inf 37.0%
associate-/l*60.2%
associate-+r+60.2%
Simplified60.2%
Final simplification65.6%
(FPCore (x y z t a b) :precision binary64 (if (or (<= t -8.8e+85) (not (<= t 4.1e+141))) (- a (* b (/ y t))) (- (+ z a) b)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -8.8e+85) || !(t <= 4.1e+141)) {
tmp = a - (b * (y / 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 <= (-8.8d+85)) .or. (.not. (t <= 4.1d+141))) then
tmp = a - (b * (y / 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 <= -8.8e+85) || !(t <= 4.1e+141)) {
tmp = a - (b * (y / t));
} else {
tmp = (z + a) - b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (t <= -8.8e+85) or not (t <= 4.1e+141): tmp = a - (b * (y / t)) else: tmp = (z + a) - b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((t <= -8.8e+85) || !(t <= 4.1e+141)) tmp = Float64(a - Float64(b * Float64(y / 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 <= -8.8e+85) || ~((t <= 4.1e+141))) tmp = a - (b * (y / t)); else tmp = (z + a) - b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[t, -8.8e+85], N[Not[LessEqual[t, 4.1e+141]], $MachinePrecision]], N[(a - N[(b * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -8.8 \cdot 10^{+85} \lor \neg \left(t \leq 4.1 \cdot 10^{+141}\right):\\
\;\;\;\;a - b \cdot \frac{y}{t}\\
\mathbf{else}:\\
\;\;\;\;\left(z + a\right) - b\\
\end{array}
\end{array}
if t < -8.8000000000000007e85 or 4.10000000000000022e141 < t Initial program 49.1%
Taylor expanded in z around 0 39.7%
*-commutative39.7%
Simplified39.7%
Taylor expanded in x around 0 38.4%
Taylor expanded in a around -inf 58.2%
associate-*r*58.2%
mul-1-neg58.2%
sub-neg58.2%
associate-/l*65.4%
metadata-eval65.4%
Simplified65.4%
Taylor expanded in y around 0 59.6%
mul-1-neg59.6%
unsub-neg59.6%
associate-/l*66.7%
Simplified66.7%
if -8.8000000000000007e85 < t < 4.10000000000000022e141Initial program 68.5%
Taylor expanded in y around inf 64.7%
Final simplification65.4%
(FPCore (x y z t a b) :precision binary64 (if (<= t -1.55e+130) a (if (<= t 5.6e+143) (- (+ z a) b) a)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -1.55e+130) {
tmp = a;
} else if (t <= 5.6e+143) {
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 <= (-1.55d+130)) then
tmp = a
else if (t <= 5.6d+143) 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 <= -1.55e+130) {
tmp = a;
} else if (t <= 5.6e+143) {
tmp = (z + a) - b;
} else {
tmp = a;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if t <= -1.55e+130: tmp = a elif t <= 5.6e+143: tmp = (z + a) - b else: tmp = a return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (t <= -1.55e+130) tmp = a; elseif (t <= 5.6e+143) 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 <= -1.55e+130) tmp = a; elseif (t <= 5.6e+143) tmp = (z + a) - b; else tmp = a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -1.55e+130], a, If[LessEqual[t, 5.6e+143], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision], a]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.55 \cdot 10^{+130}:\\
\;\;\;\;a\\
\mathbf{elif}\;t \leq 5.6 \cdot 10^{+143}:\\
\;\;\;\;\left(z + a\right) - b\\
\mathbf{else}:\\
\;\;\;\;a\\
\end{array}
\end{array}
if t < -1.55e130 or 5.59999999999999996e143 < t Initial program 49.4%
Taylor expanded in t around inf 57.8%
if -1.55e130 < t < 5.59999999999999996e143Initial program 67.7%
Taylor expanded in y around inf 64.0%
Final simplification62.2%
(FPCore (x y z t a b) :precision binary64 (if (<= x -1.15e+174) z (if (<= x 8.2e+42) a z)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -1.15e+174) {
tmp = z;
} else if (x <= 8.2e+42) {
tmp = a;
} else {
tmp = z;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (x <= (-1.15d+174)) then
tmp = z
else if (x <= 8.2d+42) then
tmp = a
else
tmp = z
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -1.15e+174) {
tmp = z;
} else if (x <= 8.2e+42) {
tmp = a;
} else {
tmp = z;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= -1.15e+174: tmp = z elif x <= 8.2e+42: tmp = a else: tmp = z return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -1.15e+174) tmp = z; elseif (x <= 8.2e+42) tmp = a; else tmp = z; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (x <= -1.15e+174) tmp = z; elseif (x <= 8.2e+42) tmp = a; else tmp = z; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -1.15e+174], z, If[LessEqual[x, 8.2e+42], a, z]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.15 \cdot 10^{+174}:\\
\;\;\;\;z\\
\mathbf{elif}\;x \leq 8.2 \cdot 10^{+42}:\\
\;\;\;\;a\\
\mathbf{else}:\\
\;\;\;\;z\\
\end{array}
\end{array}
if x < -1.1499999999999999e174 or 8.2000000000000001e42 < x Initial program 51.4%
Taylor expanded in x around inf 52.3%
if -1.1499999999999999e174 < x < 8.2000000000000001e42Initial program 67.9%
Taylor expanded in t around inf 44.8%
(FPCore (x y z t a b) :precision binary64 a)
double code(double x, double y, double z, double t, double a, double b) {
return a;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = a
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return a;
}
def code(x, y, z, t, a, b): return a
function code(x, y, z, t, a, b) return a end
function tmp = code(x, y, z, t, a, b) tmp = a; end
code[x_, y_, z_, t_, a_, b_] := a
\begin{array}{l}
\\
a
\end{array}
Initial program 62.4%
Taylor expanded in t around inf 33.3%
(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 2024106
(FPCore (x y z t a b)
:name "AI.Clustering.Hierarchical.Internal:ward from clustering-0.2.1"
:precision binary64
:alt
(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)))