
(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 12 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b) :precision binary64 (/ (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)) (+ (+ x t) y)))
double code(double x, double y, double z, double t, double a, double b) {
return ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y);
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y);
}
def code(x, y, z, t, a, b): return ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y)
function code(x, y, z, t, a, b) return Float64(Float64(Float64(Float64(Float64(x + y) * z) + Float64(Float64(t + y) * a)) - Float64(y * b)) / Float64(Float64(x + t) + y)) end
function tmp = code(x, y, z, t, a, b) tmp = ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(N[(N[(x + y), $MachinePrecision] * z), $MachinePrecision] + N[(N[(t + y), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / N[(N[(x + t), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b}{\left(x + t\right) + y}
\end{array}
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* z (+ x y)))
(t_2 (+ y (+ x t)))
(t_3 (/ (- (+ (* (+ y t) a) t_1) (* y b)) t_2))
(t_4 (* a (+ (/ y t_2) (/ t t_2)))))
(if (<= t_3 (- INFINITY))
(+
t_4
(/
1.0
(-
(/ -1.0 (- b z))
(/
(+ (/ t (- b z)) (+ (/ x (- b z)) (/ (* x z) (pow (- b z) 2.0))))
y))))
(if (<= t_3 5e+275) (+ t_4 (/ (- t_1 (* y b)) t_2)) (+ z t_4)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = z * (x + y);
double t_2 = y + (x + t);
double t_3 = ((((y + t) * a) + t_1) - (y * b)) / t_2;
double t_4 = a * ((y / t_2) + (t / t_2));
double tmp;
if (t_3 <= -((double) INFINITY)) {
tmp = t_4 + (1.0 / ((-1.0 / (b - z)) - (((t / (b - z)) + ((x / (b - z)) + ((x * z) / pow((b - z), 2.0)))) / y)));
} else if (t_3 <= 5e+275) {
tmp = t_4 + ((t_1 - (y * b)) / t_2);
} else {
tmp = z + t_4;
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = z * (x + y);
double t_2 = y + (x + t);
double t_3 = ((((y + t) * a) + t_1) - (y * b)) / t_2;
double t_4 = a * ((y / t_2) + (t / t_2));
double tmp;
if (t_3 <= -Double.POSITIVE_INFINITY) {
tmp = t_4 + (1.0 / ((-1.0 / (b - z)) - (((t / (b - z)) + ((x / (b - z)) + ((x * z) / Math.pow((b - z), 2.0)))) / y)));
} else if (t_3 <= 5e+275) {
tmp = t_4 + ((t_1 - (y * b)) / t_2);
} else {
tmp = z + t_4;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = z * (x + y) t_2 = y + (x + t) t_3 = ((((y + t) * a) + t_1) - (y * b)) / t_2 t_4 = a * ((y / t_2) + (t / t_2)) tmp = 0 if t_3 <= -math.inf: tmp = t_4 + (1.0 / ((-1.0 / (b - z)) - (((t / (b - z)) + ((x / (b - z)) + ((x * z) / math.pow((b - z), 2.0)))) / y))) elif t_3 <= 5e+275: tmp = t_4 + ((t_1 - (y * b)) / t_2) else: tmp = z + t_4 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(z * Float64(x + y)) t_2 = Float64(y + Float64(x + t)) t_3 = Float64(Float64(Float64(Float64(Float64(y + t) * a) + t_1) - Float64(y * b)) / t_2) t_4 = Float64(a * Float64(Float64(y / t_2) + Float64(t / t_2))) tmp = 0.0 if (t_3 <= Float64(-Inf)) tmp = Float64(t_4 + Float64(1.0 / Float64(Float64(-1.0 / Float64(b - z)) - Float64(Float64(Float64(t / Float64(b - z)) + Float64(Float64(x / Float64(b - z)) + Float64(Float64(x * z) / (Float64(b - z) ^ 2.0)))) / y)))); elseif (t_3 <= 5e+275) tmp = Float64(t_4 + Float64(Float64(t_1 - Float64(y * b)) / t_2)); else tmp = Float64(z + t_4); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = z * (x + y); t_2 = y + (x + t); t_3 = ((((y + t) * a) + t_1) - (y * b)) / t_2; t_4 = a * ((y / t_2) + (t / t_2)); tmp = 0.0; if (t_3 <= -Inf) tmp = t_4 + (1.0 / ((-1.0 / (b - z)) - (((t / (b - z)) + ((x / (b - z)) + ((x * z) / ((b - z) ^ 2.0)))) / y))); elseif (t_3 <= 5e+275) tmp = t_4 + ((t_1 - (y * b)) / t_2); else tmp = z + t_4; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(z * N[(x + y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(N[(N[(y + t), $MachinePrecision] * a), $MachinePrecision] + t$95$1), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / t$95$2), $MachinePrecision]}, Block[{t$95$4 = N[(a * N[(N[(y / t$95$2), $MachinePrecision] + N[(t / t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$3, (-Infinity)], N[(t$95$4 + N[(1.0 / N[(N[(-1.0 / N[(b - z), $MachinePrecision]), $MachinePrecision] - N[(N[(N[(t / N[(b - z), $MachinePrecision]), $MachinePrecision] + N[(N[(x / N[(b - z), $MachinePrecision]), $MachinePrecision] + N[(N[(x * z), $MachinePrecision] / N[Power[N[(b - z), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$3, 5e+275], N[(t$95$4 + N[(N[(t$95$1 - N[(y * b), $MachinePrecision]), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision], N[(z + t$95$4), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \left(x + y\right)\\
t_2 := y + \left(x + t\right)\\
t_3 := \frac{\left(\left(y + t\right) \cdot a + t_1\right) - y \cdot b}{t_2}\\
t_4 := a \cdot \left(\frac{y}{t_2} + \frac{t}{t_2}\right)\\
\mathbf{if}\;t_3 \leq -\infty:\\
\;\;\;\;t_4 + \frac{1}{\frac{-1}{b - z} - \frac{\frac{t}{b - z} + \left(\frac{x}{b - z} + \frac{x \cdot z}{{\left(b - z\right)}^{2}}\right)}{y}}\\
\mathbf{elif}\;t_3 \leq 5 \cdot 10^{+275}:\\
\;\;\;\;t_4 + \frac{t_1 - y \cdot b}{t_2}\\
\mathbf{else}:\\
\;\;\;\;z + t_4\\
\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.8%
Taylor expanded in a around 0 32.4%
associate--l+32.4%
+-commutative32.4%
associate-+r+32.4%
associate-+r+32.4%
div-sub32.4%
+-commutative32.4%
*-commutative32.4%
associate-+r+32.4%
Simplified32.4%
clear-num32.4%
inv-pow32.4%
+-commutative32.4%
+-commutative32.4%
cancel-sign-sub-inv32.4%
fma-def32.4%
Applied egg-rr32.4%
unpow-132.4%
+-commutative32.4%
+-commutative32.4%
distribute-lft-neg-in32.4%
fma-neg32.4%
*-commutative32.4%
+-commutative32.4%
*-commutative32.4%
Simplified32.4%
Taylor expanded in y around -inf 70.6%
Simplified70.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)) < 5.0000000000000003e275Initial program 99.7%
Taylor expanded in a around 0 99.7%
associate--l+99.7%
+-commutative99.7%
associate-+r+99.7%
associate-+r+99.7%
div-sub99.7%
+-commutative99.7%
*-commutative99.7%
associate-+r+99.7%
Simplified99.7%
if 5.0000000000000003e275 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 3.8%
Taylor expanded in a around 0 30.8%
associate--l+30.8%
+-commutative30.8%
associate-+r+30.8%
associate-+r+30.8%
div-sub30.8%
+-commutative30.8%
*-commutative30.8%
associate-+r+30.8%
Simplified30.8%
Taylor expanded in x around inf 72.9%
Final simplification87.5%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* z (+ x y)))
(t_2 (+ y (+ x t)))
(t_3 (/ (- (+ (* (+ y t) a) t_1) (* y b)) t_2))
(t_4 (* a (+ (/ y t_2) (/ t t_2)))))
(if (or (<= t_3 (- INFINITY)) (not (<= t_3 5e+275)))
(+ z t_4)
(+ t_4 (/ (- t_1 (* y b)) t_2)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = z * (x + y);
double t_2 = y + (x + t);
double t_3 = ((((y + t) * a) + t_1) - (y * b)) / t_2;
double t_4 = a * ((y / t_2) + (t / t_2));
double tmp;
if ((t_3 <= -((double) INFINITY)) || !(t_3 <= 5e+275)) {
tmp = z + t_4;
} else {
tmp = t_4 + ((t_1 - (y * b)) / t_2);
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = z * (x + y);
double t_2 = y + (x + t);
double t_3 = ((((y + t) * a) + t_1) - (y * b)) / t_2;
double t_4 = a * ((y / t_2) + (t / t_2));
double tmp;
if ((t_3 <= -Double.POSITIVE_INFINITY) || !(t_3 <= 5e+275)) {
tmp = z + t_4;
} else {
tmp = t_4 + ((t_1 - (y * b)) / t_2);
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = z * (x + y) t_2 = y + (x + t) t_3 = ((((y + t) * a) + t_1) - (y * b)) / t_2 t_4 = a * ((y / t_2) + (t / t_2)) tmp = 0 if (t_3 <= -math.inf) or not (t_3 <= 5e+275): tmp = z + t_4 else: tmp = t_4 + ((t_1 - (y * b)) / t_2) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(z * Float64(x + y)) t_2 = Float64(y + Float64(x + t)) t_3 = Float64(Float64(Float64(Float64(Float64(y + t) * a) + t_1) - Float64(y * b)) / t_2) t_4 = Float64(a * Float64(Float64(y / t_2) + Float64(t / t_2))) tmp = 0.0 if ((t_3 <= Float64(-Inf)) || !(t_3 <= 5e+275)) tmp = Float64(z + t_4); else tmp = Float64(t_4 + Float64(Float64(t_1 - Float64(y * b)) / t_2)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = z * (x + y); t_2 = y + (x + t); t_3 = ((((y + t) * a) + t_1) - (y * b)) / t_2; t_4 = a * ((y / t_2) + (t / t_2)); tmp = 0.0; if ((t_3 <= -Inf) || ~((t_3 <= 5e+275))) tmp = z + t_4; else tmp = t_4 + ((t_1 - (y * b)) / t_2); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(z * N[(x + y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(N[(N[(y + t), $MachinePrecision] * a), $MachinePrecision] + t$95$1), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / t$95$2), $MachinePrecision]}, Block[{t$95$4 = N[(a * N[(N[(y / t$95$2), $MachinePrecision] + N[(t / t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$3, (-Infinity)], N[Not[LessEqual[t$95$3, 5e+275]], $MachinePrecision]], N[(z + t$95$4), $MachinePrecision], N[(t$95$4 + N[(N[(t$95$1 - N[(y * b), $MachinePrecision]), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \left(x + y\right)\\
t_2 := y + \left(x + t\right)\\
t_3 := \frac{\left(\left(y + t\right) \cdot a + t_1\right) - y \cdot b}{t_2}\\
t_4 := a \cdot \left(\frac{y}{t_2} + \frac{t}{t_2}\right)\\
\mathbf{if}\;t_3 \leq -\infty \lor \neg \left(t_3 \leq 5 \cdot 10^{+275}\right):\\
\;\;\;\;z + t_4\\
\mathbf{else}:\\
\;\;\;\;t_4 + \frac{t_1 - y \cdot b}{t_2}\\
\end{array}
\end{array}
if (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < -inf.0 or 5.0000000000000003e275 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 5.2%
Taylor expanded in a around 0 31.5%
associate--l+31.5%
+-commutative31.5%
associate-+r+31.5%
associate-+r+31.5%
div-sub31.5%
+-commutative31.5%
*-commutative31.5%
associate-+r+31.5%
Simplified31.5%
Taylor expanded in x around inf 71.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)) < 5.0000000000000003e275Initial program 99.7%
Taylor expanded in a around 0 99.7%
associate--l+99.7%
+-commutative99.7%
associate-+r+99.7%
associate-+r+99.7%
div-sub99.7%
+-commutative99.7%
*-commutative99.7%
associate-+r+99.7%
Simplified99.7%
Final simplification87.5%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ y (+ x t)))
(t_2 (/ (- (+ (* (+ y t) a) (* z (+ x y))) (* y b)) t_1)))
(if (or (<= t_2 (- INFINITY)) (not (<= t_2 5e+275)))
(+ z (* a (+ (/ y t_1) (/ t 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 = ((((y + t) * a) + (z * (x + y))) - (y * b)) / t_1;
double tmp;
if ((t_2 <= -((double) INFINITY)) || !(t_2 <= 5e+275)) {
tmp = z + (a * ((y / t_1) + (t / t_1)));
} else {
tmp = t_2;
}
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 = ((((y + t) * a) + (z * (x + y))) - (y * b)) / t_1;
double tmp;
if ((t_2 <= -Double.POSITIVE_INFINITY) || !(t_2 <= 5e+275)) {
tmp = z + (a * ((y / t_1) + (t / t_1)));
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = y + (x + t) t_2 = ((((y + t) * a) + (z * (x + y))) - (y * b)) / t_1 tmp = 0 if (t_2 <= -math.inf) or not (t_2 <= 5e+275): tmp = z + (a * ((y / t_1) + (t / 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(Float64(y + t) * a) + Float64(z * Float64(x + y))) - Float64(y * b)) / t_1) tmp = 0.0 if ((t_2 <= Float64(-Inf)) || !(t_2 <= 5e+275)) tmp = Float64(z + Float64(a * Float64(Float64(y / t_1) + Float64(t / t_1)))); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = y + (x + t); t_2 = ((((y + t) * a) + (z * (x + y))) - (y * b)) / t_1; tmp = 0.0; if ((t_2 <= -Inf) || ~((t_2 <= 5e+275))) tmp = z + (a * ((y / t_1) + (t / t_1))); else tmp = t_2; 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[(N[(y + t), $MachinePrecision] * a), $MachinePrecision] + N[(z * N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]}, If[Or[LessEqual[t$95$2, (-Infinity)], N[Not[LessEqual[t$95$2, 5e+275]], $MachinePrecision]], N[(z + N[(a * N[(N[(y / t$95$1), $MachinePrecision] + N[(t / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y + \left(x + t\right)\\
t_2 := \frac{\left(\left(y + t\right) \cdot a + z \cdot \left(x + y\right)\right) - y \cdot b}{t_1}\\
\mathbf{if}\;t_2 \leq -\infty \lor \neg \left(t_2 \leq 5 \cdot 10^{+275}\right):\\
\;\;\;\;z + a \cdot \left(\frac{y}{t_1} + \frac{t}{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 5.0000000000000003e275 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 5.2%
Taylor expanded in a around 0 31.5%
associate--l+31.5%
+-commutative31.5%
associate-+r+31.5%
associate-+r+31.5%
div-sub31.5%
+-commutative31.5%
*-commutative31.5%
associate-+r+31.5%
Simplified31.5%
Taylor expanded in x around inf 71.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)) < 5.0000000000000003e275Initial program 99.7%
Final simplification87.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ a (/ 1.0 (/ (+ y (+ x t)) (- (* z (+ x y)) (* y b))))))
(t_2 (+ z (* a (/ t (+ x t))))))
(if (<= x -1.95e+28)
t_2
(if (<= x -3.5e-22)
t_1
(if (<= x -2.95e-69) (- (+ z a) b) (if (<= x 1.45e+133) t_1 t_2))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = a + (1.0 / ((y + (x + t)) / ((z * (x + y)) - (y * b))));
double t_2 = z + (a * (t / (x + t)));
double tmp;
if (x <= -1.95e+28) {
tmp = t_2;
} else if (x <= -3.5e-22) {
tmp = t_1;
} else if (x <= -2.95e-69) {
tmp = (z + a) - b;
} else if (x <= 1.45e+133) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = a + (1.0d0 / ((y + (x + t)) / ((z * (x + y)) - (y * b))))
t_2 = z + (a * (t / (x + t)))
if (x <= (-1.95d+28)) then
tmp = t_2
else if (x <= (-3.5d-22)) then
tmp = t_1
else if (x <= (-2.95d-69)) then
tmp = (z + a) - b
else if (x <= 1.45d+133) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = a + (1.0 / ((y + (x + t)) / ((z * (x + y)) - (y * b))));
double t_2 = z + (a * (t / (x + t)));
double tmp;
if (x <= -1.95e+28) {
tmp = t_2;
} else if (x <= -3.5e-22) {
tmp = t_1;
} else if (x <= -2.95e-69) {
tmp = (z + a) - b;
} else if (x <= 1.45e+133) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = a + (1.0 / ((y + (x + t)) / ((z * (x + y)) - (y * b)))) t_2 = z + (a * (t / (x + t))) tmp = 0 if x <= -1.95e+28: tmp = t_2 elif x <= -3.5e-22: tmp = t_1 elif x <= -2.95e-69: tmp = (z + a) - b elif x <= 1.45e+133: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(a + Float64(1.0 / Float64(Float64(y + Float64(x + t)) / Float64(Float64(z * Float64(x + y)) - Float64(y * b))))) t_2 = Float64(z + Float64(a * Float64(t / Float64(x + t)))) tmp = 0.0 if (x <= -1.95e+28) tmp = t_2; elseif (x <= -3.5e-22) tmp = t_1; elseif (x <= -2.95e-69) tmp = Float64(Float64(z + a) - b); elseif (x <= 1.45e+133) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = a + (1.0 / ((y + (x + t)) / ((z * (x + y)) - (y * b)))); t_2 = z + (a * (t / (x + t))); tmp = 0.0; if (x <= -1.95e+28) tmp = t_2; elseif (x <= -3.5e-22) tmp = t_1; elseif (x <= -2.95e-69) tmp = (z + a) - b; elseif (x <= 1.45e+133) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(a + N[(1.0 / N[(N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision] / N[(N[(z * N[(x + y), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(z + N[(a * N[(t / N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.95e+28], t$95$2, If[LessEqual[x, -3.5e-22], t$95$1, If[LessEqual[x, -2.95e-69], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision], If[LessEqual[x, 1.45e+133], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a + \frac{1}{\frac{y + \left(x + t\right)}{z \cdot \left(x + y\right) - y \cdot b}}\\
t_2 := z + a \cdot \frac{t}{x + t}\\
\mathbf{if}\;x \leq -1.95 \cdot 10^{+28}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq -3.5 \cdot 10^{-22}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -2.95 \cdot 10^{-69}:\\
\;\;\;\;\left(z + a\right) - b\\
\mathbf{elif}\;x \leq 1.45 \cdot 10^{+133}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if x < -1.9499999999999999e28 or 1.4500000000000001e133 < x Initial program 48.7%
Taylor expanded in a around 0 56.8%
associate--l+56.8%
+-commutative56.8%
associate-+r+56.8%
associate-+r+56.8%
div-sub56.9%
+-commutative56.9%
*-commutative56.9%
associate-+r+56.9%
Simplified56.9%
Taylor expanded in x around inf 83.2%
Taylor expanded in y around 0 71.4%
if -1.9499999999999999e28 < x < -3.50000000000000005e-22 or -2.95000000000000012e-69 < x < 1.4500000000000001e133Initial program 66.1%
Taylor expanded in a around 0 80.2%
associate--l+80.2%
+-commutative80.2%
associate-+r+80.2%
associate-+r+80.2%
div-sub80.2%
+-commutative80.2%
*-commutative80.2%
associate-+r+80.2%
Simplified80.2%
clear-num80.2%
inv-pow80.2%
+-commutative80.2%
+-commutative80.2%
cancel-sign-sub-inv80.2%
fma-def80.3%
Applied egg-rr80.3%
unpow-180.3%
+-commutative80.3%
+-commutative80.3%
distribute-lft-neg-in80.3%
fma-neg80.2%
*-commutative80.2%
+-commutative80.2%
*-commutative80.2%
Simplified80.2%
Taylor expanded in y around inf 75.2%
if -3.50000000000000005e-22 < x < -2.95000000000000012e-69Initial program 19.3%
Taylor expanded in y around inf 88.5%
Final simplification74.2%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ y (+ x t)))
(t_2 (+ a (/ 1.0 (/ t_1 (- (* z (+ x y)) (* y b))))))
(t_3 (+ z (* a (+ (/ y t_1) (/ t t_1))))))
(if (<= x -6.5e+24)
t_3
(if (<= x -4.6e-29)
t_2
(if (<= x -1.48e-95) (- (+ z a) b) (if (<= x 2.1e+46) t_2 t_3))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = y + (x + t);
double t_2 = a + (1.0 / (t_1 / ((z * (x + y)) - (y * b))));
double t_3 = z + (a * ((y / t_1) + (t / t_1)));
double tmp;
if (x <= -6.5e+24) {
tmp = t_3;
} else if (x <= -4.6e-29) {
tmp = t_2;
} else if (x <= -1.48e-95) {
tmp = (z + a) - b;
} else if (x <= 2.1e+46) {
tmp = t_2;
} else {
tmp = t_3;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = y + (x + t)
t_2 = a + (1.0d0 / (t_1 / ((z * (x + y)) - (y * b))))
t_3 = z + (a * ((y / t_1) + (t / t_1)))
if (x <= (-6.5d+24)) then
tmp = t_3
else if (x <= (-4.6d-29)) then
tmp = t_2
else if (x <= (-1.48d-95)) then
tmp = (z + a) - b
else if (x <= 2.1d+46) then
tmp = t_2
else
tmp = t_3
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = y + (x + t);
double t_2 = a + (1.0 / (t_1 / ((z * (x + y)) - (y * b))));
double t_3 = z + (a * ((y / t_1) + (t / t_1)));
double tmp;
if (x <= -6.5e+24) {
tmp = t_3;
} else if (x <= -4.6e-29) {
tmp = t_2;
} else if (x <= -1.48e-95) {
tmp = (z + a) - b;
} else if (x <= 2.1e+46) {
tmp = t_2;
} else {
tmp = t_3;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = y + (x + t) t_2 = a + (1.0 / (t_1 / ((z * (x + y)) - (y * b)))) t_3 = z + (a * ((y / t_1) + (t / t_1))) tmp = 0 if x <= -6.5e+24: tmp = t_3 elif x <= -4.6e-29: tmp = t_2 elif x <= -1.48e-95: tmp = (z + a) - b elif x <= 2.1e+46: tmp = t_2 else: tmp = t_3 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(y + Float64(x + t)) t_2 = Float64(a + Float64(1.0 / Float64(t_1 / Float64(Float64(z * Float64(x + y)) - Float64(y * b))))) t_3 = Float64(z + Float64(a * Float64(Float64(y / t_1) + Float64(t / t_1)))) tmp = 0.0 if (x <= -6.5e+24) tmp = t_3; elseif (x <= -4.6e-29) tmp = t_2; elseif (x <= -1.48e-95) tmp = Float64(Float64(z + a) - b); elseif (x <= 2.1e+46) tmp = t_2; else tmp = t_3; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = y + (x + t); t_2 = a + (1.0 / (t_1 / ((z * (x + y)) - (y * b)))); t_3 = z + (a * ((y / t_1) + (t / t_1))); tmp = 0.0; if (x <= -6.5e+24) tmp = t_3; elseif (x <= -4.6e-29) tmp = t_2; elseif (x <= -1.48e-95) tmp = (z + a) - b; elseif (x <= 2.1e+46) tmp = t_2; else tmp = t_3; 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[(a + N[(1.0 / N[(t$95$1 / N[(N[(z * N[(x + y), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(z + N[(a * N[(N[(y / t$95$1), $MachinePrecision] + N[(t / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -6.5e+24], t$95$3, If[LessEqual[x, -4.6e-29], t$95$2, If[LessEqual[x, -1.48e-95], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision], If[LessEqual[x, 2.1e+46], t$95$2, t$95$3]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y + \left(x + t\right)\\
t_2 := a + \frac{1}{\frac{t_1}{z \cdot \left(x + y\right) - y \cdot b}}\\
t_3 := z + a \cdot \left(\frac{y}{t_1} + \frac{t}{t_1}\right)\\
\mathbf{if}\;x \leq -6.5 \cdot 10^{+24}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;x \leq -4.6 \cdot 10^{-29}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq -1.48 \cdot 10^{-95}:\\
\;\;\;\;\left(z + a\right) - b\\
\mathbf{elif}\;x \leq 2.1 \cdot 10^{+46}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;t_3\\
\end{array}
\end{array}
if x < -6.4999999999999996e24 or 2.1e46 < x Initial program 49.6%
Taylor expanded in a around 0 60.8%
associate--l+60.8%
+-commutative60.8%
associate-+r+60.8%
associate-+r+60.8%
div-sub60.8%
+-commutative60.8%
*-commutative60.8%
associate-+r+60.8%
Simplified60.8%
Taylor expanded in x around inf 81.5%
if -6.4999999999999996e24 < x < -4.59999999999999982e-29 or -1.47999999999999994e-95 < x < 2.1e46Initial program 69.8%
Taylor expanded in a around 0 81.5%
associate--l+81.5%
+-commutative81.5%
associate-+r+81.5%
associate-+r+81.5%
div-sub81.5%
+-commutative81.5%
*-commutative81.5%
associate-+r+81.5%
Simplified81.5%
clear-num81.5%
inv-pow81.5%
+-commutative81.5%
+-commutative81.5%
cancel-sign-sub-inv81.5%
fma-def81.5%
Applied egg-rr81.5%
unpow-181.5%
+-commutative81.5%
+-commutative81.5%
distribute-lft-neg-in81.5%
fma-neg81.5%
*-commutative81.5%
+-commutative81.5%
*-commutative81.5%
Simplified81.5%
Taylor expanded in y around inf 79.2%
if -4.59999999999999982e-29 < x < -1.47999999999999994e-95Initial program 25.1%
Taylor expanded in y around inf 88.0%
Final simplification80.7%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ z (* a (/ t (+ x t))))))
(if (<= x -6e+61)
t_1
(if (<= x 6.8e-221)
(- (+ z a) b)
(if (<= x 5e+132) (+ a (/ x (/ (+ x t) z))) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = z + (a * (t / (x + t)));
double tmp;
if (x <= -6e+61) {
tmp = t_1;
} else if (x <= 6.8e-221) {
tmp = (z + a) - b;
} else if (x <= 5e+132) {
tmp = a + (x / ((x + t) / z));
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = z + (a * (t / (x + t)))
if (x <= (-6d+61)) then
tmp = t_1
else if (x <= 6.8d-221) then
tmp = (z + a) - b
else if (x <= 5d+132) then
tmp = a + (x / ((x + t) / z))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = z + (a * (t / (x + t)));
double tmp;
if (x <= -6e+61) {
tmp = t_1;
} else if (x <= 6.8e-221) {
tmp = (z + a) - b;
} else if (x <= 5e+132) {
tmp = a + (x / ((x + t) / z));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = z + (a * (t / (x + t))) tmp = 0 if x <= -6e+61: tmp = t_1 elif x <= 6.8e-221: tmp = (z + a) - b elif x <= 5e+132: tmp = a + (x / ((x + t) / z)) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(z + Float64(a * Float64(t / Float64(x + t)))) tmp = 0.0 if (x <= -6e+61) tmp = t_1; elseif (x <= 6.8e-221) tmp = Float64(Float64(z + a) - b); elseif (x <= 5e+132) tmp = Float64(a + Float64(x / Float64(Float64(x + t) / z))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = z + (a * (t / (x + t))); tmp = 0.0; if (x <= -6e+61) tmp = t_1; elseif (x <= 6.8e-221) tmp = (z + a) - b; elseif (x <= 5e+132) tmp = a + (x / ((x + t) / z)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(z + N[(a * N[(t / N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -6e+61], t$95$1, If[LessEqual[x, 6.8e-221], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision], If[LessEqual[x, 5e+132], N[(a + N[(x / N[(N[(x + t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z + a \cdot \frac{t}{x + t}\\
\mathbf{if}\;x \leq -6 \cdot 10^{+61}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 6.8 \cdot 10^{-221}:\\
\;\;\;\;\left(z + a\right) - b\\
\mathbf{elif}\;x \leq 5 \cdot 10^{+132}:\\
\;\;\;\;a + \frac{x}{\frac{x + t}{z}}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if x < -6e61 or 5.0000000000000001e132 < x Initial program 49.6%
Taylor expanded in a around 0 58.2%
associate--l+58.2%
+-commutative58.2%
associate-+r+58.2%
associate-+r+58.2%
div-sub58.2%
+-commutative58.2%
*-commutative58.2%
associate-+r+58.2%
Simplified58.2%
Taylor expanded in x around inf 83.2%
Taylor expanded in y around 0 71.7%
if -6e61 < x < 6.8000000000000003e-221Initial program 60.6%
Taylor expanded in y around inf 63.7%
if 6.8000000000000003e-221 < x < 5.0000000000000001e132Initial program 66.1%
Taylor expanded in a around 0 81.7%
associate--l+81.7%
+-commutative81.7%
associate-+r+81.7%
associate-+r+81.7%
div-sub81.7%
+-commutative81.7%
*-commutative81.7%
associate-+r+81.7%
Simplified81.7%
Taylor expanded in y around 0 71.2%
associate-/l*67.2%
Simplified67.2%
Taylor expanded in y around inf 60.6%
Final simplification65.6%
(FPCore (x y z t a b)
:precision binary64
(if (<= x -1.5e+63)
(+ z (* a (/ (+ y t) x)))
(if (<= x 5e-218)
(- (+ z a) b)
(if (<= x 2.2e+133)
(+ a (/ x (/ (+ x t) z)))
(+ z (* a (/ t (+ x t))))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -1.5e+63) {
tmp = z + (a * ((y + t) / x));
} else if (x <= 5e-218) {
tmp = (z + a) - b;
} else if (x <= 2.2e+133) {
tmp = a + (x / ((x + t) / z));
} else {
tmp = z + (a * (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 (x <= (-1.5d+63)) then
tmp = z + (a * ((y + t) / x))
else if (x <= 5d-218) then
tmp = (z + a) - b
else if (x <= 2.2d+133) then
tmp = a + (x / ((x + t) / z))
else
tmp = z + (a * (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 (x <= -1.5e+63) {
tmp = z + (a * ((y + t) / x));
} else if (x <= 5e-218) {
tmp = (z + a) - b;
} else if (x <= 2.2e+133) {
tmp = a + (x / ((x + t) / z));
} else {
tmp = z + (a * (t / (x + t)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= -1.5e+63: tmp = z + (a * ((y + t) / x)) elif x <= 5e-218: tmp = (z + a) - b elif x <= 2.2e+133: tmp = a + (x / ((x + t) / z)) else: tmp = z + (a * (t / (x + t))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -1.5e+63) tmp = Float64(z + Float64(a * Float64(Float64(y + t) / x))); elseif (x <= 5e-218) tmp = Float64(Float64(z + a) - b); elseif (x <= 2.2e+133) tmp = Float64(a + Float64(x / Float64(Float64(x + t) / z))); else tmp = Float64(z + Float64(a * Float64(t / Float64(x + t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (x <= -1.5e+63) tmp = z + (a * ((y + t) / x)); elseif (x <= 5e-218) tmp = (z + a) - b; elseif (x <= 2.2e+133) tmp = a + (x / ((x + t) / z)); else tmp = z + (a * (t / (x + t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -1.5e+63], N[(z + N[(a * N[(N[(y + t), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 5e-218], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision], If[LessEqual[x, 2.2e+133], N[(a + N[(x / N[(N[(x + t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z + N[(a * N[(t / N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.5 \cdot 10^{+63}:\\
\;\;\;\;z + a \cdot \frac{y + t}{x}\\
\mathbf{elif}\;x \leq 5 \cdot 10^{-218}:\\
\;\;\;\;\left(z + a\right) - b\\
\mathbf{elif}\;x \leq 2.2 \cdot 10^{+133}:\\
\;\;\;\;a + \frac{x}{\frac{x + t}{z}}\\
\mathbf{else}:\\
\;\;\;\;z + a \cdot \frac{t}{x + t}\\
\end{array}
\end{array}
if x < -1.5e63Initial program 50.1%
Taylor expanded in a around 0 56.7%
associate--l+56.7%
+-commutative56.7%
associate-+r+56.7%
associate-+r+56.7%
div-sub56.7%
+-commutative56.7%
*-commutative56.7%
associate-+r+56.7%
Simplified56.7%
Taylor expanded in x around inf 81.8%
Taylor expanded in x around inf 69.4%
if -1.5e63 < x < 5.00000000000000041e-218Initial program 60.6%
Taylor expanded in y around inf 63.7%
if 5.00000000000000041e-218 < x < 2.2e133Initial program 66.1%
Taylor expanded in a around 0 81.7%
associate--l+81.7%
+-commutative81.7%
associate-+r+81.7%
associate-+r+81.7%
div-sub81.7%
+-commutative81.7%
*-commutative81.7%
associate-+r+81.7%
Simplified81.7%
Taylor expanded in y around 0 71.2%
associate-/l*67.2%
Simplified67.2%
Taylor expanded in y around inf 60.6%
if 2.2e133 < x Initial program 49.1%
Taylor expanded in a around 0 59.8%
associate--l+59.8%
+-commutative59.8%
associate-+r+59.8%
associate-+r+59.8%
div-sub59.8%
+-commutative59.8%
*-commutative59.8%
associate-+r+59.8%
Simplified59.8%
Taylor expanded in x around inf 84.6%
Taylor expanded in y around 0 74.1%
Final simplification65.6%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -7.5e+64) (not (<= y 0.0085))) (- (+ z a) b) (+ a (/ x (/ (+ x t) z)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -7.5e+64) || !(y <= 0.0085)) {
tmp = (z + a) - b;
} else {
tmp = a + (x / ((x + t) / 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 ((y <= (-7.5d+64)) .or. (.not. (y <= 0.0085d0))) then
tmp = (z + a) - b
else
tmp = a + (x / ((x + t) / 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 ((y <= -7.5e+64) || !(y <= 0.0085)) {
tmp = (z + a) - b;
} else {
tmp = a + (x / ((x + t) / z));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -7.5e+64) or not (y <= 0.0085): tmp = (z + a) - b else: tmp = a + (x / ((x + t) / z)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -7.5e+64) || !(y <= 0.0085)) tmp = Float64(Float64(z + a) - b); else tmp = Float64(a + Float64(x / Float64(Float64(x + t) / z))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -7.5e+64) || ~((y <= 0.0085))) tmp = (z + a) - b; else tmp = a + (x / ((x + t) / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -7.5e+64], N[Not[LessEqual[y, 0.0085]], $MachinePrecision]], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision], N[(a + N[(x / N[(N[(x + t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -7.5 \cdot 10^{+64} \lor \neg \left(y \leq 0.0085\right):\\
\;\;\;\;\left(z + a\right) - b\\
\mathbf{else}:\\
\;\;\;\;a + \frac{x}{\frac{x + t}{z}}\\
\end{array}
\end{array}
if y < -7.5000000000000005e64 or 0.0085000000000000006 < y Initial program 35.9%
Taylor expanded in y around inf 67.6%
if -7.5000000000000005e64 < y < 0.0085000000000000006Initial program 77.0%
Taylor expanded in a around 0 87.8%
associate--l+87.8%
+-commutative87.8%
associate-+r+87.8%
associate-+r+87.8%
div-sub87.8%
+-commutative87.8%
*-commutative87.8%
associate-+r+87.8%
Simplified87.8%
Taylor expanded in y around 0 70.4%
associate-/l*76.6%
Simplified76.6%
Taylor expanded in y around inf 59.1%
Final simplification62.9%
(FPCore (x y z t a b) :precision binary64 (if (<= x -1.25e+62) z (if (<= x 3.2e+130) (- (+ z a) b) z)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -1.25e+62) {
tmp = z;
} else if (x <= 3.2e+130) {
tmp = (z + a) - b;
} else {
tmp = z;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (x <= (-1.25d+62)) then
tmp = z
else if (x <= 3.2d+130) then
tmp = (z + a) - b
else
tmp = z
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -1.25e+62) {
tmp = z;
} else if (x <= 3.2e+130) {
tmp = (z + a) - b;
} else {
tmp = z;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= -1.25e+62: tmp = z elif x <= 3.2e+130: tmp = (z + a) - b else: tmp = z return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -1.25e+62) tmp = z; elseif (x <= 3.2e+130) tmp = Float64(Float64(z + a) - b); else tmp = z; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (x <= -1.25e+62) tmp = z; elseif (x <= 3.2e+130) tmp = (z + a) - b; else tmp = z; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -1.25e+62], z, If[LessEqual[x, 3.2e+130], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision], z]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.25 \cdot 10^{+62}:\\
\;\;\;\;z\\
\mathbf{elif}\;x \leq 3.2 \cdot 10^{+130}:\\
\;\;\;\;\left(z + a\right) - b\\
\mathbf{else}:\\
\;\;\;\;z\\
\end{array}
\end{array}
if x < -1.25000000000000007e62 or 3.2e130 < x Initial program 50.2%
Taylor expanded in x around inf 54.4%
if -1.25000000000000007e62 < x < 3.2e130Initial program 62.8%
Taylor expanded in y around inf 58.6%
Final simplification57.1%
(FPCore (x y z t a b) :precision binary64 (if (<= x -1.9e+35) z (if (<= x 8.6e+132) a z)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -1.9e+35) {
tmp = z;
} else if (x <= 8.6e+132) {
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.9d+35)) then
tmp = z
else if (x <= 8.6d+132) 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.9e+35) {
tmp = z;
} else if (x <= 8.6e+132) {
tmp = a;
} else {
tmp = z;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= -1.9e+35: tmp = z elif x <= 8.6e+132: tmp = a else: tmp = z return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -1.9e+35) tmp = z; elseif (x <= 8.6e+132) 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.9e+35) tmp = z; elseif (x <= 8.6e+132) tmp = a; else tmp = z; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -1.9e+35], z, If[LessEqual[x, 8.6e+132], a, z]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.9 \cdot 10^{+35}:\\
\;\;\;\;z\\
\mathbf{elif}\;x \leq 8.6 \cdot 10^{+132}:\\
\;\;\;\;a\\
\mathbf{else}:\\
\;\;\;\;z\\
\end{array}
\end{array}
if x < -1.9e35 or 8.59999999999999964e132 < x Initial program 48.7%
Taylor expanded in x around inf 55.9%
if -1.9e35 < x < 8.59999999999999964e132Initial program 63.9%
Taylor expanded in t around inf 47.1%
Final simplification50.3%
(FPCore (x y z t a b) :precision binary64 (if (<= t -2.6e+184) a (+ z a)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -2.6e+184) {
tmp = a;
} else {
tmp = z + a;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (t <= (-2.6d+184)) then
tmp = a
else
tmp = z + a
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -2.6e+184) {
tmp = a;
} else {
tmp = z + a;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if t <= -2.6e+184: tmp = a else: tmp = z + a return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (t <= -2.6e+184) tmp = a; else tmp = Float64(z + a); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (t <= -2.6e+184) tmp = a; else tmp = z + a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -2.6e+184], a, N[(z + a), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.6 \cdot 10^{+184}:\\
\;\;\;\;a\\
\mathbf{else}:\\
\;\;\;\;z + a\\
\end{array}
\end{array}
if t < -2.59999999999999993e184Initial program 29.7%
Taylor expanded in t around inf 63.1%
if -2.59999999999999993e184 < t Initial program 61.2%
Taylor expanded in y around inf 50.1%
Taylor expanded in b around 0 52.9%
+-commutative52.9%
Simplified52.9%
Final simplification53.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 58.4%
Taylor expanded in t around inf 35.0%
Final simplification35.0%
(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 2023325
(FPCore (x y z t a b)
:name "AI.Clustering.Hierarchical.Internal:ward from clustering-0.2.1"
:precision binary64
:herbie-target
(if (< (/ (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)) (+ (+ x t) y)) -3.5813117084150564e+153) (- (+ z a) b) (if (< (/ (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)) (+ (+ x t) y)) 1.2285964308315609e+82) (/ 1.0 (/ (+ (+ x t) y) (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)))) (- (+ z a) b)))
(/ (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)) (+ (+ x t) y)))