
(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 17 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 (* a (+ y t)))
(t_2 (+ (+ y t) x))
(t_3
(*
(- b)
(fma
-1.0
(/ (+ (* a (/ (+ y t) t_2)) (* z (/ (+ y x) t_2))) b)
(/ y t_2))))
(t_4 (* z (+ y x)))
(t_5 (/ (- (+ t_4 t_1) (* b y)) (+ y (+ t x))))
(t_6 (+ t (+ y x))))
(if (<= t_5 (- INFINITY))
t_3
(if (<= t_5 2e+288)
(- (+ (/ t_1 t_6) (/ t_4 t_6)) (/ (* b y) t_6))
(if (<= t_5 INFINITY) (- (+ a z) b) t_3)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = a * (y + t);
double t_2 = (y + t) + x;
double t_3 = -b * fma(-1.0, (((a * ((y + t) / t_2)) + (z * ((y + x) / t_2))) / b), (y / t_2));
double t_4 = z * (y + x);
double t_5 = ((t_4 + t_1) - (b * y)) / (y + (t + x));
double t_6 = t + (y + x);
double tmp;
if (t_5 <= -((double) INFINITY)) {
tmp = t_3;
} else if (t_5 <= 2e+288) {
tmp = ((t_1 / t_6) + (t_4 / t_6)) - ((b * y) / t_6);
} else if (t_5 <= ((double) INFINITY)) {
tmp = (a + z) - b;
} else {
tmp = t_3;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(a * Float64(y + t)) t_2 = Float64(Float64(y + t) + x) t_3 = Float64(Float64(-b) * fma(-1.0, Float64(Float64(Float64(a * Float64(Float64(y + t) / t_2)) + Float64(z * Float64(Float64(y + x) / t_2))) / b), Float64(y / t_2))) t_4 = Float64(z * Float64(y + x)) t_5 = Float64(Float64(Float64(t_4 + t_1) - Float64(b * y)) / Float64(y + Float64(t + x))) t_6 = Float64(t + Float64(y + x)) tmp = 0.0 if (t_5 <= Float64(-Inf)) tmp = t_3; elseif (t_5 <= 2e+288) tmp = Float64(Float64(Float64(t_1 / t_6) + Float64(t_4 / t_6)) - Float64(Float64(b * y) / t_6)); elseif (t_5 <= Inf) tmp = Float64(Float64(a + z) - b); else tmp = t_3; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(a * N[(y + t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(y + t), $MachinePrecision] + x), $MachinePrecision]}, Block[{t$95$3 = N[((-b) * N[(-1.0 * N[(N[(N[(a * N[(N[(y + t), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision] + N[(z * N[(N[(y + x), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / b), $MachinePrecision] + N[(y / t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(z * N[(y + x), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(N[(N[(t$95$4 + t$95$1), $MachinePrecision] - N[(b * y), $MachinePrecision]), $MachinePrecision] / N[(y + N[(t + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$6 = N[(t + N[(y + x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$5, (-Infinity)], t$95$3, If[LessEqual[t$95$5, 2e+288], N[(N[(N[(t$95$1 / t$95$6), $MachinePrecision] + N[(t$95$4 / t$95$6), $MachinePrecision]), $MachinePrecision] - N[(N[(b * y), $MachinePrecision] / t$95$6), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$5, Infinity], N[(N[(a + z), $MachinePrecision] - b), $MachinePrecision], t$95$3]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot \left(y + t\right)\\
t_2 := \left(y + t\right) + x\\
t_3 := \left(-b\right) \cdot \mathsf{fma}\left(-1, \frac{a \cdot \frac{y + t}{t\_2} + z \cdot \frac{y + x}{t\_2}}{b}, \frac{y}{t\_2}\right)\\
t_4 := z \cdot \left(y + x\right)\\
t_5 := \frac{\left(t\_4 + t\_1\right) - b \cdot y}{y + \left(t + x\right)}\\
t_6 := t + \left(y + x\right)\\
\mathbf{if}\;t\_5 \leq -\infty:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;t\_5 \leq 2 \cdot 10^{+288}:\\
\;\;\;\;\left(\frac{t\_1}{t\_6} + \frac{t\_4}{t\_6}\right) - \frac{b \cdot y}{t\_6}\\
\mathbf{elif}\;t\_5 \leq \infty:\\
\;\;\;\;\left(a + z\right) - b\\
\mathbf{else}:\\
\;\;\;\;t\_3\\
\end{array}
\end{array}
if (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < -inf.0 or +inf.0 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 4.4%
Taylor expanded in b around -inf 21.7%
associate-*r*21.7%
neg-mul-121.7%
fma-define21.7%
Simplified81.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)) < 2e288Initial program 99.7%
Taylor expanded in b around 0 99.8%
if 2e288 < (/.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.3%
Taylor expanded in y around inf 78.9%
Final simplification91.9%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* a (+ y t)))
(t_2 (+ t (+ y x)))
(t_3 (* z (+ y x)))
(t_4 (/ (- (+ t_3 t_1) (* b y)) (+ y (+ t x))))
(t_5 (+ (+ y t) x)))
(if (<= t_4 (- INFINITY))
(*
b
(- (fma z (/ (+ y x) (* b t_5)) (* (/ (+ y t) t_5) (/ a b))) (/ y t_5)))
(if (<= t_4 2e+288)
(- (+ (/ t_1 t_2) (/ t_3 t_2)) (/ (* b y) t_2))
(- (+ a z) b)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = a * (y + t);
double t_2 = t + (y + x);
double t_3 = z * (y + x);
double t_4 = ((t_3 + t_1) - (b * y)) / (y + (t + x));
double t_5 = (y + t) + x;
double tmp;
if (t_4 <= -((double) INFINITY)) {
tmp = b * (fma(z, ((y + x) / (b * t_5)), (((y + t) / t_5) * (a / b))) - (y / t_5));
} else if (t_4 <= 2e+288) {
tmp = ((t_1 / t_2) + (t_3 / t_2)) - ((b * y) / t_2);
} else {
tmp = (a + z) - b;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(a * Float64(y + t)) t_2 = Float64(t + Float64(y + x)) t_3 = Float64(z * Float64(y + x)) t_4 = Float64(Float64(Float64(t_3 + t_1) - Float64(b * y)) / Float64(y + Float64(t + x))) t_5 = Float64(Float64(y + t) + x) tmp = 0.0 if (t_4 <= Float64(-Inf)) tmp = Float64(b * Float64(fma(z, Float64(Float64(y + x) / Float64(b * t_5)), Float64(Float64(Float64(y + t) / t_5) * Float64(a / b))) - Float64(y / t_5))); elseif (t_4 <= 2e+288) tmp = Float64(Float64(Float64(t_1 / t_2) + Float64(t_3 / t_2)) - Float64(Float64(b * y) / t_2)); else tmp = Float64(Float64(a + z) - b); end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(a * N[(y + t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t + N[(y + x), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(z * N[(y + x), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[(N[(t$95$3 + t$95$1), $MachinePrecision] - N[(b * y), $MachinePrecision]), $MachinePrecision] / N[(y + N[(t + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(N[(y + t), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[t$95$4, (-Infinity)], N[(b * N[(N[(z * N[(N[(y + x), $MachinePrecision] / N[(b * t$95$5), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(y + t), $MachinePrecision] / t$95$5), $MachinePrecision] * N[(a / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(y / t$95$5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$4, 2e+288], N[(N[(N[(t$95$1 / t$95$2), $MachinePrecision] + N[(t$95$3 / t$95$2), $MachinePrecision]), $MachinePrecision] - N[(N[(b * y), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision], N[(N[(a + z), $MachinePrecision] - b), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot \left(y + t\right)\\
t_2 := t + \left(y + x\right)\\
t_3 := z \cdot \left(y + x\right)\\
t_4 := \frac{\left(t\_3 + t\_1\right) - b \cdot y}{y + \left(t + x\right)}\\
t_5 := \left(y + t\right) + x\\
\mathbf{if}\;t\_4 \leq -\infty:\\
\;\;\;\;b \cdot \left(\mathsf{fma}\left(z, \frac{y + x}{b \cdot t\_5}, \frac{y + t}{t\_5} \cdot \frac{a}{b}\right) - \frac{y}{t\_5}\right)\\
\mathbf{elif}\;t\_4 \leq 2 \cdot 10^{+288}:\\
\;\;\;\;\left(\frac{t\_1}{t\_2} + \frac{t\_3}{t\_2}\right) - \frac{b \cdot y}{t\_2}\\
\mathbf{else}:\\
\;\;\;\;\left(a + z\right) - b\\
\end{array}
\end{array}
if (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < -inf.0Initial program 6.2%
Taylor expanded in b around inf 28.6%
+-commutative28.6%
mul-1-neg28.6%
unsub-neg28.6%
Simplified65.8%
if -inf.0 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 2e288Initial program 99.7%
Taylor expanded in b around 0 99.8%
if 2e288 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 4.9%
Taylor expanded in y around inf 74.9%
Final simplification88.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ (+ y t) x)) (t_2 (/ y t_1)))
(if (or (<= b -4.4e-57) (not (<= b 1.25e-114)))
(*
(- b)
(fma -1.0 (/ (+ (* a (/ (+ y t) t_1)) (* z (/ (+ y x) t_1))) b) t_2))
(*
a
(+
(/ t t_1)
(- (fma z (/ (+ y x) (* a t_1)) t_2) (/ (/ (* b y) a) t_1)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (y + t) + x;
double t_2 = y / t_1;
double tmp;
if ((b <= -4.4e-57) || !(b <= 1.25e-114)) {
tmp = -b * fma(-1.0, (((a * ((y + t) / t_1)) + (z * ((y + x) / t_1))) / b), t_2);
} else {
tmp = a * ((t / t_1) + (fma(z, ((y + x) / (a * t_1)), t_2) - (((b * y) / a) / t_1)));
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(y + t) + x) t_2 = Float64(y / t_1) tmp = 0.0 if ((b <= -4.4e-57) || !(b <= 1.25e-114)) tmp = Float64(Float64(-b) * fma(-1.0, Float64(Float64(Float64(a * Float64(Float64(y + t) / t_1)) + Float64(z * Float64(Float64(y + x) / t_1))) / b), t_2)); else tmp = Float64(a * Float64(Float64(t / t_1) + Float64(fma(z, Float64(Float64(y + x) / Float64(a * t_1)), t_2) - Float64(Float64(Float64(b * y) / a) / t_1)))); end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(y + t), $MachinePrecision] + x), $MachinePrecision]}, Block[{t$95$2 = N[(y / t$95$1), $MachinePrecision]}, If[Or[LessEqual[b, -4.4e-57], N[Not[LessEqual[b, 1.25e-114]], $MachinePrecision]], N[((-b) * N[(-1.0 * N[(N[(N[(a * N[(N[(y + t), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision] + N[(z * N[(N[(y + x), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / b), $MachinePrecision] + t$95$2), $MachinePrecision]), $MachinePrecision], N[(a * N[(N[(t / t$95$1), $MachinePrecision] + N[(N[(z * N[(N[(y + x), $MachinePrecision] / N[(a * t$95$1), $MachinePrecision]), $MachinePrecision] + t$95$2), $MachinePrecision] - N[(N[(N[(b * y), $MachinePrecision] / a), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(y + t\right) + x\\
t_2 := \frac{y}{t\_1}\\
\mathbf{if}\;b \leq -4.4 \cdot 10^{-57} \lor \neg \left(b \leq 1.25 \cdot 10^{-114}\right):\\
\;\;\;\;\left(-b\right) \cdot \mathsf{fma}\left(-1, \frac{a \cdot \frac{y + t}{t\_1} + z \cdot \frac{y + x}{t\_1}}{b}, t\_2\right)\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(\frac{t}{t\_1} + \left(\mathsf{fma}\left(z, \frac{y + x}{a \cdot t\_1}, t\_2\right) - \frac{\frac{b \cdot y}{a}}{t\_1}\right)\right)\\
\end{array}
\end{array}
if b < -4.39999999999999997e-57 or 1.24999999999999997e-114 < b Initial program 60.2%
Taylor expanded in b around -inf 67.3%
associate-*r*67.3%
neg-mul-167.3%
fma-define67.3%
Simplified95.2%
if -4.39999999999999997e-57 < b < 1.24999999999999997e-114Initial program 63.5%
Taylor expanded in a around inf 75.0%
associate--l+75.0%
+-commutative75.0%
associate-+r+75.0%
Simplified85.4%
Final simplification91.6%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* a (+ y t)))
(t_2 (+ t (+ y x)))
(t_3 (* z (+ y x)))
(t_4 (/ (- (+ t_3 t_1) (* b y)) (+ y (+ t x)))))
(if (or (<= t_4 (- INFINITY)) (not (<= t_4 2e+288)))
(- (+ a z) b)
(- (+ (/ t_1 t_2) (/ t_3 t_2)) (/ (* b y) t_2)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = a * (y + t);
double t_2 = t + (y + x);
double t_3 = z * (y + x);
double t_4 = ((t_3 + t_1) - (b * y)) / (y + (t + x));
double tmp;
if ((t_4 <= -((double) INFINITY)) || !(t_4 <= 2e+288)) {
tmp = (a + z) - b;
} else {
tmp = ((t_1 / t_2) + (t_3 / t_2)) - ((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 = a * (y + t);
double t_2 = t + (y + x);
double t_3 = z * (y + x);
double t_4 = ((t_3 + t_1) - (b * y)) / (y + (t + x));
double tmp;
if ((t_4 <= -Double.POSITIVE_INFINITY) || !(t_4 <= 2e+288)) {
tmp = (a + z) - b;
} else {
tmp = ((t_1 / t_2) + (t_3 / t_2)) - ((b * y) / t_2);
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = a * (y + t) t_2 = t + (y + x) t_3 = z * (y + x) t_4 = ((t_3 + t_1) - (b * y)) / (y + (t + x)) tmp = 0 if (t_4 <= -math.inf) or not (t_4 <= 2e+288): tmp = (a + z) - b else: tmp = ((t_1 / t_2) + (t_3 / t_2)) - ((b * y) / t_2) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(a * Float64(y + t)) t_2 = Float64(t + Float64(y + x)) t_3 = Float64(z * Float64(y + x)) t_4 = Float64(Float64(Float64(t_3 + t_1) - Float64(b * y)) / Float64(y + Float64(t + x))) tmp = 0.0 if ((t_4 <= Float64(-Inf)) || !(t_4 <= 2e+288)) tmp = Float64(Float64(a + z) - b); else tmp = Float64(Float64(Float64(t_1 / t_2) + Float64(t_3 / t_2)) - Float64(Float64(b * y) / t_2)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = a * (y + t); t_2 = t + (y + x); t_3 = z * (y + x); t_4 = ((t_3 + t_1) - (b * y)) / (y + (t + x)); tmp = 0.0; if ((t_4 <= -Inf) || ~((t_4 <= 2e+288))) tmp = (a + z) - b; else tmp = ((t_1 / t_2) + (t_3 / t_2)) - ((b * y) / t_2); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(a * N[(y + t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t + N[(y + x), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(z * N[(y + x), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[(N[(t$95$3 + t$95$1), $MachinePrecision] - N[(b * y), $MachinePrecision]), $MachinePrecision] / N[(y + N[(t + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$4, (-Infinity)], N[Not[LessEqual[t$95$4, 2e+288]], $MachinePrecision]], N[(N[(a + z), $MachinePrecision] - b), $MachinePrecision], N[(N[(N[(t$95$1 / t$95$2), $MachinePrecision] + N[(t$95$3 / t$95$2), $MachinePrecision]), $MachinePrecision] - N[(N[(b * y), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot \left(y + t\right)\\
t_2 := t + \left(y + x\right)\\
t_3 := z \cdot \left(y + x\right)\\
t_4 := \frac{\left(t\_3 + t\_1\right) - b \cdot y}{y + \left(t + x\right)}\\
\mathbf{if}\;t\_4 \leq -\infty \lor \neg \left(t\_4 \leq 2 \cdot 10^{+288}\right):\\
\;\;\;\;\left(a + z\right) - b\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{t\_1}{t\_2} + \frac{t\_3}{t\_2}\right) - \frac{b \cdot y}{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 2e288 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 5.3%
Taylor expanded in y around inf 67.6%
if -inf.0 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 2e288Initial program 99.7%
Taylor expanded in b around 0 99.8%
Final simplification86.7%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* a (+ y t)))
(t_2 (* z (+ y x)))
(t_3 (/ (- (+ t_2 t_1) (* b y)) (+ y (+ t x))))
(t_4 (+ t (+ y x))))
(if (<= t_3 (- INFINITY))
(*
z
(+
(/ x t_4)
(- (+ (/ y t_4) (* a (/ (+ y t) (* z t_4)))) (/ (* b (/ y z)) t_4))))
(if (<= t_3 2e+288)
(- (+ (/ t_1 t_4) (/ t_2 t_4)) (/ (* b y) t_4))
(- (+ a z) b)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = a * (y + t);
double t_2 = z * (y + x);
double t_3 = ((t_2 + t_1) - (b * y)) / (y + (t + x));
double t_4 = t + (y + x);
double tmp;
if (t_3 <= -((double) INFINITY)) {
tmp = z * ((x / t_4) + (((y / t_4) + (a * ((y + t) / (z * t_4)))) - ((b * (y / z)) / t_4)));
} else if (t_3 <= 2e+288) {
tmp = ((t_1 / t_4) + (t_2 / t_4)) - ((b * y) / t_4);
} else {
tmp = (a + z) - b;
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = a * (y + t);
double t_2 = z * (y + x);
double t_3 = ((t_2 + t_1) - (b * y)) / (y + (t + x));
double t_4 = t + (y + x);
double tmp;
if (t_3 <= -Double.POSITIVE_INFINITY) {
tmp = z * ((x / t_4) + (((y / t_4) + (a * ((y + t) / (z * t_4)))) - ((b * (y / z)) / t_4)));
} else if (t_3 <= 2e+288) {
tmp = ((t_1 / t_4) + (t_2 / t_4)) - ((b * y) / t_4);
} else {
tmp = (a + z) - b;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = a * (y + t) t_2 = z * (y + x) t_3 = ((t_2 + t_1) - (b * y)) / (y + (t + x)) t_4 = t + (y + x) tmp = 0 if t_3 <= -math.inf: tmp = z * ((x / t_4) + (((y / t_4) + (a * ((y + t) / (z * t_4)))) - ((b * (y / z)) / t_4))) elif t_3 <= 2e+288: tmp = ((t_1 / t_4) + (t_2 / t_4)) - ((b * y) / t_4) else: tmp = (a + z) - b return tmp
function code(x, y, z, t, a, b) t_1 = Float64(a * Float64(y + t)) t_2 = Float64(z * Float64(y + x)) t_3 = Float64(Float64(Float64(t_2 + t_1) - Float64(b * y)) / Float64(y + Float64(t + x))) t_4 = Float64(t + Float64(y + x)) tmp = 0.0 if (t_3 <= Float64(-Inf)) tmp = Float64(z * Float64(Float64(x / t_4) + Float64(Float64(Float64(y / t_4) + Float64(a * Float64(Float64(y + t) / Float64(z * t_4)))) - Float64(Float64(b * Float64(y / z)) / t_4)))); elseif (t_3 <= 2e+288) tmp = Float64(Float64(Float64(t_1 / t_4) + Float64(t_2 / t_4)) - Float64(Float64(b * y) / t_4)); else tmp = Float64(Float64(a + z) - b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = a * (y + t); t_2 = z * (y + x); t_3 = ((t_2 + t_1) - (b * y)) / (y + (t + x)); t_4 = t + (y + x); tmp = 0.0; if (t_3 <= -Inf) tmp = z * ((x / t_4) + (((y / t_4) + (a * ((y + t) / (z * t_4)))) - ((b * (y / z)) / t_4))); elseif (t_3 <= 2e+288) tmp = ((t_1 / t_4) + (t_2 / t_4)) - ((b * y) / t_4); else tmp = (a + z) - b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(a * N[(y + t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(z * N[(y + x), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(t$95$2 + t$95$1), $MachinePrecision] - N[(b * y), $MachinePrecision]), $MachinePrecision] / N[(y + N[(t + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(t + N[(y + x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$3, (-Infinity)], N[(z * N[(N[(x / t$95$4), $MachinePrecision] + N[(N[(N[(y / t$95$4), $MachinePrecision] + N[(a * N[(N[(y + t), $MachinePrecision] / N[(z * t$95$4), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(b * N[(y / z), $MachinePrecision]), $MachinePrecision] / t$95$4), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$3, 2e+288], N[(N[(N[(t$95$1 / t$95$4), $MachinePrecision] + N[(t$95$2 / t$95$4), $MachinePrecision]), $MachinePrecision] - N[(N[(b * y), $MachinePrecision] / t$95$4), $MachinePrecision]), $MachinePrecision], N[(N[(a + z), $MachinePrecision] - b), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot \left(y + t\right)\\
t_2 := z \cdot \left(y + x\right)\\
t_3 := \frac{\left(t\_2 + t\_1\right) - b \cdot y}{y + \left(t + x\right)}\\
t_4 := t + \left(y + x\right)\\
\mathbf{if}\;t\_3 \leq -\infty:\\
\;\;\;\;z \cdot \left(\frac{x}{t\_4} + \left(\left(\frac{y}{t\_4} + a \cdot \frac{y + t}{z \cdot t\_4}\right) - \frac{b \cdot \frac{y}{z}}{t\_4}\right)\right)\\
\mathbf{elif}\;t\_3 \leq 2 \cdot 10^{+288}:\\
\;\;\;\;\left(\frac{t\_1}{t\_4} + \frac{t\_2}{t\_4}\right) - \frac{b \cdot y}{t\_4}\\
\mathbf{else}:\\
\;\;\;\;\left(a + z\right) - b\\
\end{array}
\end{array}
if (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < -inf.0Initial program 6.2%
fma-define6.2%
+-commutative6.2%
associate-+l+6.2%
+-commutative6.2%
Simplified6.2%
Taylor expanded in z around inf 5.9%
Taylor expanded in z around inf 44.0%
associate--l+44.0%
+-commutative44.0%
+-commutative44.0%
associate-/l*60.0%
+-commutative60.0%
+-commutative60.0%
associate-/r*55.3%
associate-/l*63.1%
+-commutative63.1%
Simplified63.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)) < 2e288Initial program 99.7%
Taylor expanded in b around 0 99.8%
if 2e288 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 4.9%
Taylor expanded in y around inf 74.9%
Final simplification88.0%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (/ (- (+ (* z (+ y x)) (* a (+ y t))) (* b y)) (+ y (+ t x))))) (if (or (<= t_1 (- INFINITY)) (not (<= t_1 2e+288))) (- (+ a z) b) t_1)))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (((z * (y + x)) + (a * (y + t))) - (b * y)) / (y + (t + x));
double tmp;
if ((t_1 <= -((double) INFINITY)) || !(t_1 <= 2e+288)) {
tmp = (a + z) - 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 * (y + x)) + (a * (y + t))) - (b * y)) / (y + (t + x));
double tmp;
if ((t_1 <= -Double.POSITIVE_INFINITY) || !(t_1 <= 2e+288)) {
tmp = (a + z) - b;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (((z * (y + x)) + (a * (y + t))) - (b * y)) / (y + (t + x)) tmp = 0 if (t_1 <= -math.inf) or not (t_1 <= 2e+288): tmp = (a + z) - b else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(Float64(z * Float64(y + x)) + Float64(a * Float64(y + t))) - Float64(b * y)) / Float64(y + Float64(t + x))) tmp = 0.0 if ((t_1 <= Float64(-Inf)) || !(t_1 <= 2e+288)) tmp = Float64(Float64(a + z) - b); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (((z * (y + x)) + (a * (y + t))) - (b * y)) / (y + (t + x)); tmp = 0.0; if ((t_1 <= -Inf) || ~((t_1 <= 2e+288))) tmp = (a + z) - 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[(y + x), $MachinePrecision]), $MachinePrecision] + N[(a * N[(y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(b * y), $MachinePrecision]), $MachinePrecision] / N[(y + N[(t + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$1, (-Infinity)], N[Not[LessEqual[t$95$1, 2e+288]], $MachinePrecision]], N[(N[(a + z), $MachinePrecision] - b), $MachinePrecision], t$95$1]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\left(z \cdot \left(y + x\right) + a \cdot \left(y + t\right)\right) - b \cdot y}{y + \left(t + x\right)}\\
\mathbf{if}\;t\_1 \leq -\infty \lor \neg \left(t\_1 \leq 2 \cdot 10^{+288}\right):\\
\;\;\;\;\left(a + z\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 2e288 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 5.3%
Taylor expanded in y around inf 67.6%
if -inf.0 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 2e288Initial program 99.7%
Final simplification86.7%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ (+ y t) x)) (t_2 (- (+ a z) b)))
(if (<= y -2e-42)
t_2
(if (<= y -3.4e-201)
(* z (/ (+ y x) t_1))
(if (<= y 1.5e-146)
(/ (+ (* a t) (* x z)) (+ t x))
(if (<= y 2.15e-50) (* a (/ (+ y t) t_1)) t_2))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (y + t) + x;
double t_2 = (a + z) - b;
double tmp;
if (y <= -2e-42) {
tmp = t_2;
} else if (y <= -3.4e-201) {
tmp = z * ((y + x) / t_1);
} else if (y <= 1.5e-146) {
tmp = ((a * t) + (x * z)) / (t + x);
} else if (y <= 2.15e-50) {
tmp = a * ((y + t) / t_1);
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (y + t) + x
t_2 = (a + z) - b
if (y <= (-2d-42)) then
tmp = t_2
else if (y <= (-3.4d-201)) then
tmp = z * ((y + x) / t_1)
else if (y <= 1.5d-146) then
tmp = ((a * t) + (x * z)) / (t + x)
else if (y <= 2.15d-50) then
tmp = a * ((y + t) / t_1)
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (y + t) + x;
double t_2 = (a + z) - b;
double tmp;
if (y <= -2e-42) {
tmp = t_2;
} else if (y <= -3.4e-201) {
tmp = z * ((y + x) / t_1);
} else if (y <= 1.5e-146) {
tmp = ((a * t) + (x * z)) / (t + x);
} else if (y <= 2.15e-50) {
tmp = a * ((y + t) / t_1);
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (y + t) + x t_2 = (a + z) - b tmp = 0 if y <= -2e-42: tmp = t_2 elif y <= -3.4e-201: tmp = z * ((y + x) / t_1) elif y <= 1.5e-146: tmp = ((a * t) + (x * z)) / (t + x) elif y <= 2.15e-50: tmp = a * ((y + t) / t_1) else: tmp = t_2 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(y + t) + x) t_2 = Float64(Float64(a + z) - b) tmp = 0.0 if (y <= -2e-42) tmp = t_2; elseif (y <= -3.4e-201) tmp = Float64(z * Float64(Float64(y + x) / t_1)); elseif (y <= 1.5e-146) tmp = Float64(Float64(Float64(a * t) + Float64(x * z)) / Float64(t + x)); elseif (y <= 2.15e-50) tmp = Float64(a * Float64(Float64(y + t) / t_1)); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (y + t) + x; t_2 = (a + z) - b; tmp = 0.0; if (y <= -2e-42) tmp = t_2; elseif (y <= -3.4e-201) tmp = z * ((y + x) / t_1); elseif (y <= 1.5e-146) tmp = ((a * t) + (x * z)) / (t + x); elseif (y <= 2.15e-50) tmp = a * ((y + t) / t_1); else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(y + t), $MachinePrecision] + x), $MachinePrecision]}, Block[{t$95$2 = N[(N[(a + z), $MachinePrecision] - b), $MachinePrecision]}, If[LessEqual[y, -2e-42], t$95$2, If[LessEqual[y, -3.4e-201], N[(z * N[(N[(y + x), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.5e-146], N[(N[(N[(a * t), $MachinePrecision] + N[(x * z), $MachinePrecision]), $MachinePrecision] / N[(t + x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.15e-50], N[(a * N[(N[(y + t), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(y + t\right) + x\\
t_2 := \left(a + z\right) - b\\
\mathbf{if}\;y \leq -2 \cdot 10^{-42}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;y \leq -3.4 \cdot 10^{-201}:\\
\;\;\;\;z \cdot \frac{y + x}{t\_1}\\
\mathbf{elif}\;y \leq 1.5 \cdot 10^{-146}:\\
\;\;\;\;\frac{a \cdot t + x \cdot z}{t + x}\\
\mathbf{elif}\;y \leq 2.15 \cdot 10^{-50}:\\
\;\;\;\;a \cdot \frac{y + t}{t\_1}\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if y < -2.00000000000000008e-42 or 2.14999999999999999e-50 < y Initial program 50.1%
Taylor expanded in y around inf 65.2%
if -2.00000000000000008e-42 < y < -3.39999999999999985e-201Initial program 67.8%
Taylor expanded in z around inf 49.6%
associate-/l*65.6%
+-commutative65.6%
+-commutative65.6%
associate-+r+65.6%
Simplified65.6%
if -3.39999999999999985e-201 < y < 1.50000000000000009e-146Initial program 86.9%
Taylor expanded in y around 0 74.2%
if 1.50000000000000009e-146 < y < 2.14999999999999999e-50Initial program 81.1%
Taylor expanded in a around inf 56.4%
associate-/l*71.4%
+-commutative71.4%
+-commutative71.4%
associate-+r+71.4%
Simplified71.4%
Final simplification67.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ t (+ y x))) (t_2 (- (+ a z) b)))
(if (<= y -8.2e+102)
t_2
(if (<= y -7.5e-41)
(- (/ (* a (+ y t)) t_1) (/ (* b y) t_1))
(if (<= y 1.06e+91) (+ (* x (/ z (+ t x))) (* a (/ t (+ t x)))) t_2)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = t + (y + x);
double t_2 = (a + z) - b;
double tmp;
if (y <= -8.2e+102) {
tmp = t_2;
} else if (y <= -7.5e-41) {
tmp = ((a * (y + t)) / t_1) - ((b * y) / t_1);
} else if (y <= 1.06e+91) {
tmp = (x * (z / (t + x))) + (a * (t / (t + x)));
} 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 = t + (y + x)
t_2 = (a + z) - b
if (y <= (-8.2d+102)) then
tmp = t_2
else if (y <= (-7.5d-41)) then
tmp = ((a * (y + t)) / t_1) - ((b * y) / t_1)
else if (y <= 1.06d+91) then
tmp = (x * (z / (t + x))) + (a * (t / (t + x)))
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 = t + (y + x);
double t_2 = (a + z) - b;
double tmp;
if (y <= -8.2e+102) {
tmp = t_2;
} else if (y <= -7.5e-41) {
tmp = ((a * (y + t)) / t_1) - ((b * y) / t_1);
} else if (y <= 1.06e+91) {
tmp = (x * (z / (t + x))) + (a * (t / (t + x)));
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = t + (y + x) t_2 = (a + z) - b tmp = 0 if y <= -8.2e+102: tmp = t_2 elif y <= -7.5e-41: tmp = ((a * (y + t)) / t_1) - ((b * y) / t_1) elif y <= 1.06e+91: tmp = (x * (z / (t + x))) + (a * (t / (t + x))) else: tmp = t_2 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(t + Float64(y + x)) t_2 = Float64(Float64(a + z) - b) tmp = 0.0 if (y <= -8.2e+102) tmp = t_2; elseif (y <= -7.5e-41) tmp = Float64(Float64(Float64(a * Float64(y + t)) / t_1) - Float64(Float64(b * y) / t_1)); elseif (y <= 1.06e+91) tmp = Float64(Float64(x * Float64(z / Float64(t + x))) + Float64(a * Float64(t / Float64(t + x)))); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = t + (y + x); t_2 = (a + z) - b; tmp = 0.0; if (y <= -8.2e+102) tmp = t_2; elseif (y <= -7.5e-41) tmp = ((a * (y + t)) / t_1) - ((b * y) / t_1); elseif (y <= 1.06e+91) tmp = (x * (z / (t + x))) + (a * (t / (t + x))); else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(t + N[(y + x), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(a + z), $MachinePrecision] - b), $MachinePrecision]}, If[LessEqual[y, -8.2e+102], t$95$2, If[LessEqual[y, -7.5e-41], N[(N[(N[(a * N[(y + t), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision] - N[(N[(b * y), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.06e+91], N[(N[(x * N[(z / N[(t + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(a * N[(t / N[(t + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t + \left(y + x\right)\\
t_2 := \left(a + z\right) - b\\
\mathbf{if}\;y \leq -8.2 \cdot 10^{+102}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;y \leq -7.5 \cdot 10^{-41}:\\
\;\;\;\;\frac{a \cdot \left(y + t\right)}{t\_1} - \frac{b \cdot y}{t\_1}\\
\mathbf{elif}\;y \leq 1.06 \cdot 10^{+91}:\\
\;\;\;\;x \cdot \frac{z}{t + x} + a \cdot \frac{t}{t + x}\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if y < -8.1999999999999999e102 or 1.05999999999999996e91 < y Initial program 36.0%
Taylor expanded in y around inf 81.6%
if -8.1999999999999999e102 < y < -7.50000000000000049e-41Initial program 65.9%
Taylor expanded in z around inf 65.1%
associate--l+65.1%
+-commutative65.1%
associate-+r+65.1%
Simplified78.3%
Taylor expanded in z around 0 56.4%
if -7.50000000000000049e-41 < y < 1.05999999999999996e91Initial program 77.4%
Taylor expanded in b around -inf 66.7%
associate-*r*66.7%
neg-mul-166.7%
fma-define66.7%
Simplified79.0%
Taylor expanded in y around 0 53.5%
+-commutative53.5%
associate-/l*58.6%
+-commutative58.6%
Simplified58.6%
associate-/l*70.1%
Applied egg-rr70.1%
Final simplification72.2%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (- (+ a z) b)))
(if (<= y -8.2e+102)
t_1
(if (<= y -1.05e-40)
(/ (- (* a (+ y t)) (* b y)) (+ y (+ t x)))
(if (<= y 7.5e+93) (+ (* x (/ z (+ t x))) (* a (/ t (+ t x)))) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (a + z) - b;
double tmp;
if (y <= -8.2e+102) {
tmp = t_1;
} else if (y <= -1.05e-40) {
tmp = ((a * (y + t)) - (b * y)) / (y + (t + x));
} else if (y <= 7.5e+93) {
tmp = (x * (z / (t + x))) + (a * (t / (t + x)));
} 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 + z) - b
if (y <= (-8.2d+102)) then
tmp = t_1
else if (y <= (-1.05d-40)) then
tmp = ((a * (y + t)) - (b * y)) / (y + (t + x))
else if (y <= 7.5d+93) then
tmp = (x * (z / (t + x))) + (a * (t / (t + x)))
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 + z) - b;
double tmp;
if (y <= -8.2e+102) {
tmp = t_1;
} else if (y <= -1.05e-40) {
tmp = ((a * (y + t)) - (b * y)) / (y + (t + x));
} else if (y <= 7.5e+93) {
tmp = (x * (z / (t + x))) + (a * (t / (t + x)));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (a + z) - b tmp = 0 if y <= -8.2e+102: tmp = t_1 elif y <= -1.05e-40: tmp = ((a * (y + t)) - (b * y)) / (y + (t + x)) elif y <= 7.5e+93: tmp = (x * (z / (t + x))) + (a * (t / (t + x))) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(a + z) - b) tmp = 0.0 if (y <= -8.2e+102) tmp = t_1; elseif (y <= -1.05e-40) tmp = Float64(Float64(Float64(a * Float64(y + t)) - Float64(b * y)) / Float64(y + Float64(t + x))); elseif (y <= 7.5e+93) tmp = Float64(Float64(x * Float64(z / Float64(t + x))) + Float64(a * Float64(t / Float64(t + x)))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (a + z) - b; tmp = 0.0; if (y <= -8.2e+102) tmp = t_1; elseif (y <= -1.05e-40) tmp = ((a * (y + t)) - (b * y)) / (y + (t + x)); elseif (y <= 7.5e+93) tmp = (x * (z / (t + x))) + (a * (t / (t + x))); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(a + z), $MachinePrecision] - b), $MachinePrecision]}, If[LessEqual[y, -8.2e+102], t$95$1, If[LessEqual[y, -1.05e-40], N[(N[(N[(a * N[(y + t), $MachinePrecision]), $MachinePrecision] - N[(b * y), $MachinePrecision]), $MachinePrecision] / N[(y + N[(t + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 7.5e+93], N[(N[(x * N[(z / N[(t + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(a * N[(t / N[(t + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(a + z\right) - b\\
\mathbf{if}\;y \leq -8.2 \cdot 10^{+102}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -1.05 \cdot 10^{-40}:\\
\;\;\;\;\frac{a \cdot \left(y + t\right) - b \cdot y}{y + \left(t + x\right)}\\
\mathbf{elif}\;y \leq 7.5 \cdot 10^{+93}:\\
\;\;\;\;x \cdot \frac{z}{t + x} + a \cdot \frac{t}{t + x}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -8.1999999999999999e102 or 7.5000000000000002e93 < y Initial program 36.0%
Taylor expanded in y around inf 81.6%
if -8.1999999999999999e102 < y < -1.05000000000000009e-40Initial program 65.9%
Taylor expanded in z around 0 56.3%
+-commutative56.3%
*-commutative56.3%
Simplified56.3%
if -1.05000000000000009e-40 < y < 7.5000000000000002e93Initial program 77.4%
Taylor expanded in b around -inf 66.7%
associate-*r*66.7%
neg-mul-166.7%
fma-define66.7%
Simplified79.0%
Taylor expanded in y around 0 53.5%
+-commutative53.5%
associate-/l*58.6%
+-commutative58.6%
Simplified58.6%
associate-/l*70.1%
Applied egg-rr70.1%
Final simplification72.2%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -2.4e+67) (not (<= y 4e+91))) (- (+ a z) b) (+ (* x (/ z (+ t x))) (* a (/ t (+ t x))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -2.4e+67) || !(y <= 4e+91)) {
tmp = (a + z) - b;
} else {
tmp = (x * (z / (t + x))) + (a * (t / (t + x)));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((y <= (-2.4d+67)) .or. (.not. (y <= 4d+91))) then
tmp = (a + z) - b
else
tmp = (x * (z / (t + x))) + (a * (t / (t + x)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -2.4e+67) || !(y <= 4e+91)) {
tmp = (a + z) - b;
} else {
tmp = (x * (z / (t + x))) + (a * (t / (t + x)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -2.4e+67) or not (y <= 4e+91): tmp = (a + z) - b else: tmp = (x * (z / (t + x))) + (a * (t / (t + x))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -2.4e+67) || !(y <= 4e+91)) tmp = Float64(Float64(a + z) - b); else tmp = Float64(Float64(x * Float64(z / Float64(t + x))) + Float64(a * Float64(t / Float64(t + x)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -2.4e+67) || ~((y <= 4e+91))) tmp = (a + z) - b; else tmp = (x * (z / (t + x))) + (a * (t / (t + x))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -2.4e+67], N[Not[LessEqual[y, 4e+91]], $MachinePrecision]], N[(N[(a + z), $MachinePrecision] - b), $MachinePrecision], N[(N[(x * N[(z / N[(t + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(a * N[(t / N[(t + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.4 \cdot 10^{+67} \lor \neg \left(y \leq 4 \cdot 10^{+91}\right):\\
\;\;\;\;\left(a + z\right) - b\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{z}{t + x} + a \cdot \frac{t}{t + x}\\
\end{array}
\end{array}
if y < -2.40000000000000002e67 or 4.00000000000000032e91 < y Initial program 37.9%
Taylor expanded in y around inf 77.1%
if -2.40000000000000002e67 < y < 4.00000000000000032e91Initial program 76.7%
Taylor expanded in b around -inf 66.9%
associate-*r*66.9%
neg-mul-166.9%
fma-define66.9%
Simplified80.4%
Taylor expanded in y around 0 50.2%
+-commutative50.2%
associate-/l*54.5%
+-commutative54.5%
Simplified54.5%
associate-/l*66.0%
Applied egg-rr66.0%
Final simplification70.4%
(FPCore (x y z t a b) :precision binary64 (if (or (<= x -2.9e+177) (not (<= x 3.8e+45))) (* z (/ x (+ t x))) (- (+ a z) b)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((x <= -2.9e+177) || !(x <= 3.8e+45)) {
tmp = z * (x / (t + x));
} else {
tmp = (a + z) - b;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((x <= (-2.9d+177)) .or. (.not. (x <= 3.8d+45))) then
tmp = z * (x / (t + x))
else
tmp = (a + z) - b
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((x <= -2.9e+177) || !(x <= 3.8e+45)) {
tmp = z * (x / (t + x));
} else {
tmp = (a + z) - b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (x <= -2.9e+177) or not (x <= 3.8e+45): tmp = z * (x / (t + x)) else: tmp = (a + z) - b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((x <= -2.9e+177) || !(x <= 3.8e+45)) tmp = Float64(z * Float64(x / Float64(t + x))); else tmp = Float64(Float64(a + z) - b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((x <= -2.9e+177) || ~((x <= 3.8e+45))) tmp = z * (x / (t + x)); else tmp = (a + z) - b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[x, -2.9e+177], N[Not[LessEqual[x, 3.8e+45]], $MachinePrecision]], N[(z * N[(x / N[(t + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(a + z), $MachinePrecision] - b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.9 \cdot 10^{+177} \lor \neg \left(x \leq 3.8 \cdot 10^{+45}\right):\\
\;\;\;\;z \cdot \frac{x}{t + x}\\
\mathbf{else}:\\
\;\;\;\;\left(a + z\right) - b\\
\end{array}
\end{array}
if x < -2.90000000000000013e177 or 3.8000000000000002e45 < x Initial program 46.7%
Taylor expanded in z around inf 23.5%
associate-/l*57.2%
+-commutative57.2%
+-commutative57.2%
associate-+r+57.2%
Simplified57.2%
Taylor expanded in y around 0 57.2%
if -2.90000000000000013e177 < x < 3.8000000000000002e45Initial program 66.9%
Taylor expanded in y around inf 65.5%
Final simplification63.2%
(FPCore (x y z t a b) :precision binary64 (if (or (<= t -1.9e+83) (not (<= t 3.1e+84))) (* a (/ t (+ t x))) (- (+ a z) b)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -1.9e+83) || !(t <= 3.1e+84)) {
tmp = a * (t / (t + x));
} else {
tmp = (a + z) - 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.9d+83)) .or. (.not. (t <= 3.1d+84))) then
tmp = a * (t / (t + x))
else
tmp = (a + z) - 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.9e+83) || !(t <= 3.1e+84)) {
tmp = a * (t / (t + x));
} else {
tmp = (a + z) - b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (t <= -1.9e+83) or not (t <= 3.1e+84): tmp = a * (t / (t + x)) else: tmp = (a + z) - b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((t <= -1.9e+83) || !(t <= 3.1e+84)) tmp = Float64(a * Float64(t / Float64(t + x))); else tmp = Float64(Float64(a + z) - b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((t <= -1.9e+83) || ~((t <= 3.1e+84))) tmp = a * (t / (t + x)); else tmp = (a + z) - b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[t, -1.9e+83], N[Not[LessEqual[t, 3.1e+84]], $MachinePrecision]], N[(a * N[(t / N[(t + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(a + z), $MachinePrecision] - b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.9 \cdot 10^{+83} \lor \neg \left(t \leq 3.1 \cdot 10^{+84}\right):\\
\;\;\;\;a \cdot \frac{t}{t + x}\\
\mathbf{else}:\\
\;\;\;\;\left(a + z\right) - b\\
\end{array}
\end{array}
if t < -1.9000000000000001e83 or 3.10000000000000003e84 < t Initial program 55.3%
Taylor expanded in z around 0 42.6%
+-commutative42.6%
*-commutative42.6%
Simplified42.6%
Taylor expanded in y around 0 35.5%
associate-/l*56.0%
Simplified56.0%
if -1.9000000000000001e83 < t < 3.10000000000000003e84Initial program 65.0%
Taylor expanded in y around inf 67.4%
Final simplification63.1%
(FPCore (x y z t a b) :precision binary64 (if (<= t -6e+83) (* a (/ (+ y t) (+ (+ y t) x))) (if (<= t 2.8e+84) (- (+ a z) b) (* a (/ t (+ t x))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -6e+83) {
tmp = a * ((y + t) / ((y + t) + x));
} else if (t <= 2.8e+84) {
tmp = (a + z) - b;
} else {
tmp = a * (t / (t + x));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (t <= (-6d+83)) then
tmp = a * ((y + t) / ((y + t) + x))
else if (t <= 2.8d+84) then
tmp = (a + z) - b
else
tmp = a * (t / (t + x))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -6e+83) {
tmp = a * ((y + t) / ((y + t) + x));
} else if (t <= 2.8e+84) {
tmp = (a + z) - b;
} else {
tmp = a * (t / (t + x));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if t <= -6e+83: tmp = a * ((y + t) / ((y + t) + x)) elif t <= 2.8e+84: tmp = (a + z) - b else: tmp = a * (t / (t + x)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (t <= -6e+83) tmp = Float64(a * Float64(Float64(y + t) / Float64(Float64(y + t) + x))); elseif (t <= 2.8e+84) tmp = Float64(Float64(a + z) - b); else tmp = Float64(a * Float64(t / Float64(t + x))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (t <= -6e+83) tmp = a * ((y + t) / ((y + t) + x)); elseif (t <= 2.8e+84) tmp = (a + z) - b; else tmp = a * (t / (t + x)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -6e+83], N[(a * N[(N[(y + t), $MachinePrecision] / N[(N[(y + t), $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.8e+84], N[(N[(a + z), $MachinePrecision] - b), $MachinePrecision], N[(a * N[(t / N[(t + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -6 \cdot 10^{+83}:\\
\;\;\;\;a \cdot \frac{y + t}{\left(y + t\right) + x}\\
\mathbf{elif}\;t \leq 2.8 \cdot 10^{+84}:\\
\;\;\;\;\left(a + z\right) - b\\
\mathbf{else}:\\
\;\;\;\;a \cdot \frac{t}{t + x}\\
\end{array}
\end{array}
if t < -5.9999999999999999e83Initial program 56.7%
Taylor expanded in a around inf 39.7%
associate-/l*62.9%
+-commutative62.9%
+-commutative62.9%
associate-+r+62.9%
Simplified62.9%
if -5.9999999999999999e83 < t < 2.79999999999999982e84Initial program 65.0%
Taylor expanded in y around inf 67.4%
if 2.79999999999999982e84 < t Initial program 53.6%
Taylor expanded in z around 0 38.3%
+-commutative38.3%
*-commutative38.3%
Simplified38.3%
Taylor expanded in y around 0 30.3%
associate-/l*49.9%
Simplified49.9%
Final simplification63.5%
(FPCore (x y z t a b) :precision binary64 (if (<= t -1.16e+83) a (if (<= t 7.2e+97) (- (+ a z) b) a)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -1.16e+83) {
tmp = a;
} else if (t <= 7.2e+97) {
tmp = (a + z) - 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.16d+83)) then
tmp = a
else if (t <= 7.2d+97) then
tmp = (a + z) - 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.16e+83) {
tmp = a;
} else if (t <= 7.2e+97) {
tmp = (a + z) - b;
} else {
tmp = a;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if t <= -1.16e+83: tmp = a elif t <= 7.2e+97: tmp = (a + z) - b else: tmp = a return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (t <= -1.16e+83) tmp = a; elseif (t <= 7.2e+97) tmp = Float64(Float64(a + z) - b); else tmp = a; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (t <= -1.16e+83) tmp = a; elseif (t <= 7.2e+97) tmp = (a + z) - b; else tmp = a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -1.16e+83], a, If[LessEqual[t, 7.2e+97], N[(N[(a + z), $MachinePrecision] - b), $MachinePrecision], a]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.16 \cdot 10^{+83}:\\
\;\;\;\;a\\
\mathbf{elif}\;t \leq 7.2 \cdot 10^{+97}:\\
\;\;\;\;\left(a + z\right) - b\\
\mathbf{else}:\\
\;\;\;\;a\\
\end{array}
\end{array}
if t < -1.1600000000000001e83 or 7.19999999999999932e97 < t Initial program 55.9%
Taylor expanded in t around inf 51.6%
if -1.1600000000000001e83 < t < 7.19999999999999932e97Initial program 64.5%
Taylor expanded in y around inf 66.8%
(FPCore (x y z t a b) :precision binary64 (if (<= z -165000.0) z (if (<= z 1.6e+85) (- a b) z)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -165000.0) {
tmp = z;
} else if (z <= 1.6e+85) {
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 <= (-165000.0d0)) then
tmp = z
else if (z <= 1.6d+85) 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 <= -165000.0) {
tmp = z;
} else if (z <= 1.6e+85) {
tmp = a - b;
} else {
tmp = z;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= -165000.0: tmp = z elif z <= 1.6e+85: tmp = a - b else: tmp = z return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -165000.0) tmp = z; elseif (z <= 1.6e+85) 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 <= -165000.0) tmp = z; elseif (z <= 1.6e+85) tmp = a - b; else tmp = z; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -165000.0], z, If[LessEqual[z, 1.6e+85], N[(a - b), $MachinePrecision], z]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -165000:\\
\;\;\;\;z\\
\mathbf{elif}\;z \leq 1.6 \cdot 10^{+85}:\\
\;\;\;\;a - b\\
\mathbf{else}:\\
\;\;\;\;z\\
\end{array}
\end{array}
if z < -165000 or 1.60000000000000009e85 < z Initial program 48.3%
Taylor expanded in x around inf 56.2%
if -165000 < z < 1.60000000000000009e85Initial program 70.5%
Taylor expanded in z around 0 57.9%
+-commutative57.9%
*-commutative57.9%
Simplified57.9%
Taylor expanded in y around inf 50.7%
(FPCore (x y z t a b) :precision binary64 (if (<= z -1780000.0) z (if (<= z 3.3e-37) a z)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -1780000.0) {
tmp = z;
} else if (z <= 3.3e-37) {
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 (z <= (-1780000.0d0)) then
tmp = z
else if (z <= 3.3d-37) 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 (z <= -1780000.0) {
tmp = z;
} else if (z <= 3.3e-37) {
tmp = a;
} else {
tmp = z;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= -1780000.0: tmp = z elif z <= 3.3e-37: tmp = a else: tmp = z return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -1780000.0) tmp = z; elseif (z <= 3.3e-37) tmp = a; else tmp = z; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (z <= -1780000.0) tmp = z; elseif (z <= 3.3e-37) tmp = a; else tmp = z; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -1780000.0], z, If[LessEqual[z, 3.3e-37], a, z]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1780000:\\
\;\;\;\;z\\
\mathbf{elif}\;z \leq 3.3 \cdot 10^{-37}:\\
\;\;\;\;a\\
\mathbf{else}:\\
\;\;\;\;z\\
\end{array}
\end{array}
if z < -1.78e6 or 3.29999999999999982e-37 < z Initial program 52.5%
Taylor expanded in x around inf 52.3%
if -1.78e6 < z < 3.29999999999999982e-37Initial program 70.3%
Taylor expanded in t around inf 50.7%
(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 61.4%
Taylor expanded in t around inf 36.2%
(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 2024148
(FPCore (x y z t a b)
:name "AI.Clustering.Hierarchical.Internal:ward from clustering-0.2.1"
:precision binary64
:alt
(! :herbie-platform default (if (< (/ (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)) (+ (+ x t) y)) -3581311708415056400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (- (+ z a) b) (if (< (/ (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)) (+ (+ x t) y)) 12285964308315609000000000000000000000000000000000000000000000000000000000000000000) (/ 1 (/ (+ (+ 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)))