
(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 13 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 (+ t (+ x y))))
(if (or (<= z -29000000000000.0) (not (<= z 6e+151)))
(*
z
(+
(/ x t_1)
(- (fma (/ a z) (/ (+ y t) t_1) (/ y t_1)) (* (/ b t_1) (/ y z)))))
(*
a
(+
(/ t t_2)
(- (+ (/ y t_2) (* (/ z a) (/ (+ x y) t_2))) (* b (/ y (* 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 = t + (x + y);
double tmp;
if ((z <= -29000000000000.0) || !(z <= 6e+151)) {
tmp = z * ((x / t_1) + (fma((a / z), ((y + t) / t_1), (y / t_1)) - ((b / t_1) * (y / z))));
} else {
tmp = a * ((t / t_2) + (((y / t_2) + ((z / a) * ((x + y) / t_2))) - (b * (y / (a * t_2)))));
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(y + Float64(x + t)) t_2 = Float64(t + Float64(x + y)) tmp = 0.0 if ((z <= -29000000000000.0) || !(z <= 6e+151)) tmp = Float64(z * Float64(Float64(x / t_1) + Float64(fma(Float64(a / z), Float64(Float64(y + t) / t_1), Float64(y / t_1)) - Float64(Float64(b / t_1) * Float64(y / z))))); else tmp = Float64(a * Float64(Float64(t / t_2) + Float64(Float64(Float64(y / t_2) + Float64(Float64(z / a) * Float64(Float64(x + y) / t_2))) - Float64(b * Float64(y / Float64(a * t_2)))))); end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t + N[(x + y), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[z, -29000000000000.0], N[Not[LessEqual[z, 6e+151]], $MachinePrecision]], N[(z * N[(N[(x / t$95$1), $MachinePrecision] + N[(N[(N[(a / z), $MachinePrecision] * N[(N[(y + t), $MachinePrecision] / t$95$1), $MachinePrecision] + N[(y / t$95$1), $MachinePrecision]), $MachinePrecision] - N[(N[(b / t$95$1), $MachinePrecision] * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * N[(N[(t / t$95$2), $MachinePrecision] + N[(N[(N[(y / t$95$2), $MachinePrecision] + N[(N[(z / a), $MachinePrecision] * N[(N[(x + y), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(b * N[(y / N[(a * t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y + \left(x + t\right)\\
t_2 := t + \left(x + y\right)\\
\mathbf{if}\;z \leq -29000000000000 \lor \neg \left(z \leq 6 \cdot 10^{+151}\right):\\
\;\;\;\;z \cdot \left(\frac{x}{t\_1} + \left(\mathsf{fma}\left(\frac{a}{z}, \frac{y + t}{t\_1}, \frac{y}{t\_1}\right) - \frac{b}{t\_1} \cdot \frac{y}{z}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(\frac{t}{t\_2} + \left(\left(\frac{y}{t\_2} + \frac{z}{a} \cdot \frac{x + y}{t\_2}\right) - b \cdot \frac{y}{a \cdot t\_2}\right)\right)\\
\end{array}
\end{array}
if z < -2.9e13 or 5.9999999999999998e151 < z Initial program 38.7%
Taylor expanded in z around inf 68.8%
associate--l+68.8%
+-commutative68.8%
associate-+r+68.8%
+-commutative68.8%
associate-+l+68.8%
Simplified99.8%
if -2.9e13 < z < 5.9999999999999998e151Initial program 73.3%
Taylor expanded in a around inf 85.9%
associate--l+85.9%
+-commutative85.9%
+-commutative85.9%
times-frac90.2%
+-commutative90.2%
+-commutative90.2%
associate-/l*95.3%
+-commutative95.3%
Simplified95.3%
Final simplification96.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* z (+ x y)))
(t_2 (+ y (+ x t)))
(t_3 (/ (- (+ (* a (+ y t)) t_1) (* y b)) t_2)))
(if (or (<= t_3 (- INFINITY)) (not (<= t_3 4e+290)))
(- (+ z a) b)
(+ (* a (/ (+ y t) t_2)) (/ (- t_1 (* y b)) t_2)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = z * (x + y);
double t_2 = y + (x + t);
double t_3 = (((a * (y + t)) + t_1) - (y * b)) / t_2;
double tmp;
if ((t_3 <= -((double) INFINITY)) || !(t_3 <= 4e+290)) {
tmp = (z + a) - b;
} else {
tmp = (a * ((y + t) / t_2)) + ((t_1 - (y * b)) / t_2);
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = z * (x + y);
double t_2 = y + (x + t);
double t_3 = (((a * (y + t)) + t_1) - (y * b)) / t_2;
double tmp;
if ((t_3 <= -Double.POSITIVE_INFINITY) || !(t_3 <= 4e+290)) {
tmp = (z + a) - b;
} else {
tmp = (a * ((y + t) / t_2)) + ((t_1 - (y * b)) / t_2);
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = z * (x + y) t_2 = y + (x + t) t_3 = (((a * (y + t)) + t_1) - (y * b)) / t_2 tmp = 0 if (t_3 <= -math.inf) or not (t_3 <= 4e+290): tmp = (z + a) - b else: tmp = (a * ((y + t) / t_2)) + ((t_1 - (y * b)) / t_2) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(z * Float64(x + y)) t_2 = Float64(y + Float64(x + t)) t_3 = Float64(Float64(Float64(Float64(a * Float64(y + t)) + t_1) - Float64(y * b)) / t_2) tmp = 0.0 if ((t_3 <= Float64(-Inf)) || !(t_3 <= 4e+290)) tmp = Float64(Float64(z + a) - b); else tmp = Float64(Float64(a * Float64(Float64(y + t) / t_2)) + Float64(Float64(t_1 - Float64(y * b)) / t_2)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = z * (x + y); t_2 = y + (x + t); t_3 = (((a * (y + t)) + t_1) - (y * b)) / t_2; tmp = 0.0; if ((t_3 <= -Inf) || ~((t_3 <= 4e+290))) tmp = (z + a) - b; else tmp = (a * ((y + t) / t_2)) + ((t_1 - (y * b)) / t_2); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(z * N[(x + y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(N[(a * N[(y + t), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / t$95$2), $MachinePrecision]}, If[Or[LessEqual[t$95$3, (-Infinity)], N[Not[LessEqual[t$95$3, 4e+290]], $MachinePrecision]], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision], N[(N[(a * N[(N[(y + t), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$1 - N[(y * b), $MachinePrecision]), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \left(x + y\right)\\
t_2 := y + \left(x + t\right)\\
t_3 := \frac{\left(a \cdot \left(y + t\right) + t\_1\right) - y \cdot b}{t\_2}\\
\mathbf{if}\;t\_3 \leq -\infty \lor \neg \left(t\_3 \leq 4 \cdot 10^{+290}\right):\\
\;\;\;\;\left(z + a\right) - b\\
\mathbf{else}:\\
\;\;\;\;a \cdot \frac{y + t}{t\_2} + \frac{t\_1 - y \cdot b}{t\_2}\\
\end{array}
\end{array}
if (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < -inf.0 or 4.00000000000000025e290 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 6.3%
Taylor expanded in y around inf 72.8%
if -inf.0 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 4.00000000000000025e290Initial program 99.7%
Taylor expanded in b around 0 99.7%
mul-1-neg99.7%
+-commutative99.7%
associate-+l+99.7%
associate-/l*99.8%
+-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
associate-+l+99.8%
sub-neg99.8%
div-sub99.8%
+-commutative99.8%
*-commutative99.8%
+-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
associate-+l+99.8%
Simplified99.8%
Final simplification88.8%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (/ (- (+ (* a (+ y t)) (* z (+ x y))) (* y b)) (+ y (+ x t))))) (if (or (<= t_1 (- INFINITY)) (not (<= t_1 4e+290))) (- (+ z a) b) t_1)))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (((a * (y + t)) + (z * (x + y))) - (y * b)) / (y + (x + t));
double tmp;
if ((t_1 <= -((double) INFINITY)) || !(t_1 <= 4e+290)) {
tmp = (z + a) - b;
} else {
tmp = t_1;
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (((a * (y + t)) + (z * (x + y))) - (y * b)) / (y + (x + t));
double tmp;
if ((t_1 <= -Double.POSITIVE_INFINITY) || !(t_1 <= 4e+290)) {
tmp = (z + a) - b;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (((a * (y + t)) + (z * (x + y))) - (y * b)) / (y + (x + t)) tmp = 0 if (t_1 <= -math.inf) or not (t_1 <= 4e+290): tmp = (z + a) - b else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(Float64(a * Float64(y + t)) + Float64(z * Float64(x + y))) - Float64(y * b)) / Float64(y + Float64(x + t))) tmp = 0.0 if ((t_1 <= Float64(-Inf)) || !(t_1 <= 4e+290)) tmp = Float64(Float64(z + a) - b); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (((a * (y + t)) + (z * (x + y))) - (y * b)) / (y + (x + t)); tmp = 0.0; if ((t_1 <= -Inf) || ~((t_1 <= 4e+290))) tmp = (z + a) - b; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(N[(a * N[(y + t), $MachinePrecision]), $MachinePrecision] + N[(z * N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$1, (-Infinity)], N[Not[LessEqual[t$95$1, 4e+290]], $MachinePrecision]], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision], t$95$1]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\left(a \cdot \left(y + t\right) + z \cdot \left(x + y\right)\right) - y \cdot b}{y + \left(x + t\right)}\\
\mathbf{if}\;t\_1 \leq -\infty \lor \neg \left(t\_1 \leq 4 \cdot 10^{+290}\right):\\
\;\;\;\;\left(z + a\right) - b\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < -inf.0 or 4.00000000000000025e290 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 6.3%
Taylor expanded in y around inf 72.8%
if -inf.0 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 4.00000000000000025e290Initial program 99.7%
Final simplification88.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ t (+ x y))))
(if (<= z -3.5e+151)
(- (+ z a) b)
(if (<= z 8.5e+157)
(*
a
(+
(/ t t_1)
(- (+ (/ y t_1) (* (/ z a) (/ (+ x y) t_1))) (* b (/ y (* a t_1))))))
(* z (/ (+ x y) (+ y (+ x t))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = t + (x + y);
double tmp;
if (z <= -3.5e+151) {
tmp = (z + a) - b;
} else if (z <= 8.5e+157) {
tmp = a * ((t / t_1) + (((y / t_1) + ((z / a) * ((x + y) / t_1))) - (b * (y / (a * t_1)))));
} else {
tmp = z * ((x + y) / (y + (x + t)));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = t + (x + y)
if (z <= (-3.5d+151)) then
tmp = (z + a) - b
else if (z <= 8.5d+157) then
tmp = a * ((t / t_1) + (((y / t_1) + ((z / a) * ((x + y) / t_1))) - (b * (y / (a * t_1)))))
else
tmp = z * ((x + y) / (y + (x + t)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = t + (x + y);
double tmp;
if (z <= -3.5e+151) {
tmp = (z + a) - b;
} else if (z <= 8.5e+157) {
tmp = a * ((t / t_1) + (((y / t_1) + ((z / a) * ((x + y) / t_1))) - (b * (y / (a * t_1)))));
} else {
tmp = z * ((x + y) / (y + (x + t)));
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = t + (x + y) tmp = 0 if z <= -3.5e+151: tmp = (z + a) - b elif z <= 8.5e+157: tmp = a * ((t / t_1) + (((y / t_1) + ((z / a) * ((x + y) / t_1))) - (b * (y / (a * t_1))))) else: tmp = z * ((x + y) / (y + (x + t))) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(t + Float64(x + y)) tmp = 0.0 if (z <= -3.5e+151) tmp = Float64(Float64(z + a) - b); elseif (z <= 8.5e+157) tmp = Float64(a * Float64(Float64(t / t_1) + Float64(Float64(Float64(y / t_1) + Float64(Float64(z / a) * Float64(Float64(x + y) / t_1))) - Float64(b * Float64(y / Float64(a * t_1)))))); else tmp = Float64(z * Float64(Float64(x + y) / Float64(y + Float64(x + t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = t + (x + y); tmp = 0.0; if (z <= -3.5e+151) tmp = (z + a) - b; elseif (z <= 8.5e+157) tmp = a * ((t / t_1) + (((y / t_1) + ((z / a) * ((x + y) / t_1))) - (b * (y / (a * t_1))))); else tmp = z * ((x + y) / (y + (x + t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(t + N[(x + y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -3.5e+151], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision], If[LessEqual[z, 8.5e+157], N[(a * N[(N[(t / t$95$1), $MachinePrecision] + N[(N[(N[(y / t$95$1), $MachinePrecision] + N[(N[(z / a), $MachinePrecision] * N[(N[(x + y), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(b * N[(y / N[(a * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z * N[(N[(x + y), $MachinePrecision] / N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t + \left(x + y\right)\\
\mathbf{if}\;z \leq -3.5 \cdot 10^{+151}:\\
\;\;\;\;\left(z + a\right) - b\\
\mathbf{elif}\;z \leq 8.5 \cdot 10^{+157}:\\
\;\;\;\;a \cdot \left(\frac{t}{t\_1} + \left(\left(\frac{y}{t\_1} + \frac{z}{a} \cdot \frac{x + y}{t\_1}\right) - b \cdot \frac{y}{a \cdot t\_1}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;z \cdot \frac{x + y}{y + \left(x + t\right)}\\
\end{array}
\end{array}
if z < -3.5000000000000003e151Initial program 18.6%
Taylor expanded in y around inf 85.2%
if -3.5000000000000003e151 < z < 8.4999999999999998e157Initial program 71.1%
Taylor expanded in a around inf 82.6%
associate--l+82.6%
+-commutative82.6%
+-commutative82.6%
times-frac88.4%
+-commutative88.4%
+-commutative88.4%
associate-/l*93.4%
+-commutative93.4%
Simplified93.4%
if 8.4999999999999998e157 < z Initial program 44.9%
Taylor expanded in z around inf 31.5%
associate-/l*80.2%
+-commutative80.2%
+-commutative80.2%
associate-+r+80.2%
+-commutative80.2%
associate-+l+80.2%
Simplified80.2%
Final simplification90.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (+ (* t a) (* z x)) (+ x t))) (t_2 (- (+ z a) b)))
(if (<= y -9.5e-39)
t_2
(if (<= y -1.4e-209)
t_1
(if (<= y 1.65e-110)
(* a (+ (/ z a) (* t (/ 1.0 (+ x t)))))
(if (<= y 7.5e-82)
t_1
(if (or (<= y 9.8e-44) (not (<= y 1e+72)))
t_2
(* a (/ (+ y t) (+ y (+ x t)))))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((t * a) + (z * x)) / (x + t);
double t_2 = (z + a) - b;
double tmp;
if (y <= -9.5e-39) {
tmp = t_2;
} else if (y <= -1.4e-209) {
tmp = t_1;
} else if (y <= 1.65e-110) {
tmp = a * ((z / a) + (t * (1.0 / (x + t))));
} else if (y <= 7.5e-82) {
tmp = t_1;
} else if ((y <= 9.8e-44) || !(y <= 1e+72)) {
tmp = t_2;
} else {
tmp = a * ((y + t) / (y + (x + t)));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = ((t * a) + (z * x)) / (x + t)
t_2 = (z + a) - b
if (y <= (-9.5d-39)) then
tmp = t_2
else if (y <= (-1.4d-209)) then
tmp = t_1
else if (y <= 1.65d-110) then
tmp = a * ((z / a) + (t * (1.0d0 / (x + t))))
else if (y <= 7.5d-82) then
tmp = t_1
else if ((y <= 9.8d-44) .or. (.not. (y <= 1d+72))) then
tmp = t_2
else
tmp = a * ((y + t) / (y + (x + t)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((t * a) + (z * x)) / (x + t);
double t_2 = (z + a) - b;
double tmp;
if (y <= -9.5e-39) {
tmp = t_2;
} else if (y <= -1.4e-209) {
tmp = t_1;
} else if (y <= 1.65e-110) {
tmp = a * ((z / a) + (t * (1.0 / (x + t))));
} else if (y <= 7.5e-82) {
tmp = t_1;
} else if ((y <= 9.8e-44) || !(y <= 1e+72)) {
tmp = t_2;
} else {
tmp = a * ((y + t) / (y + (x + t)));
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = ((t * a) + (z * x)) / (x + t) t_2 = (z + a) - b tmp = 0 if y <= -9.5e-39: tmp = t_2 elif y <= -1.4e-209: tmp = t_1 elif y <= 1.65e-110: tmp = a * ((z / a) + (t * (1.0 / (x + t)))) elif y <= 7.5e-82: tmp = t_1 elif (y <= 9.8e-44) or not (y <= 1e+72): tmp = t_2 else: tmp = a * ((y + t) / (y + (x + t))) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(t * a) + Float64(z * x)) / Float64(x + t)) t_2 = Float64(Float64(z + a) - b) tmp = 0.0 if (y <= -9.5e-39) tmp = t_2; elseif (y <= -1.4e-209) tmp = t_1; elseif (y <= 1.65e-110) tmp = Float64(a * Float64(Float64(z / a) + Float64(t * Float64(1.0 / Float64(x + t))))); elseif (y <= 7.5e-82) tmp = t_1; elseif ((y <= 9.8e-44) || !(y <= 1e+72)) tmp = t_2; else tmp = Float64(a * Float64(Float64(y + t) / Float64(y + Float64(x + t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = ((t * a) + (z * x)) / (x + t); t_2 = (z + a) - b; tmp = 0.0; if (y <= -9.5e-39) tmp = t_2; elseif (y <= -1.4e-209) tmp = t_1; elseif (y <= 1.65e-110) tmp = a * ((z / a) + (t * (1.0 / (x + t)))); elseif (y <= 7.5e-82) tmp = t_1; elseif ((y <= 9.8e-44) || ~((y <= 1e+72))) tmp = t_2; else tmp = a * ((y + t) / (y + (x + t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(t * a), $MachinePrecision] + N[(z * x), $MachinePrecision]), $MachinePrecision] / N[(x + t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision]}, If[LessEqual[y, -9.5e-39], t$95$2, If[LessEqual[y, -1.4e-209], t$95$1, If[LessEqual[y, 1.65e-110], N[(a * N[(N[(z / a), $MachinePrecision] + N[(t * N[(1.0 / N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 7.5e-82], t$95$1, If[Or[LessEqual[y, 9.8e-44], N[Not[LessEqual[y, 1e+72]], $MachinePrecision]], t$95$2, N[(a * N[(N[(y + t), $MachinePrecision] / N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t \cdot a + z \cdot x}{x + t}\\
t_2 := \left(z + a\right) - b\\
\mathbf{if}\;y \leq -9.5 \cdot 10^{-39}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;y \leq -1.4 \cdot 10^{-209}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 1.65 \cdot 10^{-110}:\\
\;\;\;\;a \cdot \left(\frac{z}{a} + t \cdot \frac{1}{x + t}\right)\\
\mathbf{elif}\;y \leq 7.5 \cdot 10^{-82}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 9.8 \cdot 10^{-44} \lor \neg \left(y \leq 10^{+72}\right):\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;a \cdot \frac{y + t}{y + \left(x + t\right)}\\
\end{array}
\end{array}
if y < -9.4999999999999999e-39 or 7.4999999999999997e-82 < y < 9.8000000000000006e-44 or 9.99999999999999944e71 < y Initial program 45.2%
Taylor expanded in y around inf 78.3%
if -9.4999999999999999e-39 < y < -1.40000000000000006e-209 or 1.65e-110 < y < 7.4999999999999997e-82Initial program 86.0%
Taylor expanded in y around 0 68.6%
if -1.40000000000000006e-209 < y < 1.65e-110Initial program 69.4%
Taylor expanded in a around inf 83.8%
associate--l+83.8%
+-commutative83.8%
+-commutative83.8%
times-frac92.4%
+-commutative92.4%
+-commutative92.4%
associate-/l*92.4%
+-commutative92.4%
Simplified92.4%
Taylor expanded in y around 0 77.6%
associate-/l*79.3%
associate-/r*80.0%
Simplified80.0%
div-inv79.9%
+-commutative79.9%
Applied egg-rr79.9%
Taylor expanded in x around inf 80.5%
if 9.8000000000000006e-44 < y < 9.99999999999999944e71Initial program 79.4%
Taylor expanded in a around inf 42.2%
associate-/l*54.4%
+-commutative54.4%
associate-+r+54.4%
+-commutative54.4%
associate-+l+54.4%
Simplified54.4%
Final simplification74.9%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (- (+ z a) b)))
(if (<= y -4.4e-39)
t_1
(if (<= y 9.5e-83)
(/ (+ (* t a) (* z x)) (+ x t))
(if (or (<= y 3e-43) (not (<= y 9.5e+79)))
t_1
(* a (/ (+ y t) (+ y (+ x t)))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (z + a) - b;
double tmp;
if (y <= -4.4e-39) {
tmp = t_1;
} else if (y <= 9.5e-83) {
tmp = ((t * a) + (z * x)) / (x + t);
} else if ((y <= 3e-43) || !(y <= 9.5e+79)) {
tmp = t_1;
} else {
tmp = a * ((y + t) / (y + (x + t)));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = (z + a) - b
if (y <= (-4.4d-39)) then
tmp = t_1
else if (y <= 9.5d-83) then
tmp = ((t * a) + (z * x)) / (x + t)
else if ((y <= 3d-43) .or. (.not. (y <= 9.5d+79))) then
tmp = t_1
else
tmp = a * ((y + t) / (y + (x + t)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (z + a) - b;
double tmp;
if (y <= -4.4e-39) {
tmp = t_1;
} else if (y <= 9.5e-83) {
tmp = ((t * a) + (z * x)) / (x + t);
} else if ((y <= 3e-43) || !(y <= 9.5e+79)) {
tmp = t_1;
} else {
tmp = a * ((y + t) / (y + (x + t)));
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (z + a) - b tmp = 0 if y <= -4.4e-39: tmp = t_1 elif y <= 9.5e-83: tmp = ((t * a) + (z * x)) / (x + t) elif (y <= 3e-43) or not (y <= 9.5e+79): tmp = t_1 else: tmp = a * ((y + t) / (y + (x + t))) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(z + a) - b) tmp = 0.0 if (y <= -4.4e-39) tmp = t_1; elseif (y <= 9.5e-83) tmp = Float64(Float64(Float64(t * a) + Float64(z * x)) / Float64(x + t)); elseif ((y <= 3e-43) || !(y <= 9.5e+79)) tmp = t_1; else tmp = Float64(a * Float64(Float64(y + t) / Float64(y + Float64(x + t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (z + a) - b; tmp = 0.0; if (y <= -4.4e-39) tmp = t_1; elseif (y <= 9.5e-83) tmp = ((t * a) + (z * x)) / (x + t); elseif ((y <= 3e-43) || ~((y <= 9.5e+79))) tmp = t_1; else tmp = a * ((y + t) / (y + (x + t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision]}, If[LessEqual[y, -4.4e-39], t$95$1, If[LessEqual[y, 9.5e-83], N[(N[(N[(t * a), $MachinePrecision] + N[(z * x), $MachinePrecision]), $MachinePrecision] / N[(x + t), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[y, 3e-43], N[Not[LessEqual[y, 9.5e+79]], $MachinePrecision]], t$95$1, N[(a * N[(N[(y + t), $MachinePrecision] / N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(z + a\right) - b\\
\mathbf{if}\;y \leq -4.4 \cdot 10^{-39}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 9.5 \cdot 10^{-83}:\\
\;\;\;\;\frac{t \cdot a + z \cdot x}{x + t}\\
\mathbf{elif}\;y \leq 3 \cdot 10^{-43} \lor \neg \left(y \leq 9.5 \cdot 10^{+79}\right):\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;a \cdot \frac{y + t}{y + \left(x + t\right)}\\
\end{array}
\end{array}
if y < -4.40000000000000002e-39 or 9.50000000000000051e-83 < y < 3.00000000000000003e-43 or 9.49999999999999994e79 < y Initial program 45.2%
Taylor expanded in y around inf 78.3%
if -4.40000000000000002e-39 < y < 9.50000000000000051e-83Initial program 76.7%
Taylor expanded in y around 0 65.6%
if 3.00000000000000003e-43 < y < 9.49999999999999994e79Initial program 79.4%
Taylor expanded in a around inf 42.2%
associate-/l*54.4%
+-commutative54.4%
associate-+r+54.4%
+-commutative54.4%
associate-+l+54.4%
Simplified54.4%
Final simplification70.7%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -2.6e+55) (not (<= y 0.00021))) (- (+ z a) b) (* a (+ (/ t (+ x t)) (* x (/ (/ z a) (+ x t)))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -2.6e+55) || !(y <= 0.00021)) {
tmp = (z + a) - b;
} else {
tmp = a * ((t / (x + t)) + (x * ((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 ((y <= (-2.6d+55)) .or. (.not. (y <= 0.00021d0))) then
tmp = (z + a) - b
else
tmp = a * ((t / (x + t)) + (x * ((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 ((y <= -2.6e+55) || !(y <= 0.00021)) {
tmp = (z + a) - b;
} else {
tmp = a * ((t / (x + t)) + (x * ((z / a) / (x + t))));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -2.6e+55) or not (y <= 0.00021): tmp = (z + a) - b else: tmp = a * ((t / (x + t)) + (x * ((z / a) / (x + t)))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -2.6e+55) || !(y <= 0.00021)) tmp = Float64(Float64(z + a) - b); else tmp = Float64(a * Float64(Float64(t / Float64(x + t)) + Float64(x * Float64(Float64(z / a) / Float64(x + t))))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -2.6e+55) || ~((y <= 0.00021))) tmp = (z + a) - b; else tmp = a * ((t / (x + t)) + (x * ((z / a) / (x + t)))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -2.6e+55], N[Not[LessEqual[y, 0.00021]], $MachinePrecision]], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision], N[(a * N[(N[(t / N[(x + t), $MachinePrecision]), $MachinePrecision] + N[(x * N[(N[(z / a), $MachinePrecision] / N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.6 \cdot 10^{+55} \lor \neg \left(y \leq 0.00021\right):\\
\;\;\;\;\left(z + a\right) - b\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(\frac{t}{x + t} + x \cdot \frac{\frac{z}{a}}{x + t}\right)\\
\end{array}
\end{array}
if y < -2.6e55 or 2.1000000000000001e-4 < y Initial program 46.1%
Taylor expanded in y around inf 75.1%
if -2.6e55 < y < 2.1000000000000001e-4Initial program 74.1%
Taylor expanded in a around inf 82.4%
associate--l+82.4%
+-commutative82.4%
+-commutative82.4%
times-frac89.5%
+-commutative89.5%
+-commutative89.5%
associate-/l*88.9%
+-commutative88.9%
Simplified88.9%
Taylor expanded in y around 0 69.7%
associate-/l*73.8%
associate-/r*74.1%
Simplified74.1%
Final simplification74.6%
(FPCore (x y z t a b) :precision binary64 (if (or (<= t -0.0105) (not (<= t 490000.0))) (* a (/ (+ y t) (+ y (+ x t)))) (- (+ z a) b)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -0.0105) || !(t <= 490000.0)) {
tmp = a * ((y + t) / (y + (x + t)));
} else {
tmp = (z + a) - b;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((t <= (-0.0105d0)) .or. (.not. (t <= 490000.0d0))) then
tmp = a * ((y + t) / (y + (x + t)))
else
tmp = (z + a) - b
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -0.0105) || !(t <= 490000.0)) {
tmp = a * ((y + t) / (y + (x + t)));
} else {
tmp = (z + a) - b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (t <= -0.0105) or not (t <= 490000.0): tmp = a * ((y + t) / (y + (x + t))) else: tmp = (z + a) - b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((t <= -0.0105) || !(t <= 490000.0)) tmp = Float64(a * Float64(Float64(y + t) / Float64(y + Float64(x + t)))); else tmp = Float64(Float64(z + a) - b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((t <= -0.0105) || ~((t <= 490000.0))) tmp = a * ((y + t) / (y + (x + t))); else tmp = (z + a) - b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[t, -0.0105], N[Not[LessEqual[t, 490000.0]], $MachinePrecision]], N[(a * N[(N[(y + t), $MachinePrecision] / N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -0.0105 \lor \neg \left(t \leq 490000\right):\\
\;\;\;\;a \cdot \frac{y + t}{y + \left(x + t\right)}\\
\mathbf{else}:\\
\;\;\;\;\left(z + a\right) - b\\
\end{array}
\end{array}
if t < -0.0105000000000000007 or 4.9e5 < t Initial program 55.5%
Taylor expanded in a around inf 38.0%
associate-/l*65.3%
+-commutative65.3%
associate-+r+65.3%
+-commutative65.3%
associate-+l+65.3%
Simplified65.3%
if -0.0105000000000000007 < t < 4.9e5Initial program 67.5%
Taylor expanded in y around inf 68.1%
Final simplification66.7%
(FPCore (x y z t a b) :precision binary64 (if (<= t -5.4e+138) (+ a (* y (- (/ z t) (/ b t)))) (if (<= t 490000.0) (- (+ z a) b) (* a (/ (+ y t) (+ y (+ x t)))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -5.4e+138) {
tmp = a + (y * ((z / t) - (b / t)));
} else if (t <= 490000.0) {
tmp = (z + a) - b;
} else {
tmp = a * ((y + t) / (y + (x + t)));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (t <= (-5.4d+138)) then
tmp = a + (y * ((z / t) - (b / t)))
else if (t <= 490000.0d0) then
tmp = (z + a) - b
else
tmp = a * ((y + t) / (y + (x + t)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -5.4e+138) {
tmp = a + (y * ((z / t) - (b / t)));
} else if (t <= 490000.0) {
tmp = (z + a) - b;
} else {
tmp = a * ((y + t) / (y + (x + t)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if t <= -5.4e+138: tmp = a + (y * ((z / t) - (b / t))) elif t <= 490000.0: tmp = (z + a) - b else: tmp = a * ((y + t) / (y + (x + t))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (t <= -5.4e+138) tmp = Float64(a + Float64(y * Float64(Float64(z / t) - Float64(b / t)))); elseif (t <= 490000.0) tmp = Float64(Float64(z + a) - b); else tmp = Float64(a * Float64(Float64(y + t) / Float64(y + Float64(x + t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (t <= -5.4e+138) tmp = a + (y * ((z / t) - (b / t))); elseif (t <= 490000.0) tmp = (z + a) - b; else tmp = a * ((y + t) / (y + (x + t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -5.4e+138], N[(a + N[(y * N[(N[(z / t), $MachinePrecision] - N[(b / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 490000.0], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision], N[(a * N[(N[(y + t), $MachinePrecision] / N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -5.4 \cdot 10^{+138}:\\
\;\;\;\;a + y \cdot \left(\frac{z}{t} - \frac{b}{t}\right)\\
\mathbf{elif}\;t \leq 490000:\\
\;\;\;\;\left(z + a\right) - b\\
\mathbf{else}:\\
\;\;\;\;a \cdot \frac{y + t}{y + \left(x + t\right)}\\
\end{array}
\end{array}
if t < -5.40000000000000018e138Initial program 55.9%
Taylor expanded in x around 0 49.7%
Taylor expanded in y around 0 83.0%
if -5.40000000000000018e138 < t < 4.9e5Initial program 64.1%
Taylor expanded in y around inf 66.3%
if 4.9e5 < t Initial program 59.0%
Taylor expanded in a around inf 41.8%
associate-/l*66.5%
+-commutative66.5%
associate-+r+66.5%
+-commutative66.5%
associate-+l+66.5%
Simplified66.5%
Final simplification68.3%
(FPCore (x y z t a b) :precision binary64 (if (or (<= t -2.9e+139) (not (<= t 490000.0))) (* a (/ t (+ x t))) (- (+ z a) b)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -2.9e+139) || !(t <= 490000.0)) {
tmp = a * (t / (x + t));
} else {
tmp = (z + a) - b;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((t <= (-2.9d+139)) .or. (.not. (t <= 490000.0d0))) then
tmp = a * (t / (x + t))
else
tmp = (z + a) - b
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -2.9e+139) || !(t <= 490000.0)) {
tmp = a * (t / (x + t));
} else {
tmp = (z + a) - b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (t <= -2.9e+139) or not (t <= 490000.0): tmp = a * (t / (x + t)) else: tmp = (z + a) - b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((t <= -2.9e+139) || !(t <= 490000.0)) tmp = Float64(a * Float64(t / Float64(x + t))); else tmp = Float64(Float64(z + a) - b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((t <= -2.9e+139) || ~((t <= 490000.0))) tmp = a * (t / (x + t)); else tmp = (z + a) - b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[t, -2.9e+139], N[Not[LessEqual[t, 490000.0]], $MachinePrecision]], N[(a * N[(t / N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.9 \cdot 10^{+139} \lor \neg \left(t \leq 490000\right):\\
\;\;\;\;a \cdot \frac{t}{x + t}\\
\mathbf{else}:\\
\;\;\;\;\left(z + a\right) - b\\
\end{array}
\end{array}
if t < -2.8999999999999999e139 or 4.9e5 < t Initial program 58.1%
Taylor expanded in a around inf 38.9%
Taylor expanded in y around 0 40.5%
associate-/l*65.3%
Simplified65.3%
if -2.8999999999999999e139 < t < 4.9e5Initial program 64.1%
Taylor expanded in y around inf 66.3%
Final simplification65.9%
(FPCore (x y z t a b) :precision binary64 (if (<= t -2.9e+139) a (if (<= t 9e+147) (- (+ z a) b) a)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -2.9e+139) {
tmp = a;
} else if (t <= 9e+147) {
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.9d+139)) then
tmp = a
else if (t <= 9d+147) 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.9e+139) {
tmp = a;
} else if (t <= 9e+147) {
tmp = (z + a) - b;
} else {
tmp = a;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if t <= -2.9e+139: tmp = a elif t <= 9e+147: tmp = (z + a) - b else: tmp = a return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (t <= -2.9e+139) tmp = a; elseif (t <= 9e+147) 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.9e+139) tmp = a; elseif (t <= 9e+147) tmp = (z + a) - b; else tmp = a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -2.9e+139], a, If[LessEqual[t, 9e+147], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision], a]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.9 \cdot 10^{+139}:\\
\;\;\;\;a\\
\mathbf{elif}\;t \leq 9 \cdot 10^{+147}:\\
\;\;\;\;\left(z + a\right) - b\\
\mathbf{else}:\\
\;\;\;\;a\\
\end{array}
\end{array}
if t < -2.8999999999999999e139 or 9.00000000000000016e147 < t Initial program 57.0%
Taylor expanded in t around inf 66.5%
if -2.8999999999999999e139 < t < 9.00000000000000016e147Initial program 63.4%
Taylor expanded in y around inf 63.6%
Final simplification64.3%
(FPCore (x y z t a b) :precision binary64 (if (<= x -1.6e+52) z (if (<= x 5.2e-65) a z)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -1.6e+52) {
tmp = z;
} else if (x <= 5.2e-65) {
tmp = a;
} else {
tmp = z;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (x <= (-1.6d+52)) then
tmp = z
else if (x <= 5.2d-65) then
tmp = a
else
tmp = z
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -1.6e+52) {
tmp = z;
} else if (x <= 5.2e-65) {
tmp = a;
} else {
tmp = z;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= -1.6e+52: tmp = z elif x <= 5.2e-65: tmp = a else: tmp = z return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -1.6e+52) tmp = z; elseif (x <= 5.2e-65) tmp = a; else tmp = z; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (x <= -1.6e+52) tmp = z; elseif (x <= 5.2e-65) tmp = a; else tmp = z; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -1.6e+52], z, If[LessEqual[x, 5.2e-65], a, z]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.6 \cdot 10^{+52}:\\
\;\;\;\;z\\
\mathbf{elif}\;x \leq 5.2 \cdot 10^{-65}:\\
\;\;\;\;a\\
\mathbf{else}:\\
\;\;\;\;z\\
\end{array}
\end{array}
if x < -1.6e52 or 5.20000000000000019e-65 < x Initial program 51.9%
Taylor expanded in x around inf 47.8%
if -1.6e52 < x < 5.20000000000000019e-65Initial program 71.2%
Taylor expanded in t around inf 58.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 61.8%
Taylor expanded in t around inf 38.9%
(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 2024108
(FPCore (x y z t a b)
:name "AI.Clustering.Hierarchical.Internal:ward from clustering-0.2.1"
:precision binary64
:alt
(if (< (/ (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)) (+ (+ x t) y)) -3.5813117084150564e+153) (- (+ z a) b) (if (< (/ (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)) (+ (+ x t) y)) 1.2285964308315609e+82) (/ 1.0 (/ (+ (+ x t) y) (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)))) (- (+ z a) b)))
(/ (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)) (+ (+ x t) y)))