
(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 18 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b) :precision binary64 (/ (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)) (+ (+ x t) y)))
double code(double x, double y, double z, double t, double a, double b) {
return ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y);
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y);
}
def code(x, y, z, t, a, b): return ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y)
function code(x, y, z, t, a, b) return Float64(Float64(Float64(Float64(Float64(x + y) * z) + Float64(Float64(t + y) * a)) - Float64(y * b)) / Float64(Float64(x + t) + y)) end
function tmp = code(x, y, z, t, a, b) tmp = ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(N[(N[(x + y), $MachinePrecision] * z), $MachinePrecision] + N[(N[(t + y), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / N[(N[(x + t), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b}{\left(x + t\right) + y}
\end{array}
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (/ y (+ t (+ y x))) (+ a (- z b))))
(t_2 (+ y (+ t x)))
(t_3 (/ y t_2)))
(if (<= y -2.9e+94)
t_1
(if (<= y -9.5e-263)
(+ (* a (+ t_3 (/ t t_2))) (/ (- (* (+ y x) z) (* y b)) t_2))
(if (<= y 3.8e+100)
(+ (* z (+ t_3 (/ x t_2))) (/ (- (* a (+ y t)) (* y b)) t_2))
t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (y / (t + (y + x))) * (a + (z - b));
double t_2 = y + (t + x);
double t_3 = y / t_2;
double tmp;
if (y <= -2.9e+94) {
tmp = t_1;
} else if (y <= -9.5e-263) {
tmp = (a * (t_3 + (t / t_2))) + ((((y + x) * z) - (y * b)) / t_2);
} else if (y <= 3.8e+100) {
tmp = (z * (t_3 + (x / t_2))) + (((a * (y + t)) - (y * b)) / t_2);
} 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) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = (y / (t + (y + x))) * (a + (z - b))
t_2 = y + (t + x)
t_3 = y / t_2
if (y <= (-2.9d+94)) then
tmp = t_1
else if (y <= (-9.5d-263)) then
tmp = (a * (t_3 + (t / t_2))) + ((((y + x) * z) - (y * b)) / t_2)
else if (y <= 3.8d+100) then
tmp = (z * (t_3 + (x / t_2))) + (((a * (y + t)) - (y * b)) / t_2)
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 = (y / (t + (y + x))) * (a + (z - b));
double t_2 = y + (t + x);
double t_3 = y / t_2;
double tmp;
if (y <= -2.9e+94) {
tmp = t_1;
} else if (y <= -9.5e-263) {
tmp = (a * (t_3 + (t / t_2))) + ((((y + x) * z) - (y * b)) / t_2);
} else if (y <= 3.8e+100) {
tmp = (z * (t_3 + (x / t_2))) + (((a * (y + t)) - (y * b)) / t_2);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (y / (t + (y + x))) * (a + (z - b)) t_2 = y + (t + x) t_3 = y / t_2 tmp = 0 if y <= -2.9e+94: tmp = t_1 elif y <= -9.5e-263: tmp = (a * (t_3 + (t / t_2))) + ((((y + x) * z) - (y * b)) / t_2) elif y <= 3.8e+100: tmp = (z * (t_3 + (x / t_2))) + (((a * (y + t)) - (y * b)) / t_2) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(y / Float64(t + Float64(y + x))) * Float64(a + Float64(z - b))) t_2 = Float64(y + Float64(t + x)) t_3 = Float64(y / t_2) tmp = 0.0 if (y <= -2.9e+94) tmp = t_1; elseif (y <= -9.5e-263) tmp = Float64(Float64(a * Float64(t_3 + Float64(t / t_2))) + Float64(Float64(Float64(Float64(y + x) * z) - Float64(y * b)) / t_2)); elseif (y <= 3.8e+100) tmp = Float64(Float64(z * Float64(t_3 + Float64(x / t_2))) + Float64(Float64(Float64(a * Float64(y + t)) - Float64(y * b)) / t_2)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (y / (t + (y + x))) * (a + (z - b)); t_2 = y + (t + x); t_3 = y / t_2; tmp = 0.0; if (y <= -2.9e+94) tmp = t_1; elseif (y <= -9.5e-263) tmp = (a * (t_3 + (t / t_2))) + ((((y + x) * z) - (y * b)) / t_2); elseif (y <= 3.8e+100) tmp = (z * (t_3 + (x / t_2))) + (((a * (y + t)) - (y * b)) / t_2); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(y / N[(t + N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(a + N[(z - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(y + N[(t + x), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(y / t$95$2), $MachinePrecision]}, If[LessEqual[y, -2.9e+94], t$95$1, If[LessEqual[y, -9.5e-263], N[(N[(a * N[(t$95$3 + N[(t / t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(N[(y + x), $MachinePrecision] * z), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.8e+100], N[(N[(z * N[(t$95$3 + N[(x / t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(a * N[(y + t), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y}{t + \left(y + x\right)} \cdot \left(a + \left(z - b\right)\right)\\
t_2 := y + \left(t + x\right)\\
t_3 := \frac{y}{t\_2}\\
\mathbf{if}\;y \leq -2.9 \cdot 10^{+94}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -9.5 \cdot 10^{-263}:\\
\;\;\;\;a \cdot \left(t\_3 + \frac{t}{t\_2}\right) + \frac{\left(y + x\right) \cdot z - y \cdot b}{t\_2}\\
\mathbf{elif}\;y \leq 3.8 \cdot 10^{+100}:\\
\;\;\;\;z \cdot \left(t\_3 + \frac{x}{t\_2}\right) + \frac{a \cdot \left(y + t\right) - y \cdot b}{t\_2}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -2.8999999999999998e94 or 3.79999999999999963e100 < y Initial program 33.0%
Taylor expanded in y around inf 31.1%
expm1-log1p-u19.7%
expm1-udef9.1%
associate-/l*32.9%
+-commutative32.9%
associate-+l+32.9%
associate--l+32.9%
Applied egg-rr32.9%
expm1-def38.8%
expm1-log1p85.1%
associate-/r/89.9%
+-commutative89.9%
Simplified89.9%
if -2.8999999999999998e94 < y < -9.5000000000000005e-263Initial program 73.0%
Taylor expanded in a around 0 88.6%
associate--l+88.6%
+-commutative88.6%
associate-+r+88.6%
associate-+r+88.6%
div-sub88.6%
+-commutative88.6%
*-commutative88.6%
associate-+r+88.6%
Simplified88.6%
if -9.5000000000000005e-263 < y < 3.79999999999999963e100Initial program 77.5%
Taylor expanded in z around 0 91.4%
associate--l+91.4%
associate-+r+91.4%
associate-+r+91.4%
div-sub91.4%
*-commutative91.4%
associate-+r+91.4%
Simplified91.4%
Final simplification90.1%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ y (+ t x)))
(t_2 (/ y t_1))
(t_3 (* (+ y x) z))
(t_4 (/ (- (+ t_3 (* a (+ y t))) (* y b)) t_1)))
(if (or (<= t_4 (- INFINITY)) (not (<= t_4 4e+276)))
(+ (* z (+ t_2 (/ x t_1))) (/ a (/ (+ t (+ y x)) (+ y t))))
(+ (* a (+ t_2 (/ t t_1))) (/ (- t_3 (* y b)) 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 t_3 = (y + x) * z;
double t_4 = ((t_3 + (a * (y + t))) - (y * b)) / t_1;
double tmp;
if ((t_4 <= -((double) INFINITY)) || !(t_4 <= 4e+276)) {
tmp = (z * (t_2 + (x / t_1))) + (a / ((t + (y + x)) / (y + t)));
} else {
tmp = (a * (t_2 + (t / t_1))) + ((t_3 - (y * b)) / t_1);
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = y + (t + x);
double t_2 = y / t_1;
double t_3 = (y + x) * z;
double t_4 = ((t_3 + (a * (y + t))) - (y * b)) / t_1;
double tmp;
if ((t_4 <= -Double.POSITIVE_INFINITY) || !(t_4 <= 4e+276)) {
tmp = (z * (t_2 + (x / t_1))) + (a / ((t + (y + x)) / (y + t)));
} else {
tmp = (a * (t_2 + (t / t_1))) + ((t_3 - (y * b)) / t_1);
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = y + (t + x) t_2 = y / t_1 t_3 = (y + x) * z t_4 = ((t_3 + (a * (y + t))) - (y * b)) / t_1 tmp = 0 if (t_4 <= -math.inf) or not (t_4 <= 4e+276): tmp = (z * (t_2 + (x / t_1))) + (a / ((t + (y + x)) / (y + t))) else: tmp = (a * (t_2 + (t / t_1))) + ((t_3 - (y * b)) / t_1) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(y + Float64(t + x)) t_2 = Float64(y / t_1) t_3 = Float64(Float64(y + x) * z) t_4 = Float64(Float64(Float64(t_3 + Float64(a * Float64(y + t))) - Float64(y * b)) / t_1) tmp = 0.0 if ((t_4 <= Float64(-Inf)) || !(t_4 <= 4e+276)) tmp = Float64(Float64(z * Float64(t_2 + Float64(x / t_1))) + Float64(a / Float64(Float64(t + Float64(y + x)) / Float64(y + t)))); else tmp = Float64(Float64(a * Float64(t_2 + Float64(t / t_1))) + Float64(Float64(t_3 - Float64(y * b)) / t_1)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = y + (t + x); t_2 = y / t_1; t_3 = (y + x) * z; t_4 = ((t_3 + (a * (y + t))) - (y * b)) / t_1; tmp = 0.0; if ((t_4 <= -Inf) || ~((t_4 <= 4e+276))) tmp = (z * (t_2 + (x / t_1))) + (a / ((t + (y + x)) / (y + t))); else tmp = (a * (t_2 + (t / t_1))) + ((t_3 - (y * b)) / t_1); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(y + N[(t + x), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(y / t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[(N[(y + x), $MachinePrecision] * z), $MachinePrecision]}, Block[{t$95$4 = N[(N[(N[(t$95$3 + N[(a * N[(y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]}, If[Or[LessEqual[t$95$4, (-Infinity)], N[Not[LessEqual[t$95$4, 4e+276]], $MachinePrecision]], N[(N[(z * N[(t$95$2 + N[(x / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(a / N[(N[(t + N[(y + x), $MachinePrecision]), $MachinePrecision] / N[(y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(a * N[(t$95$2 + N[(t / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$3 - N[(y * b), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y + \left(t + x\right)\\
t_2 := \frac{y}{t\_1}\\
t_3 := \left(y + x\right) \cdot z\\
t_4 := \frac{\left(t\_3 + a \cdot \left(y + t\right)\right) - y \cdot b}{t\_1}\\
\mathbf{if}\;t\_4 \leq -\infty \lor \neg \left(t\_4 \leq 4 \cdot 10^{+276}\right):\\
\;\;\;\;z \cdot \left(t\_2 + \frac{x}{t\_1}\right) + \frac{a}{\frac{t + \left(y + x\right)}{y + t}}\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(t\_2 + \frac{t}{t\_1}\right) + \frac{t\_3 - y \cdot b}{t\_1}\\
\end{array}
\end{array}
if (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < -inf.0 or 4.0000000000000002e276 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 6.6%
Taylor expanded in z around 0 35.9%
associate--l+35.9%
associate-+r+35.9%
associate-+r+35.9%
div-sub35.9%
*-commutative35.9%
associate-+r+35.9%
Simplified35.9%
Taylor expanded in a around inf 36.9%
associate-/l*73.9%
+-commutative73.9%
+-commutative73.9%
Simplified73.9%
if -inf.0 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 4.0000000000000002e276Initial program 99.7%
Taylor expanded in a around 0 99.8%
associate--l+99.8%
+-commutative99.8%
associate-+r+99.8%
associate-+r+99.8%
div-sub99.8%
+-commutative99.8%
*-commutative99.8%
associate-+r+99.8%
Simplified99.8%
Final simplification88.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ y (+ t x)))
(t_2 (/ (- (+ (* (+ y x) z) (* a (+ y t))) (* y b)) t_1)))
(if (or (<= t_2 (- INFINITY)) (not (<= t_2 4e+276)))
(+ (* z (+ (/ y t_1) (/ x t_1))) (/ a (/ (+ t (+ y x)) (+ y t))))
(/ (+ (* t a) (+ (* x z) (* y (- (+ a z) b)))) 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 + x) * z) + (a * (y + t))) - (y * b)) / t_1;
double tmp;
if ((t_2 <= -((double) INFINITY)) || !(t_2 <= 4e+276)) {
tmp = (z * ((y / t_1) + (x / t_1))) + (a / ((t + (y + x)) / (y + t)));
} else {
tmp = ((t * a) + ((x * z) + (y * ((a + z) - b)))) / t_1;
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = y + (t + x);
double t_2 = ((((y + x) * z) + (a * (y + t))) - (y * b)) / t_1;
double tmp;
if ((t_2 <= -Double.POSITIVE_INFINITY) || !(t_2 <= 4e+276)) {
tmp = (z * ((y / t_1) + (x / t_1))) + (a / ((t + (y + x)) / (y + t)));
} else {
tmp = ((t * a) + ((x * z) + (y * ((a + z) - b)))) / t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = y + (t + x) t_2 = ((((y + x) * z) + (a * (y + t))) - (y * b)) / t_1 tmp = 0 if (t_2 <= -math.inf) or not (t_2 <= 4e+276): tmp = (z * ((y / t_1) + (x / t_1))) + (a / ((t + (y + x)) / (y + t))) else: tmp = ((t * a) + ((x * z) + (y * ((a + z) - b)))) / t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(y + Float64(t + x)) t_2 = Float64(Float64(Float64(Float64(Float64(y + x) * z) + Float64(a * Float64(y + t))) - Float64(y * b)) / t_1) tmp = 0.0 if ((t_2 <= Float64(-Inf)) || !(t_2 <= 4e+276)) tmp = Float64(Float64(z * Float64(Float64(y / t_1) + Float64(x / t_1))) + Float64(a / Float64(Float64(t + Float64(y + x)) / Float64(y + t)))); else tmp = Float64(Float64(Float64(t * a) + Float64(Float64(x * z) + Float64(y * Float64(Float64(a + z) - b)))) / t_1); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = y + (t + x); t_2 = ((((y + x) * z) + (a * (y + t))) - (y * b)) / t_1; tmp = 0.0; if ((t_2 <= -Inf) || ~((t_2 <= 4e+276))) tmp = (z * ((y / t_1) + (x / t_1))) + (a / ((t + (y + x)) / (y + t))); else tmp = ((t * a) + ((x * z) + (y * ((a + z) - b)))) / t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(y + N[(t + x), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(N[(N[(y + x), $MachinePrecision] * z), $MachinePrecision] + N[(a * N[(y + t), $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, 4e+276]], $MachinePrecision]], N[(N[(z * N[(N[(y / t$95$1), $MachinePrecision] + N[(x / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(a / N[(N[(t + N[(y + x), $MachinePrecision]), $MachinePrecision] / N[(y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(t * a), $MachinePrecision] + N[(N[(x * z), $MachinePrecision] + N[(y * N[(N[(a + z), $MachinePrecision] - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y + \left(t + x\right)\\
t_2 := \frac{\left(\left(y + x\right) \cdot z + a \cdot \left(y + t\right)\right) - y \cdot b}{t\_1}\\
\mathbf{if}\;t\_2 \leq -\infty \lor \neg \left(t\_2 \leq 4 \cdot 10^{+276}\right):\\
\;\;\;\;z \cdot \left(\frac{y}{t\_1} + \frac{x}{t\_1}\right) + \frac{a}{\frac{t + \left(y + x\right)}{y + t}}\\
\mathbf{else}:\\
\;\;\;\;\frac{t \cdot a + \left(x \cdot z + y \cdot \left(\left(a + z\right) - b\right)\right)}{t\_1}\\
\end{array}
\end{array}
if (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < -inf.0 or 4.0000000000000002e276 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 6.6%
Taylor expanded in z around 0 35.9%
associate--l+35.9%
associate-+r+35.9%
associate-+r+35.9%
div-sub35.9%
*-commutative35.9%
associate-+r+35.9%
Simplified35.9%
Taylor expanded in a around inf 36.9%
associate-/l*73.9%
+-commutative73.9%
+-commutative73.9%
Simplified73.9%
if -inf.0 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 4.0000000000000002e276Initial program 99.7%
Taylor expanded in y around 0 99.8%
Final simplification88.3%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ y (+ t x)))
(t_2 (/ (- (+ (* (+ y x) z) (* a (+ y t))) (* y b)) t_1))
(t_3 (- (+ a z) b)))
(if (or (<= t_2 -5e+271) (not (<= t_2 4e+276)))
t_3
(/ (+ (* t a) (+ (* x z) (* y t_3))) 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 + x) * z) + (a * (y + t))) - (y * b)) / t_1;
double t_3 = (a + z) - b;
double tmp;
if ((t_2 <= -5e+271) || !(t_2 <= 4e+276)) {
tmp = t_3;
} else {
tmp = ((t * a) + ((x * z) + (y * t_3))) / 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) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = y + (t + x)
t_2 = ((((y + x) * z) + (a * (y + t))) - (y * b)) / t_1
t_3 = (a + z) - b
if ((t_2 <= (-5d+271)) .or. (.not. (t_2 <= 4d+276))) then
tmp = t_3
else
tmp = ((t * a) + ((x * z) + (y * t_3))) / 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 = y + (t + x);
double t_2 = ((((y + x) * z) + (a * (y + t))) - (y * b)) / t_1;
double t_3 = (a + z) - b;
double tmp;
if ((t_2 <= -5e+271) || !(t_2 <= 4e+276)) {
tmp = t_3;
} else {
tmp = ((t * a) + ((x * z) + (y * t_3))) / t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = y + (t + x) t_2 = ((((y + x) * z) + (a * (y + t))) - (y * b)) / t_1 t_3 = (a + z) - b tmp = 0 if (t_2 <= -5e+271) or not (t_2 <= 4e+276): tmp = t_3 else: tmp = ((t * a) + ((x * z) + (y * t_3))) / t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(y + Float64(t + x)) t_2 = Float64(Float64(Float64(Float64(Float64(y + x) * z) + Float64(a * Float64(y + t))) - Float64(y * b)) / t_1) t_3 = Float64(Float64(a + z) - b) tmp = 0.0 if ((t_2 <= -5e+271) || !(t_2 <= 4e+276)) tmp = t_3; else tmp = Float64(Float64(Float64(t * a) + Float64(Float64(x * z) + Float64(y * t_3))) / t_1); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = y + (t + x); t_2 = ((((y + x) * z) + (a * (y + t))) - (y * b)) / t_1; t_3 = (a + z) - b; tmp = 0.0; if ((t_2 <= -5e+271) || ~((t_2 <= 4e+276))) tmp = t_3; else tmp = ((t * a) + ((x * z) + (y * t_3))) / t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(y + N[(t + x), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(N[(N[(y + x), $MachinePrecision] * z), $MachinePrecision] + N[(a * N[(y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[(N[(a + z), $MachinePrecision] - b), $MachinePrecision]}, If[Or[LessEqual[t$95$2, -5e+271], N[Not[LessEqual[t$95$2, 4e+276]], $MachinePrecision]], t$95$3, N[(N[(N[(t * a), $MachinePrecision] + N[(N[(x * z), $MachinePrecision] + N[(y * t$95$3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y + \left(t + x\right)\\
t_2 := \frac{\left(\left(y + x\right) \cdot z + a \cdot \left(y + t\right)\right) - y \cdot b}{t\_1}\\
t_3 := \left(a + z\right) - b\\
\mathbf{if}\;t\_2 \leq -5 \cdot 10^{+271} \lor \neg \left(t\_2 \leq 4 \cdot 10^{+276}\right):\\
\;\;\;\;t\_3\\
\mathbf{else}:\\
\;\;\;\;\frac{t \cdot a + \left(x \cdot z + y \cdot t\_3\right)}{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)) < -5.0000000000000003e271 or 4.0000000000000002e276 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 10.6%
Taylor expanded in y around inf 71.6%
if -5.0000000000000003e271 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 4.0000000000000002e276Initial program 99.8%
Taylor expanded in y around 0 99.8%
Final simplification86.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ z (/ (- (* a (+ y t)) (* y b)) (+ y (+ t x)))))
(t_2 (* (/ y (+ t (+ y x))) (+ a (- z b)))))
(if (<= y -6e+36)
t_2
(if (<= y -2.2e-197)
t_1
(if (<= y 8.6e-239)
(/ (+ (* t a) (* x z)) (+ t x))
(if (<= y 2.15e+27) t_1 t_2))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = z + (((a * (y + t)) - (y * b)) / (y + (t + x)));
double t_2 = (y / (t + (y + x))) * (a + (z - b));
double tmp;
if (y <= -6e+36) {
tmp = t_2;
} else if (y <= -2.2e-197) {
tmp = t_1;
} else if (y <= 8.6e-239) {
tmp = ((t * a) + (x * z)) / (t + x);
} else if (y <= 2.15e+27) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = z + (((a * (y + t)) - (y * b)) / (y + (t + x)))
t_2 = (y / (t + (y + x))) * (a + (z - b))
if (y <= (-6d+36)) then
tmp = t_2
else if (y <= (-2.2d-197)) then
tmp = t_1
else if (y <= 8.6d-239) then
tmp = ((t * a) + (x * z)) / (t + x)
else if (y <= 2.15d+27) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = z + (((a * (y + t)) - (y * b)) / (y + (t + x)));
double t_2 = (y / (t + (y + x))) * (a + (z - b));
double tmp;
if (y <= -6e+36) {
tmp = t_2;
} else if (y <= -2.2e-197) {
tmp = t_1;
} else if (y <= 8.6e-239) {
tmp = ((t * a) + (x * z)) / (t + x);
} else if (y <= 2.15e+27) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = z + (((a * (y + t)) - (y * b)) / (y + (t + x))) t_2 = (y / (t + (y + x))) * (a + (z - b)) tmp = 0 if y <= -6e+36: tmp = t_2 elif y <= -2.2e-197: tmp = t_1 elif y <= 8.6e-239: tmp = ((t * a) + (x * z)) / (t + x) elif y <= 2.15e+27: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(z + Float64(Float64(Float64(a * Float64(y + t)) - Float64(y * b)) / Float64(y + Float64(t + x)))) t_2 = Float64(Float64(y / Float64(t + Float64(y + x))) * Float64(a + Float64(z - b))) tmp = 0.0 if (y <= -6e+36) tmp = t_2; elseif (y <= -2.2e-197) tmp = t_1; elseif (y <= 8.6e-239) tmp = Float64(Float64(Float64(t * a) + Float64(x * z)) / Float64(t + x)); elseif (y <= 2.15e+27) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = z + (((a * (y + t)) - (y * b)) / (y + (t + x))); t_2 = (y / (t + (y + x))) * (a + (z - b)); tmp = 0.0; if (y <= -6e+36) tmp = t_2; elseif (y <= -2.2e-197) tmp = t_1; elseif (y <= 8.6e-239) tmp = ((t * a) + (x * z)) / (t + x); elseif (y <= 2.15e+27) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(z + N[(N[(N[(a * N[(y + t), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / N[(y + N[(t + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(y / N[(t + N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(a + N[(z - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -6e+36], t$95$2, If[LessEqual[y, -2.2e-197], t$95$1, If[LessEqual[y, 8.6e-239], N[(N[(N[(t * a), $MachinePrecision] + N[(x * z), $MachinePrecision]), $MachinePrecision] / N[(t + x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.15e+27], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z + \frac{a \cdot \left(y + t\right) - y \cdot b}{y + \left(t + x\right)}\\
t_2 := \frac{y}{t + \left(y + x\right)} \cdot \left(a + \left(z - b\right)\right)\\
\mathbf{if}\;y \leq -6 \cdot 10^{+36}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;y \leq -2.2 \cdot 10^{-197}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 8.6 \cdot 10^{-239}:\\
\;\;\;\;\frac{t \cdot a + x \cdot z}{t + x}\\
\mathbf{elif}\;y \leq 2.15 \cdot 10^{+27}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if y < -6e36 or 2.15000000000000004e27 < y Initial program 38.6%
Taylor expanded in y around inf 34.6%
expm1-log1p-u22.0%
expm1-udef11.3%
associate-/l*32.2%
+-commutative32.2%
associate-+l+32.2%
associate--l+32.2%
Applied egg-rr32.2%
expm1-def39.2%
expm1-log1p81.2%
associate-/r/85.0%
+-commutative85.0%
Simplified85.0%
if -6e36 < y < -2.2e-197 or 8.6000000000000001e-239 < y < 2.15000000000000004e27Initial program 77.0%
Taylor expanded in z around 0 89.0%
associate--l+89.0%
associate-+r+89.0%
associate-+r+89.0%
div-sub89.0%
*-commutative89.0%
associate-+r+89.0%
Simplified89.0%
Taylor expanded in x around inf 72.9%
if -2.2e-197 < y < 8.6000000000000001e-239Initial program 83.3%
Taylor expanded in y around 0 77.7%
Final simplification79.6%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (/ y (+ t (+ y x))) (+ a (- z b))))
(t_2 (* a (+ y t)))
(t_3 (+ y (+ t x)))
(t_4 (+ z (/ (- t_2 (* y b)) t_3))))
(if (<= y -2.55e+36)
t_1
(if (<= y -3.5e-182)
t_4
(if (<= y 4.6e-110)
(/ (+ (* (+ y x) z) t_2) t_3)
(if (<= y 5.4e+27) t_4 t_1))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (y / (t + (y + x))) * (a + (z - b));
double t_2 = a * (y + t);
double t_3 = y + (t + x);
double t_4 = z + ((t_2 - (y * b)) / t_3);
double tmp;
if (y <= -2.55e+36) {
tmp = t_1;
} else if (y <= -3.5e-182) {
tmp = t_4;
} else if (y <= 4.6e-110) {
tmp = (((y + x) * z) + t_2) / t_3;
} else if (y <= 5.4e+27) {
tmp = t_4;
} 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) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: tmp
t_1 = (y / (t + (y + x))) * (a + (z - b))
t_2 = a * (y + t)
t_3 = y + (t + x)
t_4 = z + ((t_2 - (y * b)) / t_3)
if (y <= (-2.55d+36)) then
tmp = t_1
else if (y <= (-3.5d-182)) then
tmp = t_4
else if (y <= 4.6d-110) then
tmp = (((y + x) * z) + t_2) / t_3
else if (y <= 5.4d+27) then
tmp = t_4
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 = (y / (t + (y + x))) * (a + (z - b));
double t_2 = a * (y + t);
double t_3 = y + (t + x);
double t_4 = z + ((t_2 - (y * b)) / t_3);
double tmp;
if (y <= -2.55e+36) {
tmp = t_1;
} else if (y <= -3.5e-182) {
tmp = t_4;
} else if (y <= 4.6e-110) {
tmp = (((y + x) * z) + t_2) / t_3;
} else if (y <= 5.4e+27) {
tmp = t_4;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (y / (t + (y + x))) * (a + (z - b)) t_2 = a * (y + t) t_3 = y + (t + x) t_4 = z + ((t_2 - (y * b)) / t_3) tmp = 0 if y <= -2.55e+36: tmp = t_1 elif y <= -3.5e-182: tmp = t_4 elif y <= 4.6e-110: tmp = (((y + x) * z) + t_2) / t_3 elif y <= 5.4e+27: tmp = t_4 else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(y / Float64(t + Float64(y + x))) * Float64(a + Float64(z - b))) t_2 = Float64(a * Float64(y + t)) t_3 = Float64(y + Float64(t + x)) t_4 = Float64(z + Float64(Float64(t_2 - Float64(y * b)) / t_3)) tmp = 0.0 if (y <= -2.55e+36) tmp = t_1; elseif (y <= -3.5e-182) tmp = t_4; elseif (y <= 4.6e-110) tmp = Float64(Float64(Float64(Float64(y + x) * z) + t_2) / t_3); elseif (y <= 5.4e+27) tmp = t_4; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (y / (t + (y + x))) * (a + (z - b)); t_2 = a * (y + t); t_3 = y + (t + x); t_4 = z + ((t_2 - (y * b)) / t_3); tmp = 0.0; if (y <= -2.55e+36) tmp = t_1; elseif (y <= -3.5e-182) tmp = t_4; elseif (y <= 4.6e-110) tmp = (((y + x) * z) + t_2) / t_3; elseif (y <= 5.4e+27) tmp = t_4; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(y / N[(t + N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(a + N[(z - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(a * N[(y + t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(y + N[(t + x), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(z + N[(N[(t$95$2 - N[(y * b), $MachinePrecision]), $MachinePrecision] / t$95$3), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -2.55e+36], t$95$1, If[LessEqual[y, -3.5e-182], t$95$4, If[LessEqual[y, 4.6e-110], N[(N[(N[(N[(y + x), $MachinePrecision] * z), $MachinePrecision] + t$95$2), $MachinePrecision] / t$95$3), $MachinePrecision], If[LessEqual[y, 5.4e+27], t$95$4, t$95$1]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y}{t + \left(y + x\right)} \cdot \left(a + \left(z - b\right)\right)\\
t_2 := a \cdot \left(y + t\right)\\
t_3 := y + \left(t + x\right)\\
t_4 := z + \frac{t\_2 - y \cdot b}{t\_3}\\
\mathbf{if}\;y \leq -2.55 \cdot 10^{+36}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -3.5 \cdot 10^{-182}:\\
\;\;\;\;t\_4\\
\mathbf{elif}\;y \leq 4.6 \cdot 10^{-110}:\\
\;\;\;\;\frac{\left(y + x\right) \cdot z + t\_2}{t\_3}\\
\mathbf{elif}\;y \leq 5.4 \cdot 10^{+27}:\\
\;\;\;\;t\_4\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -2.54999999999999986e36 or 5.3999999999999995e27 < y Initial program 38.6%
Taylor expanded in y around inf 34.6%
expm1-log1p-u22.0%
expm1-udef11.3%
associate-/l*32.2%
+-commutative32.2%
associate-+l+32.2%
associate--l+32.2%
Applied egg-rr32.2%
expm1-def39.2%
expm1-log1p81.2%
associate-/r/85.0%
+-commutative85.0%
Simplified85.0%
if -2.54999999999999986e36 < y < -3.49999999999999983e-182 or 4.6000000000000003e-110 < y < 5.3999999999999995e27Initial program 77.7%
Taylor expanded in z around 0 89.4%
associate--l+89.4%
associate-+r+89.4%
associate-+r+89.4%
div-sub89.4%
*-commutative89.4%
associate-+r+89.4%
Simplified89.4%
Taylor expanded in x around inf 77.7%
if -3.49999999999999983e-182 < y < 4.6000000000000003e-110Initial program 79.7%
Taylor expanded in b around 0 72.4%
Final simplification80.0%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (/ y (+ t (+ y x))) (+ a (- z b))))
(t_2 (+ y (+ t x)))
(t_3 (+ z (/ (- (* a (+ y t)) (* y b)) t_2))))
(if (<= y -6e+36)
t_1
(if (<= y -1.2e-161)
t_3
(if (<= y 2.6e-280)
(+ a (* z (+ (/ y t_2) (/ x t_2))))
(if (<= y 2.15e+27) t_3 t_1))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (y / (t + (y + x))) * (a + (z - b));
double t_2 = y + (t + x);
double t_3 = z + (((a * (y + t)) - (y * b)) / t_2);
double tmp;
if (y <= -6e+36) {
tmp = t_1;
} else if (y <= -1.2e-161) {
tmp = t_3;
} else if (y <= 2.6e-280) {
tmp = a + (z * ((y / t_2) + (x / t_2)));
} else if (y <= 2.15e+27) {
tmp = t_3;
} 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) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = (y / (t + (y + x))) * (a + (z - b))
t_2 = y + (t + x)
t_3 = z + (((a * (y + t)) - (y * b)) / t_2)
if (y <= (-6d+36)) then
tmp = t_1
else if (y <= (-1.2d-161)) then
tmp = t_3
else if (y <= 2.6d-280) then
tmp = a + (z * ((y / t_2) + (x / t_2)))
else if (y <= 2.15d+27) then
tmp = t_3
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 = (y / (t + (y + x))) * (a + (z - b));
double t_2 = y + (t + x);
double t_3 = z + (((a * (y + t)) - (y * b)) / t_2);
double tmp;
if (y <= -6e+36) {
tmp = t_1;
} else if (y <= -1.2e-161) {
tmp = t_3;
} else if (y <= 2.6e-280) {
tmp = a + (z * ((y / t_2) + (x / t_2)));
} else if (y <= 2.15e+27) {
tmp = t_3;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (y / (t + (y + x))) * (a + (z - b)) t_2 = y + (t + x) t_3 = z + (((a * (y + t)) - (y * b)) / t_2) tmp = 0 if y <= -6e+36: tmp = t_1 elif y <= -1.2e-161: tmp = t_3 elif y <= 2.6e-280: tmp = a + (z * ((y / t_2) + (x / t_2))) elif y <= 2.15e+27: tmp = t_3 else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(y / Float64(t + Float64(y + x))) * Float64(a + Float64(z - b))) t_2 = Float64(y + Float64(t + x)) t_3 = Float64(z + Float64(Float64(Float64(a * Float64(y + t)) - Float64(y * b)) / t_2)) tmp = 0.0 if (y <= -6e+36) tmp = t_1; elseif (y <= -1.2e-161) tmp = t_3; elseif (y <= 2.6e-280) tmp = Float64(a + Float64(z * Float64(Float64(y / t_2) + Float64(x / t_2)))); elseif (y <= 2.15e+27) tmp = t_3; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (y / (t + (y + x))) * (a + (z - b)); t_2 = y + (t + x); t_3 = z + (((a * (y + t)) - (y * b)) / t_2); tmp = 0.0; if (y <= -6e+36) tmp = t_1; elseif (y <= -1.2e-161) tmp = t_3; elseif (y <= 2.6e-280) tmp = a + (z * ((y / t_2) + (x / t_2))); elseif (y <= 2.15e+27) tmp = t_3; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(y / N[(t + N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(a + N[(z - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(y + N[(t + x), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(z + N[(N[(N[(a * N[(y + t), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -6e+36], t$95$1, If[LessEqual[y, -1.2e-161], t$95$3, If[LessEqual[y, 2.6e-280], N[(a + N[(z * N[(N[(y / t$95$2), $MachinePrecision] + N[(x / t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.15e+27], t$95$3, t$95$1]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y}{t + \left(y + x\right)} \cdot \left(a + \left(z - b\right)\right)\\
t_2 := y + \left(t + x\right)\\
t_3 := z + \frac{a \cdot \left(y + t\right) - y \cdot b}{t\_2}\\
\mathbf{if}\;y \leq -6 \cdot 10^{+36}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -1.2 \cdot 10^{-161}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;y \leq 2.6 \cdot 10^{-280}:\\
\;\;\;\;a + z \cdot \left(\frac{y}{t\_2} + \frac{x}{t\_2}\right)\\
\mathbf{elif}\;y \leq 2.15 \cdot 10^{+27}:\\
\;\;\;\;t\_3\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -6e36 or 2.15000000000000004e27 < y Initial program 38.6%
Taylor expanded in y around inf 34.6%
expm1-log1p-u22.0%
expm1-udef11.3%
associate-/l*32.2%
+-commutative32.2%
associate-+l+32.2%
associate--l+32.2%
Applied egg-rr32.2%
expm1-def39.2%
expm1-log1p81.2%
associate-/r/85.0%
+-commutative85.0%
Simplified85.0%
if -6e36 < y < -1.19999999999999999e-161 or 2.6e-280 < y < 2.15000000000000004e27Initial program 80.8%
Taylor expanded in z around 0 91.4%
associate--l+91.4%
associate-+r+91.4%
associate-+r+91.4%
div-sub91.4%
*-commutative91.4%
associate-+r+91.4%
Simplified91.4%
Taylor expanded in x around inf 79.2%
if -1.19999999999999999e-161 < y < 2.6e-280Initial program 74.1%
Taylor expanded in z around 0 86.0%
associate--l+86.0%
associate-+r+86.0%
associate-+r+86.0%
div-sub86.0%
*-commutative86.0%
associate-+r+86.0%
Simplified86.0%
Taylor expanded in t around inf 78.5%
Final simplification82.0%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ t (+ y x)))
(t_2 (* (/ y t_1) (+ a (- z b))))
(t_3 (+ z (/ a (/ t_1 (+ y t))))))
(if (<= a -1.26e-64)
t_3
(if (<= a 1.15e-195)
t_2
(if (<= a 5.9e-186)
(/ (+ (* t a) (* x z)) (+ t x))
(if (<= a 2e-52) t_2 t_3))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = t + (y + x);
double t_2 = (y / t_1) * (a + (z - b));
double t_3 = z + (a / (t_1 / (y + t)));
double tmp;
if (a <= -1.26e-64) {
tmp = t_3;
} else if (a <= 1.15e-195) {
tmp = t_2;
} else if (a <= 5.9e-186) {
tmp = ((t * a) + (x * z)) / (t + x);
} else if (a <= 2e-52) {
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 = t + (y + x)
t_2 = (y / t_1) * (a + (z - b))
t_3 = z + (a / (t_1 / (y + t)))
if (a <= (-1.26d-64)) then
tmp = t_3
else if (a <= 1.15d-195) then
tmp = t_2
else if (a <= 5.9d-186) then
tmp = ((t * a) + (x * z)) / (t + x)
else if (a <= 2d-52) 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 = t + (y + x);
double t_2 = (y / t_1) * (a + (z - b));
double t_3 = z + (a / (t_1 / (y + t)));
double tmp;
if (a <= -1.26e-64) {
tmp = t_3;
} else if (a <= 1.15e-195) {
tmp = t_2;
} else if (a <= 5.9e-186) {
tmp = ((t * a) + (x * z)) / (t + x);
} else if (a <= 2e-52) {
tmp = t_2;
} else {
tmp = t_3;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = t + (y + x) t_2 = (y / t_1) * (a + (z - b)) t_3 = z + (a / (t_1 / (y + t))) tmp = 0 if a <= -1.26e-64: tmp = t_3 elif a <= 1.15e-195: tmp = t_2 elif a <= 5.9e-186: tmp = ((t * a) + (x * z)) / (t + x) elif a <= 2e-52: tmp = t_2 else: tmp = t_3 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(t + Float64(y + x)) t_2 = Float64(Float64(y / t_1) * Float64(a + Float64(z - b))) t_3 = Float64(z + Float64(a / Float64(t_1 / Float64(y + t)))) tmp = 0.0 if (a <= -1.26e-64) tmp = t_3; elseif (a <= 1.15e-195) tmp = t_2; elseif (a <= 5.9e-186) tmp = Float64(Float64(Float64(t * a) + Float64(x * z)) / Float64(t + x)); elseif (a <= 2e-52) tmp = t_2; else tmp = t_3; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = t + (y + x); t_2 = (y / t_1) * (a + (z - b)); t_3 = z + (a / (t_1 / (y + t))); tmp = 0.0; if (a <= -1.26e-64) tmp = t_3; elseif (a <= 1.15e-195) tmp = t_2; elseif (a <= 5.9e-186) tmp = ((t * a) + (x * z)) / (t + x); elseif (a <= 2e-52) tmp = t_2; else tmp = t_3; 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[(y / t$95$1), $MachinePrecision] * N[(a + N[(z - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(z + N[(a / N[(t$95$1 / N[(y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -1.26e-64], t$95$3, If[LessEqual[a, 1.15e-195], t$95$2, If[LessEqual[a, 5.9e-186], N[(N[(N[(t * a), $MachinePrecision] + N[(x * z), $MachinePrecision]), $MachinePrecision] / N[(t + x), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 2e-52], t$95$2, t$95$3]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t + \left(y + x\right)\\
t_2 := \frac{y}{t\_1} \cdot \left(a + \left(z - b\right)\right)\\
t_3 := z + \frac{a}{\frac{t\_1}{y + t}}\\
\mathbf{if}\;a \leq -1.26 \cdot 10^{-64}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;a \leq 1.15 \cdot 10^{-195}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;a \leq 5.9 \cdot 10^{-186}:\\
\;\;\;\;\frac{t \cdot a + x \cdot z}{t + x}\\
\mathbf{elif}\;a \leq 2 \cdot 10^{-52}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;t\_3\\
\end{array}
\end{array}
if a < -1.2599999999999999e-64 or 2e-52 < a Initial program 57.1%
Taylor expanded in z around 0 63.7%
associate--l+63.7%
associate-+r+63.7%
associate-+r+63.7%
div-sub63.7%
*-commutative63.7%
associate-+r+63.7%
Simplified63.7%
Taylor expanded in a around inf 59.1%
associate-/l*88.4%
+-commutative88.4%
+-commutative88.4%
Simplified88.4%
Taylor expanded in x around inf 78.7%
if -1.2599999999999999e-64 < a < 1.1500000000000001e-195 or 5.8999999999999999e-186 < a < 2e-52Initial program 58.8%
Taylor expanded in y around inf 48.2%
expm1-log1p-u33.7%
expm1-udef16.5%
associate-/l*25.9%
+-commutative25.9%
associate-+l+25.9%
associate--l+25.9%
Applied egg-rr25.9%
expm1-def39.6%
expm1-log1p69.7%
associate-/r/77.6%
+-commutative77.6%
Simplified77.6%
if 1.1500000000000001e-195 < a < 5.8999999999999999e-186Initial program 100.0%
Taylor expanded in y around 0 100.0%
Final simplification78.7%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -2.4e-147) (not (<= y 2.1e-114))) (* (/ y (+ t (+ y x))) (+ a (- z b))) (/ (+ (* t a) (* x z)) (+ t x))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -2.4e-147) || !(y <= 2.1e-114)) {
tmp = (y / (t + (y + x))) * (a + (z - b));
} else {
tmp = ((t * a) + (x * z)) / (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-147)) .or. (.not. (y <= 2.1d-114))) then
tmp = (y / (t + (y + x))) * (a + (z - b))
else
tmp = ((t * a) + (x * z)) / (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-147) || !(y <= 2.1e-114)) {
tmp = (y / (t + (y + x))) * (a + (z - b));
} else {
tmp = ((t * a) + (x * z)) / (t + x);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -2.4e-147) or not (y <= 2.1e-114): tmp = (y / (t + (y + x))) * (a + (z - b)) else: tmp = ((t * a) + (x * z)) / (t + x) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -2.4e-147) || !(y <= 2.1e-114)) tmp = Float64(Float64(y / Float64(t + Float64(y + x))) * Float64(a + Float64(z - b))); else tmp = Float64(Float64(Float64(t * a) + Float64(x * z)) / Float64(t + x)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -2.4e-147) || ~((y <= 2.1e-114))) tmp = (y / (t + (y + x))) * (a + (z - b)); else tmp = ((t * a) + (x * z)) / (t + x); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -2.4e-147], N[Not[LessEqual[y, 2.1e-114]], $MachinePrecision]], N[(N[(y / N[(t + N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(a + N[(z - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(t * a), $MachinePrecision] + N[(x * z), $MachinePrecision]), $MachinePrecision] / N[(t + x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.4 \cdot 10^{-147} \lor \neg \left(y \leq 2.1 \cdot 10^{-114}\right):\\
\;\;\;\;\frac{y}{t + \left(y + x\right)} \cdot \left(a + \left(z - b\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{t \cdot a + x \cdot z}{t + x}\\
\end{array}
\end{array}
if y < -2.39999999999999998e-147 or 2.09999999999999993e-114 < y Initial program 50.8%
Taylor expanded in y around inf 40.3%
expm1-log1p-u25.3%
expm1-udef16.0%
associate-/l*30.6%
+-commutative30.6%
associate-+l+30.6%
associate--l+30.6%
Applied egg-rr30.6%
expm1-def37.3%
expm1-log1p71.9%
associate-/r/76.7%
+-commutative76.7%
Simplified76.7%
if -2.39999999999999998e-147 < y < 2.09999999999999993e-114Initial program 76.2%
Taylor expanded in y around 0 62.8%
Final simplification72.4%
(FPCore (x y z t a b) :precision binary64 (if (or (<= x -2.25e+89) (not (<= x 3.1e+201))) (+ z (* y (- (/ a x) (/ b x)))) (- (+ a z) b)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((x <= -2.25e+89) || !(x <= 3.1e+201)) {
tmp = z + (y * ((a / x) - (b / 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.25d+89)) .or. (.not. (x <= 3.1d+201))) then
tmp = z + (y * ((a / x) - (b / 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.25e+89) || !(x <= 3.1e+201)) {
tmp = z + (y * ((a / x) - (b / x)));
} else {
tmp = (a + z) - b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (x <= -2.25e+89) or not (x <= 3.1e+201): tmp = z + (y * ((a / x) - (b / x))) else: tmp = (a + z) - b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((x <= -2.25e+89) || !(x <= 3.1e+201)) tmp = Float64(z + Float64(y * Float64(Float64(a / x) - Float64(b / 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.25e+89) || ~((x <= 3.1e+201))) tmp = z + (y * ((a / x) - (b / x))); else tmp = (a + z) - b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[x, -2.25e+89], N[Not[LessEqual[x, 3.1e+201]], $MachinePrecision]], N[(z + N[(y * N[(N[(a / x), $MachinePrecision] - N[(b / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(a + z), $MachinePrecision] - b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.25 \cdot 10^{+89} \lor \neg \left(x \leq 3.1 \cdot 10^{+201}\right):\\
\;\;\;\;z + y \cdot \left(\frac{a}{x} - \frac{b}{x}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(a + z\right) - b\\
\end{array}
\end{array}
if x < -2.25e89 or 3.0999999999999998e201 < x Initial program 47.7%
Taylor expanded in x around inf 49.2%
associate--r+49.2%
sub-neg49.2%
mul-1-neg49.2%
associate-+r+49.2%
+-commutative49.2%
associate--l+53.4%
Simplified73.2%
Taylor expanded in y around inf 70.6%
if -2.25e89 < x < 3.0999999999999998e201Initial program 62.7%
Taylor expanded in y around inf 63.4%
Final simplification65.4%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -3.6e-145) (not (<= y 9e-33))) (/ y (/ (+ y x) (+ a (- z b)))) (/ (+ (* t a) (* x z)) (+ t x))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -3.6e-145) || !(y <= 9e-33)) {
tmp = y / ((y + x) / (a + (z - b)));
} else {
tmp = ((t * a) + (x * z)) / (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 <= (-3.6d-145)) .or. (.not. (y <= 9d-33))) then
tmp = y / ((y + x) / (a + (z - b)))
else
tmp = ((t * a) + (x * z)) / (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 <= -3.6e-145) || !(y <= 9e-33)) {
tmp = y / ((y + x) / (a + (z - b)));
} else {
tmp = ((t * a) + (x * z)) / (t + x);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -3.6e-145) or not (y <= 9e-33): tmp = y / ((y + x) / (a + (z - b))) else: tmp = ((t * a) + (x * z)) / (t + x) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -3.6e-145) || !(y <= 9e-33)) tmp = Float64(y / Float64(Float64(y + x) / Float64(a + Float64(z - b)))); else tmp = Float64(Float64(Float64(t * a) + Float64(x * z)) / Float64(t + x)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -3.6e-145) || ~((y <= 9e-33))) tmp = y / ((y + x) / (a + (z - b))); else tmp = ((t * a) + (x * z)) / (t + x); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -3.6e-145], N[Not[LessEqual[y, 9e-33]], $MachinePrecision]], N[(y / N[(N[(y + x), $MachinePrecision] / N[(a + N[(z - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(t * a), $MachinePrecision] + N[(x * z), $MachinePrecision]), $MachinePrecision] / N[(t + x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.6 \cdot 10^{-145} \lor \neg \left(y \leq 9 \cdot 10^{-33}\right):\\
\;\;\;\;\frac{y}{\frac{y + x}{a + \left(z - b\right)}}\\
\mathbf{else}:\\
\;\;\;\;\frac{t \cdot a + x \cdot z}{t + x}\\
\end{array}
\end{array}
if y < -3.6e-145 or 8.99999999999999982e-33 < y Initial program 47.4%
Taylor expanded in y around inf 39.3%
Taylor expanded in t around 0 36.0%
associate-+r-36.0%
associate-/l*69.9%
+-commutative69.9%
Simplified69.9%
if -3.6e-145 < y < 8.99999999999999982e-33Initial program 78.0%
Taylor expanded in y around 0 60.0%
Final simplification66.3%
(FPCore (x y z t a b) :precision binary64 (if (or (<= x -1.65e+98) (not (<= x 1.56e+205))) (+ z (* (+ y t) (/ a x))) (- (+ a z) b)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((x <= -1.65e+98) || !(x <= 1.56e+205)) {
tmp = z + ((y + t) * (a / 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 <= (-1.65d+98)) .or. (.not. (x <= 1.56d+205))) then
tmp = z + ((y + t) * (a / 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 <= -1.65e+98) || !(x <= 1.56e+205)) {
tmp = z + ((y + t) * (a / x));
} else {
tmp = (a + z) - b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (x <= -1.65e+98) or not (x <= 1.56e+205): tmp = z + ((y + t) * (a / x)) else: tmp = (a + z) - b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((x <= -1.65e+98) || !(x <= 1.56e+205)) tmp = Float64(z + Float64(Float64(y + t) * Float64(a / 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 <= -1.65e+98) || ~((x <= 1.56e+205))) tmp = z + ((y + t) * (a / x)); else tmp = (a + z) - b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[x, -1.65e+98], N[Not[LessEqual[x, 1.56e+205]], $MachinePrecision]], N[(z + N[(N[(y + t), $MachinePrecision] * N[(a / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(a + z), $MachinePrecision] - b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.65 \cdot 10^{+98} \lor \neg \left(x \leq 1.56 \cdot 10^{+205}\right):\\
\;\;\;\;z + \left(y + t\right) \cdot \frac{a}{x}\\
\mathbf{else}:\\
\;\;\;\;\left(a + z\right) - b\\
\end{array}
\end{array}
if x < -1.65000000000000014e98 or 1.56000000000000007e205 < x Initial program 47.6%
Taylor expanded in x around inf 50.5%
associate--r+50.5%
sub-neg50.5%
mul-1-neg50.5%
associate-+r+50.5%
+-commutative50.5%
associate--l+54.8%
Simplified73.8%
Taylor expanded in a around -inf 54.6%
associate-*l/63.1%
*-commutative63.1%
+-commutative63.1%
Simplified63.1%
if -1.65000000000000014e98 < x < 1.56000000000000007e205Initial program 62.6%
Taylor expanded in y around inf 62.8%
Final simplification62.9%
(FPCore (x y z t a b) :precision binary64 (if (or (<= x -2.05e+99) (not (<= x 7e+205))) (+ z (/ (* y a) x)) (- (+ a z) b)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((x <= -2.05e+99) || !(x <= 7e+205)) {
tmp = z + ((y * a) / 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.05d+99)) .or. (.not. (x <= 7d+205))) then
tmp = z + ((y * a) / 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.05e+99) || !(x <= 7e+205)) {
tmp = z + ((y * a) / x);
} else {
tmp = (a + z) - b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (x <= -2.05e+99) or not (x <= 7e+205): tmp = z + ((y * a) / x) else: tmp = (a + z) - b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((x <= -2.05e+99) || !(x <= 7e+205)) tmp = Float64(z + Float64(Float64(y * a) / 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.05e+99) || ~((x <= 7e+205))) tmp = z + ((y * a) / x); else tmp = (a + z) - b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[x, -2.05e+99], N[Not[LessEqual[x, 7e+205]], $MachinePrecision]], N[(z + N[(N[(y * a), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], N[(N[(a + z), $MachinePrecision] - b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.05 \cdot 10^{+99} \lor \neg \left(x \leq 7 \cdot 10^{+205}\right):\\
\;\;\;\;z + \frac{y \cdot a}{x}\\
\mathbf{else}:\\
\;\;\;\;\left(a + z\right) - b\\
\end{array}
\end{array}
if x < -2.0499999999999999e99 or 6.9999999999999996e205 < x Initial program 47.6%
Taylor expanded in x around inf 50.5%
associate--r+50.5%
sub-neg50.5%
mul-1-neg50.5%
associate-+r+50.5%
+-commutative50.5%
associate--l+54.8%
Simplified73.8%
Taylor expanded in a around -inf 54.6%
associate-*l/63.1%
*-commutative63.1%
+-commutative63.1%
Simplified63.1%
Taylor expanded in y around inf 54.2%
if -2.0499999999999999e99 < x < 6.9999999999999996e205Initial program 62.6%
Taylor expanded in y around inf 62.8%
Final simplification60.6%
(FPCore (x y z t a b) :precision binary64 (if (or (<= x -6.2e+95) (not (<= x 5.8e+204))) (+ z (* y (/ a x))) (- (+ a z) b)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((x <= -6.2e+95) || !(x <= 5.8e+204)) {
tmp = z + (y * (a / 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 <= (-6.2d+95)) .or. (.not. (x <= 5.8d+204))) then
tmp = z + (y * (a / 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 <= -6.2e+95) || !(x <= 5.8e+204)) {
tmp = z + (y * (a / x));
} else {
tmp = (a + z) - b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (x <= -6.2e+95) or not (x <= 5.8e+204): tmp = z + (y * (a / x)) else: tmp = (a + z) - b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((x <= -6.2e+95) || !(x <= 5.8e+204)) tmp = Float64(z + Float64(y * Float64(a / 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 <= -6.2e+95) || ~((x <= 5.8e+204))) tmp = z + (y * (a / x)); else tmp = (a + z) - b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[x, -6.2e+95], N[Not[LessEqual[x, 5.8e+204]], $MachinePrecision]], N[(z + N[(y * N[(a / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(a + z), $MachinePrecision] - b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -6.2 \cdot 10^{+95} \lor \neg \left(x \leq 5.8 \cdot 10^{+204}\right):\\
\;\;\;\;z + y \cdot \frac{a}{x}\\
\mathbf{else}:\\
\;\;\;\;\left(a + z\right) - b\\
\end{array}
\end{array}
if x < -6.2000000000000006e95 or 5.80000000000000007e204 < x Initial program 47.6%
Taylor expanded in x around inf 50.5%
associate--r+50.5%
sub-neg50.5%
mul-1-neg50.5%
associate-+r+50.5%
+-commutative50.5%
associate--l+54.8%
Simplified73.8%
Taylor expanded in a around -inf 54.6%
associate-*l/63.1%
*-commutative63.1%
+-commutative63.1%
Simplified63.1%
Taylor expanded in t around 0 54.2%
+-commutative54.2%
associate-/l*58.5%
Simplified58.5%
associate-/r/58.5%
Applied egg-rr58.5%
if -6.2000000000000006e95 < x < 5.80000000000000007e204Initial program 62.6%
Taylor expanded in y around inf 62.8%
Final simplification61.7%
(FPCore (x y z t a b) :precision binary64 (if (<= x -2.9e+97) (+ z (* y (/ a x))) (if (<= x 2e+204) (- (+ a z) b) (+ z (/ a (/ x t))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -2.9e+97) {
tmp = z + (y * (a / x));
} else if (x <= 2e+204) {
tmp = (a + z) - b;
} else {
tmp = z + (a / (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 <= (-2.9d+97)) then
tmp = z + (y * (a / x))
else if (x <= 2d+204) then
tmp = (a + z) - b
else
tmp = z + (a / (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 <= -2.9e+97) {
tmp = z + (y * (a / x));
} else if (x <= 2e+204) {
tmp = (a + z) - b;
} else {
tmp = z + (a / (x / t));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= -2.9e+97: tmp = z + (y * (a / x)) elif x <= 2e+204: tmp = (a + z) - b else: tmp = z + (a / (x / t)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -2.9e+97) tmp = Float64(z + Float64(y * Float64(a / x))); elseif (x <= 2e+204) tmp = Float64(Float64(a + z) - b); else tmp = Float64(z + Float64(a / Float64(x / t))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (x <= -2.9e+97) tmp = z + (y * (a / x)); elseif (x <= 2e+204) tmp = (a + z) - b; else tmp = z + (a / (x / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -2.9e+97], N[(z + N[(y * N[(a / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 2e+204], N[(N[(a + z), $MachinePrecision] - b), $MachinePrecision], N[(z + N[(a / N[(x / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.9 \cdot 10^{+97}:\\
\;\;\;\;z + y \cdot \frac{a}{x}\\
\mathbf{elif}\;x \leq 2 \cdot 10^{+204}:\\
\;\;\;\;\left(a + z\right) - b\\
\mathbf{else}:\\
\;\;\;\;z + \frac{a}{\frac{x}{t}}\\
\end{array}
\end{array}
if x < -2.89999999999999987e97Initial program 44.0%
Taylor expanded in x around inf 46.3%
associate--r+46.3%
sub-neg46.3%
mul-1-neg46.3%
associate-+r+46.3%
+-commutative46.3%
associate--l+50.1%
Simplified72.3%
Taylor expanded in a around -inf 49.8%
associate-*l/59.1%
*-commutative59.1%
+-commutative59.1%
Simplified59.1%
Taylor expanded in t around 0 49.7%
+-commutative49.7%
associate-/l*55.4%
Simplified55.4%
associate-/r/55.4%
Applied egg-rr55.4%
if -2.89999999999999987e97 < x < 1.99999999999999998e204Initial program 62.6%
Taylor expanded in y around inf 62.8%
if 1.99999999999999998e204 < x Initial program 58.9%
Taylor expanded in x around inf 64.1%
associate--r+64.1%
sub-neg64.1%
mul-1-neg64.1%
associate-+r+64.1%
+-commutative64.1%
associate--l+70.1%
Simplified78.5%
Taylor expanded in a around -inf 70.1%
associate-*l/76.1%
*-commutative76.1%
+-commutative76.1%
Simplified76.1%
Taylor expanded in y around 0 65.8%
+-commutative65.8%
associate-/l*71.8%
Simplified71.8%
Final simplification61.9%
(FPCore (x y z t a b) :precision binary64 (if (<= x -3.4e+167) z (if (<= x 5.4e+209) (- (+ a z) b) z)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -3.4e+167) {
tmp = z;
} else if (x <= 5.4e+209) {
tmp = (a + z) - 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 <= (-3.4d+167)) then
tmp = z
else if (x <= 5.4d+209) then
tmp = (a + z) - 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 <= -3.4e+167) {
tmp = z;
} else if (x <= 5.4e+209) {
tmp = (a + z) - b;
} else {
tmp = z;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= -3.4e+167: tmp = z elif x <= 5.4e+209: tmp = (a + z) - b else: tmp = z return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -3.4e+167) tmp = z; elseif (x <= 5.4e+209) tmp = Float64(Float64(a + z) - b); else tmp = z; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (x <= -3.4e+167) tmp = z; elseif (x <= 5.4e+209) tmp = (a + z) - b; else tmp = z; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -3.4e+167], z, If[LessEqual[x, 5.4e+209], N[(N[(a + z), $MachinePrecision] - b), $MachinePrecision], z]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.4 \cdot 10^{+167}:\\
\;\;\;\;z\\
\mathbf{elif}\;x \leq 5.4 \cdot 10^{+209}:\\
\;\;\;\;\left(a + z\right) - b\\
\mathbf{else}:\\
\;\;\;\;z\\
\end{array}
\end{array}
if x < -3.4e167 or 5.4e209 < x Initial program 48.7%
Taylor expanded in x around inf 59.0%
if -3.4e167 < x < 5.4e209Initial program 61.1%
Taylor expanded in y around inf 60.2%
Final simplification60.0%
(FPCore (x y z t a b) :precision binary64 (if (<= a -510000.0) a (if (<= a 2.1e+44) z a)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -510000.0) {
tmp = a;
} else if (a <= 2.1e+44) {
tmp = z;
} else {
tmp = a;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (a <= (-510000.0d0)) then
tmp = a
else if (a <= 2.1d+44) then
tmp = z
else
tmp = a
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -510000.0) {
tmp = a;
} else if (a <= 2.1e+44) {
tmp = z;
} else {
tmp = a;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if a <= -510000.0: tmp = a elif a <= 2.1e+44: tmp = z else: tmp = a return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (a <= -510000.0) tmp = a; elseif (a <= 2.1e+44) tmp = z; else tmp = a; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (a <= -510000.0) tmp = a; elseif (a <= 2.1e+44) tmp = z; else tmp = a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, -510000.0], a, If[LessEqual[a, 2.1e+44], z, a]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -510000:\\
\;\;\;\;a\\
\mathbf{elif}\;a \leq 2.1 \cdot 10^{+44}:\\
\;\;\;\;z\\
\mathbf{else}:\\
\;\;\;\;a\\
\end{array}
\end{array}
if a < -5.1e5 or 2.09999999999999987e44 < a Initial program 53.1%
Taylor expanded in t around inf 54.5%
if -5.1e5 < a < 2.09999999999999987e44Initial program 62.9%
Taylor expanded in x around inf 41.2%
Final simplification47.0%
(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.6%
Taylor expanded in t around inf 29.7%
Final simplification29.7%
(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 2024031
(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)))