
(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 (+ y (+ x t)))
(t_2 (/ (- (+ (* (+ x y) z) (* a (+ y t))) (* y b)) t_1)))
(if (or (<= t_2 -2e+306) (not (<= t_2 5e+233)))
(+ (/ (- z b) (/ t_1 y)) (+ (/ z (/ t_1 x)) (/ (+ y t) (/ t_1 a))))
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 = ((((x + y) * z) + (a * (y + t))) - (y * b)) / t_1;
double tmp;
if ((t_2 <= -2e+306) || !(t_2 <= 5e+233)) {
tmp = ((z - b) / (t_1 / y)) + ((z / (t_1 / x)) + ((y + t) / (t_1 / a)));
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = y + (x + t)
t_2 = ((((x + y) * z) + (a * (y + t))) - (y * b)) / t_1
if ((t_2 <= (-2d+306)) .or. (.not. (t_2 <= 5d+233))) then
tmp = ((z - b) / (t_1 / y)) + ((z / (t_1 / x)) + ((y + t) / (t_1 / a)))
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = y + (x + t);
double t_2 = ((((x + y) * z) + (a * (y + t))) - (y * b)) / t_1;
double tmp;
if ((t_2 <= -2e+306) || !(t_2 <= 5e+233)) {
tmp = ((z - b) / (t_1 / y)) + ((z / (t_1 / x)) + ((y + t) / (t_1 / a)));
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = y + (x + t) t_2 = ((((x + y) * z) + (a * (y + t))) - (y * b)) / t_1 tmp = 0 if (t_2 <= -2e+306) or not (t_2 <= 5e+233): tmp = ((z - b) / (t_1 / y)) + ((z / (t_1 / x)) + ((y + t) / (t_1 / a))) 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(x + y) * z) + Float64(a * Float64(y + t))) - Float64(y * b)) / t_1) tmp = 0.0 if ((t_2 <= -2e+306) || !(t_2 <= 5e+233)) tmp = Float64(Float64(Float64(z - b) / Float64(t_1 / y)) + Float64(Float64(z / Float64(t_1 / x)) + Float64(Float64(y + t) / Float64(t_1 / a)))); 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 = ((((x + y) * z) + (a * (y + t))) - (y * b)) / t_1; tmp = 0.0; if ((t_2 <= -2e+306) || ~((t_2 <= 5e+233))) tmp = ((z - b) / (t_1 / y)) + ((z / (t_1 / x)) + ((y + t) / (t_1 / a))); 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[(x + y), $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, -2e+306], N[Not[LessEqual[t$95$2, 5e+233]], $MachinePrecision]], N[(N[(N[(z - b), $MachinePrecision] / N[(t$95$1 / y), $MachinePrecision]), $MachinePrecision] + N[(N[(z / N[(t$95$1 / x), $MachinePrecision]), $MachinePrecision] + N[(N[(y + t), $MachinePrecision] / N[(t$95$1 / a), $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(x + y\right) \cdot z + a \cdot \left(y + t\right)\right) - y \cdot b}{t_1}\\
\mathbf{if}\;t_2 \leq -2 \cdot 10^{+306} \lor \neg \left(t_2 \leq 5 \cdot 10^{+233}\right):\\
\;\;\;\;\frac{z - b}{\frac{t_1}{y}} + \left(\frac{z}{\frac{t_1}{x}} + \frac{y + t}{\frac{t_1}{a}}\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)) < -2.00000000000000003e306 or 5.00000000000000009e233 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 9.8%
Simplified11.1%
Taylor expanded in a around -inf 10.0%
associate-/l*32.8%
mul-1-neg32.8%
unsub-neg32.8%
associate-/l*51.0%
associate-/l*99.8%
+-commutative99.8%
mul-1-neg99.8%
unsub-neg99.8%
neg-mul-199.8%
Simplified99.8%
if -2.00000000000000003e306 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 5.00000000000000009e233Initial program 99.8%
Final simplification99.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (- (+ (* (+ x y) z) (* a (+ y t))) (* y b)) (+ y (+ x t)))))
(if (<= t_1 -2e+306)
(+ a (/ (- z b) (/ (+ y t) y)))
(if (<= t_1 5e+274) t_1 (- (+ z a) b)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((((x + y) * z) + (a * (y + t))) - (y * b)) / (y + (x + t));
double tmp;
if (t_1 <= -2e+306) {
tmp = a + ((z - b) / ((y + t) / y));
} else if (t_1 <= 5e+274) {
tmp = t_1;
} else {
tmp = (z + a) - b;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = ((((x + y) * z) + (a * (y + t))) - (y * b)) / (y + (x + t))
if (t_1 <= (-2d+306)) then
tmp = a + ((z - b) / ((y + t) / y))
else if (t_1 <= 5d+274) then
tmp = t_1
else
tmp = (z + a) - b
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((((x + y) * z) + (a * (y + t))) - (y * b)) / (y + (x + t));
double tmp;
if (t_1 <= -2e+306) {
tmp = a + ((z - b) / ((y + t) / y));
} else if (t_1 <= 5e+274) {
tmp = t_1;
} else {
tmp = (z + a) - b;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = ((((x + y) * z) + (a * (y + t))) - (y * b)) / (y + (x + t)) tmp = 0 if t_1 <= -2e+306: tmp = a + ((z - b) / ((y + t) / y)) elif t_1 <= 5e+274: tmp = t_1 else: tmp = (z + a) - b return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(Float64(Float64(x + y) * z) + Float64(a * Float64(y + t))) - Float64(y * b)) / Float64(y + Float64(x + t))) tmp = 0.0 if (t_1 <= -2e+306) tmp = Float64(a + Float64(Float64(z - b) / Float64(Float64(y + t) / y))); elseif (t_1 <= 5e+274) tmp = t_1; else tmp = Float64(Float64(z + a) - b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = ((((x + y) * z) + (a * (y + t))) - (y * b)) / (y + (x + t)); tmp = 0.0; if (t_1 <= -2e+306) tmp = a + ((z - b) / ((y + t) / y)); elseif (t_1 <= 5e+274) tmp = t_1; else tmp = (z + a) - b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(N[(N[(x + y), $MachinePrecision] * z), $MachinePrecision] + N[(a * N[(y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -2e+306], N[(a + N[(N[(z - b), $MachinePrecision] / N[(N[(y + t), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 5e+274], t$95$1, N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\left(\left(x + y\right) \cdot z + a \cdot \left(y + t\right)\right) - y \cdot b}{y + \left(x + t\right)}\\
\mathbf{if}\;t_1 \leq -2 \cdot 10^{+306}:\\
\;\;\;\;a + \frac{z - b}{\frac{y + t}{y}}\\
\mathbf{elif}\;t_1 \leq 5 \cdot 10^{+274}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\left(z + a\right) - b\\
\end{array}
\end{array}
if (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < -2.00000000000000003e306Initial program 9.1%
Simplified8.9%
Taylor expanded in a around -inf 9.1%
associate-/l*25.3%
mul-1-neg25.3%
unsub-neg25.3%
associate-/l*53.0%
associate-/l*99.9%
+-commutative99.9%
mul-1-neg99.9%
unsub-neg99.9%
neg-mul-199.9%
Simplified99.9%
Taylor expanded in x around 0 53.0%
sub-neg53.0%
associate-/l*77.5%
+-commutative77.5%
mul-1-neg77.5%
remove-double-neg77.5%
Simplified77.5%
if -2.00000000000000003e306 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 4.9999999999999998e274Initial program 99.8%
if 4.9999999999999998e274 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 4.2%
Taylor expanded in y around inf 82.3%
+-commutative82.3%
Simplified82.3%
Final simplification92.7%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ y (+ x t))))
(if (<= z 6.2e+171)
(+ (/ (- z b) (/ t_1 y)) (+ (/ a (/ t_1 (+ y t))) (/ (* x z) t_1)))
(/ (+ x y) (/ t_1 z)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = y + (x + t);
double tmp;
if (z <= 6.2e+171) {
tmp = ((z - b) / (t_1 / y)) + ((a / (t_1 / (y + t))) + ((x * z) / t_1));
} else {
tmp = (x + y) / (t_1 / 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) :: t_1
real(8) :: tmp
t_1 = y + (x + t)
if (z <= 6.2d+171) then
tmp = ((z - b) / (t_1 / y)) + ((a / (t_1 / (y + t))) + ((x * z) / t_1))
else
tmp = (x + y) / (t_1 / z)
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 tmp;
if (z <= 6.2e+171) {
tmp = ((z - b) / (t_1 / y)) + ((a / (t_1 / (y + t))) + ((x * z) / t_1));
} else {
tmp = (x + y) / (t_1 / z);
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = y + (x + t) tmp = 0 if z <= 6.2e+171: tmp = ((z - b) / (t_1 / y)) + ((a / (t_1 / (y + t))) + ((x * z) / t_1)) else: tmp = (x + y) / (t_1 / z) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(y + Float64(x + t)) tmp = 0.0 if (z <= 6.2e+171) tmp = Float64(Float64(Float64(z - b) / Float64(t_1 / y)) + Float64(Float64(a / Float64(t_1 / Float64(y + t))) + Float64(Float64(x * z) / t_1))); else tmp = Float64(Float64(x + y) / Float64(t_1 / z)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = y + (x + t); tmp = 0.0; if (z <= 6.2e+171) tmp = ((z - b) / (t_1 / y)) + ((a / (t_1 / (y + t))) + ((x * z) / t_1)); else tmp = (x + y) / (t_1 / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, 6.2e+171], N[(N[(N[(z - b), $MachinePrecision] / N[(t$95$1 / y), $MachinePrecision]), $MachinePrecision] + N[(N[(a / N[(t$95$1 / N[(y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(x * z), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x + y), $MachinePrecision] / N[(t$95$1 / z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y + \left(x + t\right)\\
\mathbf{if}\;z \leq 6.2 \cdot 10^{+171}:\\
\;\;\;\;\frac{z - b}{\frac{t_1}{y}} + \left(\frac{a}{\frac{t_1}{y + t}} + \frac{x \cdot z}{t_1}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x + y}{\frac{t_1}{z}}\\
\end{array}
\end{array}
if z < 6.1999999999999998e171Initial program 71.2%
Simplified71.6%
Taylor expanded in a around inf 71.3%
associate-/l*76.9%
+-commutative76.9%
associate-/l*94.0%
Simplified94.0%
if 6.1999999999999998e171 < z Initial program 21.4%
Taylor expanded in z around inf 16.3%
associate-/l*85.1%
Simplified85.1%
Final simplification93.0%
(FPCore (x y z t a b)
:precision binary64
(if (<= x -1.55e+189)
z
(if (<= x -3.5e+92)
(* a (/ (+ y t) (+ y (+ x t))))
(if (<= x 2.45e+163) (+ a (/ (- z b) (/ (+ y t) y))) z))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -1.55e+189) {
tmp = z;
} else if (x <= -3.5e+92) {
tmp = a * ((y + t) / (y + (x + t)));
} else if (x <= 2.45e+163) {
tmp = a + ((z - b) / ((y + t) / y));
} 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.55d+189)) then
tmp = z
else if (x <= (-3.5d+92)) then
tmp = a * ((y + t) / (y + (x + t)))
else if (x <= 2.45d+163) then
tmp = a + ((z - b) / ((y + t) / y))
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.55e+189) {
tmp = z;
} else if (x <= -3.5e+92) {
tmp = a * ((y + t) / (y + (x + t)));
} else if (x <= 2.45e+163) {
tmp = a + ((z - b) / ((y + t) / y));
} else {
tmp = z;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= -1.55e+189: tmp = z elif x <= -3.5e+92: tmp = a * ((y + t) / (y + (x + t))) elif x <= 2.45e+163: tmp = a + ((z - b) / ((y + t) / y)) else: tmp = z return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -1.55e+189) tmp = z; elseif (x <= -3.5e+92) tmp = Float64(a * Float64(Float64(y + t) / Float64(y + Float64(x + t)))); elseif (x <= 2.45e+163) tmp = Float64(a + Float64(Float64(z - b) / Float64(Float64(y + t) / y))); else tmp = z; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (x <= -1.55e+189) tmp = z; elseif (x <= -3.5e+92) tmp = a * ((y + t) / (y + (x + t))); elseif (x <= 2.45e+163) tmp = a + ((z - b) / ((y + t) / y)); else tmp = z; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -1.55e+189], z, If[LessEqual[x, -3.5e+92], N[(a * N[(N[(y + t), $MachinePrecision] / N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 2.45e+163], N[(a + N[(N[(z - b), $MachinePrecision] / N[(N[(y + t), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], z]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.55 \cdot 10^{+189}:\\
\;\;\;\;z\\
\mathbf{elif}\;x \leq -3.5 \cdot 10^{+92}:\\
\;\;\;\;a \cdot \frac{y + t}{y + \left(x + t\right)}\\
\mathbf{elif}\;x \leq 2.45 \cdot 10^{+163}:\\
\;\;\;\;a + \frac{z - b}{\frac{y + t}{y}}\\
\mathbf{else}:\\
\;\;\;\;z\\
\end{array}
\end{array}
if x < -1.55e189 or 2.45e163 < x Initial program 51.8%
Taylor expanded in x around inf 67.5%
if -1.55e189 < x < -3.49999999999999986e92Initial program 77.0%
Taylor expanded in a around inf 49.9%
Taylor expanded in a around 0 49.9%
+-commutative49.9%
associate-*r/63.3%
+-commutative63.3%
Simplified63.3%
if -3.49999999999999986e92 < x < 2.45e163Initial program 66.6%
Simplified67.3%
Taylor expanded in a around -inf 66.7%
associate-/l*76.6%
mul-1-neg76.6%
unsub-neg76.6%
associate-/l*79.4%
associate-/l*93.8%
+-commutative93.8%
mul-1-neg93.8%
unsub-neg93.8%
neg-mul-193.8%
Simplified93.8%
Taylor expanded in x around 0 63.9%
sub-neg63.9%
associate-/l*84.9%
+-commutative84.9%
mul-1-neg84.9%
remove-double-neg84.9%
Simplified84.9%
Final simplification80.6%
(FPCore (x y z t a b) :precision binary64 (if (or (<= t -1.75e+131) (not (<= t 3.8e+69))) (+ a (/ (- z b) (/ t y))) (- (+ z a) b)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -1.75e+131) || !(t <= 3.8e+69)) {
tmp = a + ((z - b) / (t / y));
} else {
tmp = (z + a) - b;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((t <= (-1.75d+131)) .or. (.not. (t <= 3.8d+69))) then
tmp = a + ((z - b) / (t / y))
else
tmp = (z + a) - b
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -1.75e+131) || !(t <= 3.8e+69)) {
tmp = a + ((z - b) / (t / y));
} else {
tmp = (z + a) - b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (t <= -1.75e+131) or not (t <= 3.8e+69): tmp = a + ((z - b) / (t / y)) else: tmp = (z + a) - b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((t <= -1.75e+131) || !(t <= 3.8e+69)) tmp = Float64(a + Float64(Float64(z - b) / Float64(t / y))); else tmp = Float64(Float64(z + a) - b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((t <= -1.75e+131) || ~((t <= 3.8e+69))) tmp = a + ((z - b) / (t / y)); else tmp = (z + a) - b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[t, -1.75e+131], N[Not[LessEqual[t, 3.8e+69]], $MachinePrecision]], N[(a + N[(N[(z - b), $MachinePrecision] / N[(t / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.75 \cdot 10^{+131} \lor \neg \left(t \leq 3.8 \cdot 10^{+69}\right):\\
\;\;\;\;a + \frac{z - b}{\frac{t}{y}}\\
\mathbf{else}:\\
\;\;\;\;\left(z + a\right) - b\\
\end{array}
\end{array}
if t < -1.7499999999999999e131 or 3.80000000000000028e69 < t Initial program 60.2%
Simplified60.4%
Taylor expanded in a around -inf 60.4%
associate-/l*66.4%
mul-1-neg66.4%
unsub-neg66.4%
associate-/l*73.6%
associate-/l*89.0%
+-commutative89.0%
mul-1-neg89.0%
unsub-neg89.0%
neg-mul-189.0%
Simplified89.0%
Taylor expanded in x around 0 67.8%
sub-neg67.8%
associate-/l*78.5%
+-commutative78.5%
mul-1-neg78.5%
remove-double-neg78.5%
Simplified78.5%
Taylor expanded in t around inf 65.1%
associate-/l*68.8%
Simplified68.8%
if -1.7499999999999999e131 < t < 3.80000000000000028e69Initial program 67.6%
Taylor expanded in y around inf 63.8%
+-commutative63.8%
Simplified63.8%
Final simplification65.4%
(FPCore (x y z t a b) :precision binary64 (if (<= t -1.1e+48) (- a (* b (/ y (+ y t)))) (if (<= t 7e+68) (- (+ z a) b) (+ a (/ (- z b) (/ t y))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -1.1e+48) {
tmp = a - (b * (y / (y + t)));
} else if (t <= 7e+68) {
tmp = (z + a) - b;
} else {
tmp = a + ((z - b) / (t / y));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (t <= (-1.1d+48)) then
tmp = a - (b * (y / (y + t)))
else if (t <= 7d+68) then
tmp = (z + a) - b
else
tmp = a + ((z - b) / (t / y))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -1.1e+48) {
tmp = a - (b * (y / (y + t)));
} else if (t <= 7e+68) {
tmp = (z + a) - b;
} else {
tmp = a + ((z - b) / (t / y));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if t <= -1.1e+48: tmp = a - (b * (y / (y + t))) elif t <= 7e+68: tmp = (z + a) - b else: tmp = a + ((z - b) / (t / y)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (t <= -1.1e+48) tmp = Float64(a - Float64(b * Float64(y / Float64(y + t)))); elseif (t <= 7e+68) tmp = Float64(Float64(z + a) - b); else tmp = Float64(a + Float64(Float64(z - b) / Float64(t / y))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (t <= -1.1e+48) tmp = a - (b * (y / (y + t))); elseif (t <= 7e+68) tmp = (z + a) - b; else tmp = a + ((z - b) / (t / y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -1.1e+48], N[(a - N[(b * N[(y / N[(y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 7e+68], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision], N[(a + N[(N[(z - b), $MachinePrecision] / N[(t / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.1 \cdot 10^{+48}:\\
\;\;\;\;a - b \cdot \frac{y}{y + t}\\
\mathbf{elif}\;t \leq 7 \cdot 10^{+68}:\\
\;\;\;\;\left(z + a\right) - b\\
\mathbf{else}:\\
\;\;\;\;a + \frac{z - b}{\frac{t}{y}}\\
\end{array}
\end{array}
if t < -1.1e48Initial program 60.8%
Simplified61.1%
Taylor expanded in a around -inf 60.9%
associate-/l*62.9%
mul-1-neg62.9%
unsub-neg62.9%
associate-/l*68.2%
associate-/l*89.3%
+-commutative89.3%
mul-1-neg89.3%
unsub-neg89.3%
neg-mul-189.3%
Simplified89.3%
Taylor expanded in x around 0 57.5%
sub-neg57.5%
associate-/l*68.2%
+-commutative68.2%
mul-1-neg68.2%
remove-double-neg68.2%
Simplified68.2%
Taylor expanded in z around 0 55.7%
mul-1-neg55.7%
*-commutative55.7%
+-commutative55.7%
associate-*r/62.8%
distribute-lft-neg-in62.8%
+-commutative62.8%
Simplified62.8%
Taylor expanded in b around 0 55.7%
mul-1-neg55.7%
*-commutative55.7%
associate-*r/62.8%
sub-neg62.8%
Simplified62.8%
if -1.1e48 < t < 6.99999999999999955e68Initial program 67.8%
Taylor expanded in y around inf 66.3%
+-commutative66.3%
Simplified66.3%
if 6.99999999999999955e68 < t Initial program 62.1%
Simplified62.1%
Taylor expanded in a around -inf 62.3%
associate-/l*72.7%
mul-1-neg72.7%
unsub-neg72.7%
associate-/l*81.1%
associate-/l*93.5%
+-commutative93.5%
mul-1-neg93.5%
unsub-neg93.5%
neg-mul-193.5%
Simplified93.5%
Taylor expanded in x around 0 71.2%
sub-neg71.2%
associate-/l*83.7%
+-commutative83.7%
mul-1-neg83.7%
remove-double-neg83.7%
Simplified83.7%
Taylor expanded in t around inf 66.6%
associate-/l*70.8%
Simplified70.8%
Final simplification66.3%
(FPCore (x y z t a b)
:precision binary64
(if (<= x -6.8e-9)
z
(if (<= x 1.9e+55)
(- a b)
(if (<= x 2e+123) z (if (<= x 1.25e+134) (- a b) z)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -6.8e-9) {
tmp = z;
} else if (x <= 1.9e+55) {
tmp = a - b;
} else if (x <= 2e+123) {
tmp = z;
} else if (x <= 1.25e+134) {
tmp = a - b;
} else {
tmp = z;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (x <= (-6.8d-9)) then
tmp = z
else if (x <= 1.9d+55) then
tmp = a - b
else if (x <= 2d+123) then
tmp = z
else if (x <= 1.25d+134) then
tmp = a - b
else
tmp = z
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -6.8e-9) {
tmp = z;
} else if (x <= 1.9e+55) {
tmp = a - b;
} else if (x <= 2e+123) {
tmp = z;
} else if (x <= 1.25e+134) {
tmp = a - b;
} else {
tmp = z;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= -6.8e-9: tmp = z elif x <= 1.9e+55: tmp = a - b elif x <= 2e+123: tmp = z elif x <= 1.25e+134: tmp = a - b else: tmp = z return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -6.8e-9) tmp = z; elseif (x <= 1.9e+55) tmp = Float64(a - b); elseif (x <= 2e+123) tmp = z; elseif (x <= 1.25e+134) tmp = Float64(a - b); else tmp = z; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (x <= -6.8e-9) tmp = z; elseif (x <= 1.9e+55) tmp = a - b; elseif (x <= 2e+123) tmp = z; elseif (x <= 1.25e+134) tmp = a - b; else tmp = z; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -6.8e-9], z, If[LessEqual[x, 1.9e+55], N[(a - b), $MachinePrecision], If[LessEqual[x, 2e+123], z, If[LessEqual[x, 1.25e+134], N[(a - b), $MachinePrecision], z]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -6.8 \cdot 10^{-9}:\\
\;\;\;\;z\\
\mathbf{elif}\;x \leq 1.9 \cdot 10^{+55}:\\
\;\;\;\;a - b\\
\mathbf{elif}\;x \leq 2 \cdot 10^{+123}:\\
\;\;\;\;z\\
\mathbf{elif}\;x \leq 1.25 \cdot 10^{+134}:\\
\;\;\;\;a - b\\
\mathbf{else}:\\
\;\;\;\;z\\
\end{array}
\end{array}
if x < -6.7999999999999997e-9 or 1.9e55 < x < 1.99999999999999996e123 or 1.24999999999999995e134 < x Initial program 58.8%
Taylor expanded in x around inf 53.5%
if -6.7999999999999997e-9 < x < 1.9e55 or 1.99999999999999996e123 < x < 1.24999999999999995e134Initial program 69.1%
Simplified69.8%
Taylor expanded in a around -inf 69.3%
associate-/l*78.4%
mul-1-neg78.4%
unsub-neg78.4%
associate-/l*79.0%
associate-/l*92.5%
+-commutative92.5%
mul-1-neg92.5%
unsub-neg92.5%
neg-mul-192.5%
Simplified92.5%
Taylor expanded in x around 0 70.9%
sub-neg70.9%
associate-/l*90.3%
+-commutative90.3%
mul-1-neg90.3%
remove-double-neg90.3%
Simplified90.3%
Taylor expanded in z around 0 60.4%
mul-1-neg60.4%
*-commutative60.4%
+-commutative60.4%
associate-*r/71.0%
distribute-lft-neg-in71.0%
+-commutative71.0%
Simplified71.0%
Taylor expanded in y around inf 53.1%
mul-1-neg53.1%
unsub-neg53.1%
Simplified53.1%
Final simplification53.3%
(FPCore (x y z t a b) :precision binary64 (if (or (<= t -2.2e+137) (not (<= t 2.52e+70))) (- a (* y (/ b t))) (- (+ z a) b)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -2.2e+137) || !(t <= 2.52e+70)) {
tmp = a - (y * (b / t));
} else {
tmp = (z + a) - b;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((t <= (-2.2d+137)) .or. (.not. (t <= 2.52d+70))) then
tmp = a - (y * (b / t))
else
tmp = (z + a) - b
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -2.2e+137) || !(t <= 2.52e+70)) {
tmp = a - (y * (b / t));
} else {
tmp = (z + a) - b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (t <= -2.2e+137) or not (t <= 2.52e+70): tmp = a - (y * (b / t)) else: tmp = (z + a) - b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((t <= -2.2e+137) || !(t <= 2.52e+70)) tmp = Float64(a - Float64(y * Float64(b / t))); else tmp = Float64(Float64(z + a) - b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((t <= -2.2e+137) || ~((t <= 2.52e+70))) tmp = a - (y * (b / t)); else tmp = (z + a) - b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[t, -2.2e+137], N[Not[LessEqual[t, 2.52e+70]], $MachinePrecision]], N[(a - N[(y * N[(b / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.2 \cdot 10^{+137} \lor \neg \left(t \leq 2.52 \cdot 10^{+70}\right):\\
\;\;\;\;a - y \cdot \frac{b}{t}\\
\mathbf{else}:\\
\;\;\;\;\left(z + a\right) - b\\
\end{array}
\end{array}
if t < -2.20000000000000015e137 or 2.52000000000000003e70 < t Initial program 59.7%
Simplified59.9%
Taylor expanded in a around -inf 59.9%
associate-/l*66.0%
mul-1-neg66.0%
unsub-neg66.0%
associate-/l*73.3%
associate-/l*88.8%
+-commutative88.8%
mul-1-neg88.8%
unsub-neg88.8%
neg-mul-188.8%
Simplified88.8%
Taylor expanded in x around 0 67.3%
sub-neg67.3%
associate-/l*78.3%
+-commutative78.3%
mul-1-neg78.3%
remove-double-neg78.3%
Simplified78.3%
Taylor expanded in z around 0 62.0%
mul-1-neg62.0%
*-commutative62.0%
+-commutative62.0%
associate-*r/65.7%
distribute-lft-neg-in65.7%
+-commutative65.7%
Simplified65.7%
Taylor expanded in y around 0 60.9%
mul-1-neg60.9%
associate-/l*63.5%
unsub-neg63.5%
associate-/l*60.9%
associate-*r/63.5%
Simplified63.5%
if -2.20000000000000015e137 < t < 2.52000000000000003e70Initial program 67.8%
Taylor expanded in y around inf 63.5%
+-commutative63.5%
Simplified63.5%
Final simplification63.5%
(FPCore (x y z t a b) :precision binary64 (if (<= t -5.9e+184) a (if (<= t 2.9e+144) (- (+ z a) b) (* a (- 1.0 (/ x t))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -5.9e+184) {
tmp = a;
} else if (t <= 2.9e+144) {
tmp = (z + a) - b;
} else {
tmp = a * (1.0 - (x / t));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (t <= (-5.9d+184)) then
tmp = a
else if (t <= 2.9d+144) then
tmp = (z + a) - b
else
tmp = a * (1.0d0 - (x / t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -5.9e+184) {
tmp = a;
} else if (t <= 2.9e+144) {
tmp = (z + a) - b;
} else {
tmp = a * (1.0 - (x / t));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if t <= -5.9e+184: tmp = a elif t <= 2.9e+144: tmp = (z + a) - b else: tmp = a * (1.0 - (x / t)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (t <= -5.9e+184) tmp = a; elseif (t <= 2.9e+144) tmp = Float64(Float64(z + a) - b); else tmp = Float64(a * Float64(1.0 - Float64(x / t))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (t <= -5.9e+184) tmp = a; elseif (t <= 2.9e+144) tmp = (z + a) - b; else tmp = a * (1.0 - (x / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -5.9e+184], a, If[LessEqual[t, 2.9e+144], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision], N[(a * N[(1.0 - N[(x / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -5.9 \cdot 10^{+184}:\\
\;\;\;\;a\\
\mathbf{elif}\;t \leq 2.9 \cdot 10^{+144}:\\
\;\;\;\;\left(z + a\right) - b\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(1 - \frac{x}{t}\right)\\
\end{array}
\end{array}
if t < -5.9000000000000001e184Initial program 56.2%
Taylor expanded in t around inf 61.7%
if -5.9000000000000001e184 < t < 2.89999999999999998e144Initial program 67.6%
Taylor expanded in y around inf 61.3%
+-commutative61.3%
Simplified61.3%
if 2.89999999999999998e144 < t Initial program 57.1%
Simplified57.3%
Taylor expanded in t around inf 74.1%
associate--l+74.1%
associate-/l*80.5%
+-commutative80.5%
associate-/l*89.6%
associate-/l*92.6%
Simplified92.6%
Taylor expanded in a around inf 64.4%
Final simplification61.7%
(FPCore (x y z t a b) :precision binary64 (if (<= x -7e-9) z (if (<= x 1.45e+68) a (if (<= x 7.4e+122) z (if (<= x 1.15e+140) a z)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -7e-9) {
tmp = z;
} else if (x <= 1.45e+68) {
tmp = a;
} else if (x <= 7.4e+122) {
tmp = z;
} else if (x <= 1.15e+140) {
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 <= (-7d-9)) then
tmp = z
else if (x <= 1.45d+68) then
tmp = a
else if (x <= 7.4d+122) then
tmp = z
else if (x <= 1.15d+140) 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 <= -7e-9) {
tmp = z;
} else if (x <= 1.45e+68) {
tmp = a;
} else if (x <= 7.4e+122) {
tmp = z;
} else if (x <= 1.15e+140) {
tmp = a;
} else {
tmp = z;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= -7e-9: tmp = z elif x <= 1.45e+68: tmp = a elif x <= 7.4e+122: tmp = z elif x <= 1.15e+140: tmp = a else: tmp = z return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -7e-9) tmp = z; elseif (x <= 1.45e+68) tmp = a; elseif (x <= 7.4e+122) tmp = z; elseif (x <= 1.15e+140) tmp = a; else tmp = z; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (x <= -7e-9) tmp = z; elseif (x <= 1.45e+68) tmp = a; elseif (x <= 7.4e+122) tmp = z; elseif (x <= 1.15e+140) tmp = a; else tmp = z; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -7e-9], z, If[LessEqual[x, 1.45e+68], a, If[LessEqual[x, 7.4e+122], z, If[LessEqual[x, 1.15e+140], a, z]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -7 \cdot 10^{-9}:\\
\;\;\;\;z\\
\mathbf{elif}\;x \leq 1.45 \cdot 10^{+68}:\\
\;\;\;\;a\\
\mathbf{elif}\;x \leq 7.4 \cdot 10^{+122}:\\
\;\;\;\;z\\
\mathbf{elif}\;x \leq 1.15 \cdot 10^{+140}:\\
\;\;\;\;a\\
\mathbf{else}:\\
\;\;\;\;z\\
\end{array}
\end{array}
if x < -6.9999999999999998e-9 or 1.45000000000000006e68 < x < 7.3999999999999993e122 or 1.14999999999999995e140 < x Initial program 58.9%
Taylor expanded in x around inf 54.6%
if -6.9999999999999998e-9 < x < 1.45000000000000006e68 or 7.3999999999999993e122 < x < 1.14999999999999995e140Initial program 68.9%
Taylor expanded in t around inf 48.5%
Final simplification50.7%
(FPCore (x y z t a b) :precision binary64 (if (<= t -2.55e+187) a (if (<= t 2.35e+145) (- (+ z a) b) a)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -2.55e+187) {
tmp = a;
} else if (t <= 2.35e+145) {
tmp = (z + a) - b;
} else {
tmp = a;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (t <= (-2.55d+187)) then
tmp = a
else if (t <= 2.35d+145) then
tmp = (z + a) - b
else
tmp = a
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -2.55e+187) {
tmp = a;
} else if (t <= 2.35e+145) {
tmp = (z + a) - b;
} else {
tmp = a;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if t <= -2.55e+187: tmp = a elif t <= 2.35e+145: tmp = (z + a) - b else: tmp = a return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (t <= -2.55e+187) tmp = a; elseif (t <= 2.35e+145) tmp = Float64(Float64(z + a) - b); else tmp = a; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (t <= -2.55e+187) tmp = a; elseif (t <= 2.35e+145) tmp = (z + a) - b; else tmp = a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -2.55e+187], a, If[LessEqual[t, 2.35e+145], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision], a]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.55 \cdot 10^{+187}:\\
\;\;\;\;a\\
\mathbf{elif}\;t \leq 2.35 \cdot 10^{+145}:\\
\;\;\;\;\left(z + a\right) - b\\
\mathbf{else}:\\
\;\;\;\;a\\
\end{array}
\end{array}
if t < -2.55e187 or 2.3500000000000001e145 < t Initial program 56.7%
Taylor expanded in t around inf 62.9%
if -2.55e187 < t < 2.3500000000000001e145Initial program 67.6%
Taylor expanded in y around inf 61.3%
+-commutative61.3%
Simplified61.3%
Final simplification61.6%
(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 65.3%
Taylor expanded in t around inf 36.3%
Final simplification36.3%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ (+ x t) y))
(t_2 (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)))
(t_3 (/ t_2 t_1))
(t_4 (- (+ z a) b)))
(if (< t_3 -3.5813117084150564e+153)
t_4
(if (< t_3 1.2285964308315609e+82) (/ 1.0 (/ t_1 t_2)) t_4))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x + t) + y;
double t_2 = (((x + y) * z) + ((t + y) * a)) - (y * b);
double t_3 = t_2 / t_1;
double t_4 = (z + a) - b;
double tmp;
if (t_3 < -3.5813117084150564e+153) {
tmp = t_4;
} else if (t_3 < 1.2285964308315609e+82) {
tmp = 1.0 / (t_1 / t_2);
} else {
tmp = t_4;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: tmp
t_1 = (x + t) + y
t_2 = (((x + y) * z) + ((t + y) * a)) - (y * b)
t_3 = t_2 / t_1
t_4 = (z + a) - b
if (t_3 < (-3.5813117084150564d+153)) then
tmp = t_4
else if (t_3 < 1.2285964308315609d+82) then
tmp = 1.0d0 / (t_1 / t_2)
else
tmp = t_4
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x + t) + y;
double t_2 = (((x + y) * z) + ((t + y) * a)) - (y * b);
double t_3 = t_2 / t_1;
double t_4 = (z + a) - b;
double tmp;
if (t_3 < -3.5813117084150564e+153) {
tmp = t_4;
} else if (t_3 < 1.2285964308315609e+82) {
tmp = 1.0 / (t_1 / t_2);
} else {
tmp = t_4;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (x + t) + y t_2 = (((x + y) * z) + ((t + y) * a)) - (y * b) t_3 = t_2 / t_1 t_4 = (z + a) - b tmp = 0 if t_3 < -3.5813117084150564e+153: tmp = t_4 elif t_3 < 1.2285964308315609e+82: tmp = 1.0 / (t_1 / t_2) else: tmp = t_4 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(x + t) + y) t_2 = Float64(Float64(Float64(Float64(x + y) * z) + Float64(Float64(t + y) * a)) - Float64(y * b)) t_3 = Float64(t_2 / t_1) t_4 = Float64(Float64(z + a) - b) tmp = 0.0 if (t_3 < -3.5813117084150564e+153) tmp = t_4; elseif (t_3 < 1.2285964308315609e+82) tmp = Float64(1.0 / Float64(t_1 / t_2)); else tmp = t_4; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (x + t) + y; t_2 = (((x + y) * z) + ((t + y) * a)) - (y * b); t_3 = t_2 / t_1; t_4 = (z + a) - b; tmp = 0.0; if (t_3 < -3.5813117084150564e+153) tmp = t_4; elseif (t_3 < 1.2285964308315609e+82) tmp = 1.0 / (t_1 / t_2); else tmp = t_4; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(x + t), $MachinePrecision] + y), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(N[(x + y), $MachinePrecision] * z), $MachinePrecision] + N[(N[(t + y), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(t$95$2 / t$95$1), $MachinePrecision]}, Block[{t$95$4 = N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision]}, If[Less[t$95$3, -3.5813117084150564e+153], t$95$4, If[Less[t$95$3, 1.2285964308315609e+82], N[(1.0 / N[(t$95$1 / t$95$2), $MachinePrecision]), $MachinePrecision], t$95$4]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(x + t\right) + y\\
t_2 := \left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b\\
t_3 := \frac{t_2}{t_1}\\
t_4 := \left(z + a\right) - b\\
\mathbf{if}\;t_3 < -3.5813117084150564 \cdot 10^{+153}:\\
\;\;\;\;t_4\\
\mathbf{elif}\;t_3 < 1.2285964308315609 \cdot 10^{+82}:\\
\;\;\;\;\frac{1}{\frac{t_1}{t_2}}\\
\mathbf{else}:\\
\;\;\;\;t_4\\
\end{array}
\end{array}
herbie shell --seed 2023278
(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)))