
(FPCore (x y z t a b) :precision binary64 (/ (+ x (/ (* y z) t)) (+ (+ a 1.0) (/ (* y b) t))))
double code(double x, double y, double z, double t, double a, double b) {
return (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t));
}
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)) / ((a + 1.0d0) + ((y * b) / t))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t));
}
def code(x, y, z, t, a, b): return (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t))
function code(x, y, z, t, a, b) return Float64(Float64(x + Float64(Float64(y * z) / t)) / Float64(Float64(a + 1.0) + Float64(Float64(y * b) / t))) end
function tmp = code(x, y, z, t, a, b) tmp = (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t)); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] / N[(N[(a + 1.0), $MachinePrecision] + N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 14 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b) :precision binary64 (/ (+ x (/ (* y z) t)) (+ (+ a 1.0) (/ (* y b) t))))
double code(double x, double y, double z, double t, double a, double b) {
return (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t));
}
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)) / ((a + 1.0d0) + ((y * b) / t))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t));
}
def code(x, y, z, t, a, b): return (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t))
function code(x, y, z, t, a, b) return Float64(Float64(x + Float64(Float64(y * z) / t)) / Float64(Float64(a + 1.0) + Float64(Float64(y * b) / t))) end
function tmp = code(x, y, z, t, a, b) tmp = (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t)); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] / N[(N[(a + 1.0), $MachinePrecision] + N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}}
\end{array}
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (* y b) t)) (t_2 (/ (+ x (/ (* y z) t)) (+ t_1 (+ a 1.0)))))
(if (<= t_2 (- INFINITY))
(/ (* y (/ z (+ 1.0 (+ a t_1)))) t)
(if (<= t_2 -5e-234)
t_2
(if (<= t_2 1e-184)
(/ (+ x (/ y (/ t z))) (+ a (+ 1.0 (/ b (/ t y)))))
(if (<= t_2 2e+287) t_2 (/ z b)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (y * b) / t;
double t_2 = (x + ((y * z) / t)) / (t_1 + (a + 1.0));
double tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = (y * (z / (1.0 + (a + t_1)))) / t;
} else if (t_2 <= -5e-234) {
tmp = t_2;
} else if (t_2 <= 1e-184) {
tmp = (x + (y / (t / z))) / (a + (1.0 + (b / (t / y))));
} else if (t_2 <= 2e+287) {
tmp = t_2;
} else {
tmp = z / b;
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (y * b) / t;
double t_2 = (x + ((y * z) / t)) / (t_1 + (a + 1.0));
double tmp;
if (t_2 <= -Double.POSITIVE_INFINITY) {
tmp = (y * (z / (1.0 + (a + t_1)))) / t;
} else if (t_2 <= -5e-234) {
tmp = t_2;
} else if (t_2 <= 1e-184) {
tmp = (x + (y / (t / z))) / (a + (1.0 + (b / (t / y))));
} else if (t_2 <= 2e+287) {
tmp = t_2;
} else {
tmp = z / b;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (y * b) / t t_2 = (x + ((y * z) / t)) / (t_1 + (a + 1.0)) tmp = 0 if t_2 <= -math.inf: tmp = (y * (z / (1.0 + (a + t_1)))) / t elif t_2 <= -5e-234: tmp = t_2 elif t_2 <= 1e-184: tmp = (x + (y / (t / z))) / (a + (1.0 + (b / (t / y)))) elif t_2 <= 2e+287: tmp = t_2 else: tmp = z / b return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(y * b) / t) t_2 = Float64(Float64(x + Float64(Float64(y * z) / t)) / Float64(t_1 + Float64(a + 1.0))) tmp = 0.0 if (t_2 <= Float64(-Inf)) tmp = Float64(Float64(y * Float64(z / Float64(1.0 + Float64(a + t_1)))) / t); elseif (t_2 <= -5e-234) tmp = t_2; elseif (t_2 <= 1e-184) tmp = Float64(Float64(x + Float64(y / Float64(t / z))) / Float64(a + Float64(1.0 + Float64(b / Float64(t / y))))); elseif (t_2 <= 2e+287) tmp = t_2; else tmp = Float64(z / b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (y * b) / t; t_2 = (x + ((y * z) / t)) / (t_1 + (a + 1.0)); tmp = 0.0; if (t_2 <= -Inf) tmp = (y * (z / (1.0 + (a + t_1)))) / t; elseif (t_2 <= -5e-234) tmp = t_2; elseif (t_2 <= 1e-184) tmp = (x + (y / (t / z))) / (a + (1.0 + (b / (t / y)))); elseif (t_2 <= 2e+287) tmp = t_2; else tmp = z / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] / N[(t$95$1 + N[(a + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], N[(N[(y * N[(z / N[(1.0 + N[(a + t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[t$95$2, -5e-234], t$95$2, If[LessEqual[t$95$2, 1e-184], N[(N[(x + N[(y / N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(a + N[(1.0 + N[(b / N[(t / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 2e+287], t$95$2, N[(z / b), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y \cdot b}{t}\\
t_2 := \frac{x + \frac{y \cdot z}{t}}{t_1 + \left(a + 1\right)}\\
\mathbf{if}\;t_2 \leq -\infty:\\
\;\;\;\;\frac{y \cdot \frac{z}{1 + \left(a + t_1\right)}}{t}\\
\mathbf{elif}\;t_2 \leq -5 \cdot 10^{-234}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t_2 \leq 10^{-184}:\\
\;\;\;\;\frac{x + \frac{y}{\frac{t}{z}}}{a + \left(1 + \frac{b}{\frac{t}{y}}\right)}\\
\mathbf{elif}\;t_2 \leq 2 \cdot 10^{+287}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{b}\\
\end{array}
\end{array}
if (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < -inf.0Initial program 33.3%
*-commutative33.3%
associate-*l/63.0%
associate-+l+63.0%
associate-*r/62.8%
*-commutative62.8%
Simplified62.8%
Taylor expanded in x around 0 62.1%
times-frac76.9%
associate-*r/68.9%
Simplified68.9%
associate-*r/76.9%
*-commutative76.9%
Applied egg-rr76.9%
associate-*l/84.5%
Applied egg-rr84.5%
if -inf.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < -4.99999999999999979e-234 or 1.0000000000000001e-184 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < 2.0000000000000002e287Initial program 99.7%
if -4.99999999999999979e-234 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < 1.0000000000000001e-184Initial program 68.2%
associate-/l*69.6%
associate-*l/81.7%
*-commutative81.7%
cancel-sign-sub81.7%
*-commutative81.7%
associate-*l/69.6%
associate-+r-69.6%
associate-*l/81.7%
*-commutative81.7%
cancel-sign-sub81.7%
*-commutative81.7%
associate-*l/69.6%
*-commutative69.6%
associate-/l*81.7%
Simplified81.7%
if 2.0000000000000002e287 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) Initial program 13.0%
*-commutative13.0%
associate-*l/15.9%
associate-+l+15.9%
associate-*r/24.1%
*-commutative24.1%
Simplified24.1%
Taylor expanded in t around 0 80.6%
Final simplification91.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (* y b) t)) (t_2 (/ (+ x (/ (* y z) t)) (+ t_1 (+ a 1.0)))))
(if (<= t_2 (- INFINITY))
(/ (* y (/ z (+ 1.0 (+ a t_1)))) t)
(if (<= t_2 -1e-222)
t_2
(if (<= t_2 2e+287)
(/ (+ x (* z (* y (/ 1.0 t)))) (+ a (+ 1.0 (/ b (/ t y)))))
(/ z b))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (y * b) / t;
double t_2 = (x + ((y * z) / t)) / (t_1 + (a + 1.0));
double tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = (y * (z / (1.0 + (a + t_1)))) / t;
} else if (t_2 <= -1e-222) {
tmp = t_2;
} else if (t_2 <= 2e+287) {
tmp = (x + (z * (y * (1.0 / t)))) / (a + (1.0 + (b / (t / y))));
} else {
tmp = z / b;
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (y * b) / t;
double t_2 = (x + ((y * z) / t)) / (t_1 + (a + 1.0));
double tmp;
if (t_2 <= -Double.POSITIVE_INFINITY) {
tmp = (y * (z / (1.0 + (a + t_1)))) / t;
} else if (t_2 <= -1e-222) {
tmp = t_2;
} else if (t_2 <= 2e+287) {
tmp = (x + (z * (y * (1.0 / t)))) / (a + (1.0 + (b / (t / y))));
} else {
tmp = z / b;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (y * b) / t t_2 = (x + ((y * z) / t)) / (t_1 + (a + 1.0)) tmp = 0 if t_2 <= -math.inf: tmp = (y * (z / (1.0 + (a + t_1)))) / t elif t_2 <= -1e-222: tmp = t_2 elif t_2 <= 2e+287: tmp = (x + (z * (y * (1.0 / t)))) / (a + (1.0 + (b / (t / y)))) else: tmp = z / b return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(y * b) / t) t_2 = Float64(Float64(x + Float64(Float64(y * z) / t)) / Float64(t_1 + Float64(a + 1.0))) tmp = 0.0 if (t_2 <= Float64(-Inf)) tmp = Float64(Float64(y * Float64(z / Float64(1.0 + Float64(a + t_1)))) / t); elseif (t_2 <= -1e-222) tmp = t_2; elseif (t_2 <= 2e+287) tmp = Float64(Float64(x + Float64(z * Float64(y * Float64(1.0 / t)))) / Float64(a + Float64(1.0 + Float64(b / Float64(t / y))))); else tmp = Float64(z / b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (y * b) / t; t_2 = (x + ((y * z) / t)) / (t_1 + (a + 1.0)); tmp = 0.0; if (t_2 <= -Inf) tmp = (y * (z / (1.0 + (a + t_1)))) / t; elseif (t_2 <= -1e-222) tmp = t_2; elseif (t_2 <= 2e+287) tmp = (x + (z * (y * (1.0 / t)))) / (a + (1.0 + (b / (t / y)))); else tmp = z / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] / N[(t$95$1 + N[(a + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], N[(N[(y * N[(z / N[(1.0 + N[(a + t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[t$95$2, -1e-222], t$95$2, If[LessEqual[t$95$2, 2e+287], N[(N[(x + N[(z * N[(y * N[(1.0 / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(a + N[(1.0 + N[(b / N[(t / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z / b), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y \cdot b}{t}\\
t_2 := \frac{x + \frac{y \cdot z}{t}}{t_1 + \left(a + 1\right)}\\
\mathbf{if}\;t_2 \leq -\infty:\\
\;\;\;\;\frac{y \cdot \frac{z}{1 + \left(a + t_1\right)}}{t}\\
\mathbf{elif}\;t_2 \leq -1 \cdot 10^{-222}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t_2 \leq 2 \cdot 10^{+287}:\\
\;\;\;\;\frac{x + z \cdot \left(y \cdot \frac{1}{t}\right)}{a + \left(1 + \frac{b}{\frac{t}{y}}\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{b}\\
\end{array}
\end{array}
if (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < -inf.0Initial program 33.3%
*-commutative33.3%
associate-*l/63.0%
associate-+l+63.0%
associate-*r/62.8%
*-commutative62.8%
Simplified62.8%
Taylor expanded in x around 0 62.1%
times-frac76.9%
associate-*r/68.9%
Simplified68.9%
associate-*r/76.9%
*-commutative76.9%
Applied egg-rr76.9%
associate-*l/84.5%
Applied egg-rr84.5%
if -inf.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < -1.00000000000000005e-222Initial program 99.8%
if -1.00000000000000005e-222 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < 2.0000000000000002e287Initial program 84.3%
associate-/l*80.7%
associate-*l/85.9%
*-commutative85.9%
cancel-sign-sub85.9%
*-commutative85.9%
associate-*l/80.7%
associate-+r-80.7%
associate-*l/85.9%
*-commutative85.9%
cancel-sign-sub85.9%
*-commutative85.9%
associate-*l/80.7%
*-commutative80.7%
associate-/l*85.9%
Simplified85.9%
associate-/l*89.5%
*-commutative89.5%
associate-*l/85.7%
div-inv85.7%
associate-*l*89.2%
Applied egg-rr89.2%
if 2.0000000000000002e287 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) Initial program 13.0%
*-commutative13.0%
associate-*l/15.9%
associate-+l+15.9%
associate-*r/24.1%
*-commutative24.1%
Simplified24.1%
Taylor expanded in t around 0 80.6%
Final simplification91.0%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (* y b) t)) (t_2 (/ (+ x (/ (* y z) t)) (+ t_1 (+ a 1.0)))))
(if (<= t_2 (- INFINITY))
(/ (* y (/ z (+ 1.0 (+ a t_1)))) t)
(if (<= t_2 2e+287)
(/ (+ x (* (* y z) (/ 1.0 t))) (+ a (+ 1.0 (/ b (/ t y)))))
(/ z b)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (y * b) / t;
double t_2 = (x + ((y * z) / t)) / (t_1 + (a + 1.0));
double tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = (y * (z / (1.0 + (a + t_1)))) / t;
} else if (t_2 <= 2e+287) {
tmp = (x + ((y * z) * (1.0 / t))) / (a + (1.0 + (b / (t / y))));
} else {
tmp = z / b;
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (y * b) / t;
double t_2 = (x + ((y * z) / t)) / (t_1 + (a + 1.0));
double tmp;
if (t_2 <= -Double.POSITIVE_INFINITY) {
tmp = (y * (z / (1.0 + (a + t_1)))) / t;
} else if (t_2 <= 2e+287) {
tmp = (x + ((y * z) * (1.0 / t))) / (a + (1.0 + (b / (t / y))));
} else {
tmp = z / b;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (y * b) / t t_2 = (x + ((y * z) / t)) / (t_1 + (a + 1.0)) tmp = 0 if t_2 <= -math.inf: tmp = (y * (z / (1.0 + (a + t_1)))) / t elif t_2 <= 2e+287: tmp = (x + ((y * z) * (1.0 / t))) / (a + (1.0 + (b / (t / y)))) else: tmp = z / b return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(y * b) / t) t_2 = Float64(Float64(x + Float64(Float64(y * z) / t)) / Float64(t_1 + Float64(a + 1.0))) tmp = 0.0 if (t_2 <= Float64(-Inf)) tmp = Float64(Float64(y * Float64(z / Float64(1.0 + Float64(a + t_1)))) / t); elseif (t_2 <= 2e+287) tmp = Float64(Float64(x + Float64(Float64(y * z) * Float64(1.0 / t))) / Float64(a + Float64(1.0 + Float64(b / Float64(t / y))))); else tmp = Float64(z / b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (y * b) / t; t_2 = (x + ((y * z) / t)) / (t_1 + (a + 1.0)); tmp = 0.0; if (t_2 <= -Inf) tmp = (y * (z / (1.0 + (a + t_1)))) / t; elseif (t_2 <= 2e+287) tmp = (x + ((y * z) * (1.0 / t))) / (a + (1.0 + (b / (t / y)))); else tmp = z / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] / N[(t$95$1 + N[(a + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], N[(N[(y * N[(z / N[(1.0 + N[(a + t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[t$95$2, 2e+287], N[(N[(x + N[(N[(y * z), $MachinePrecision] * N[(1.0 / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(a + N[(1.0 + N[(b / N[(t / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z / b), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y \cdot b}{t}\\
t_2 := \frac{x + \frac{y \cdot z}{t}}{t_1 + \left(a + 1\right)}\\
\mathbf{if}\;t_2 \leq -\infty:\\
\;\;\;\;\frac{y \cdot \frac{z}{1 + \left(a + t_1\right)}}{t}\\
\mathbf{elif}\;t_2 \leq 2 \cdot 10^{+287}:\\
\;\;\;\;\frac{x + \left(y \cdot z\right) \cdot \frac{1}{t}}{a + \left(1 + \frac{b}{\frac{t}{y}}\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{b}\\
\end{array}
\end{array}
if (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < -inf.0Initial program 33.3%
*-commutative33.3%
associate-*l/63.0%
associate-+l+63.0%
associate-*r/62.8%
*-commutative62.8%
Simplified62.8%
Taylor expanded in x around 0 62.1%
times-frac76.9%
associate-*r/68.9%
Simplified68.9%
associate-*r/76.9%
*-commutative76.9%
Applied egg-rr76.9%
associate-*l/84.5%
Applied egg-rr84.5%
if -inf.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < 2.0000000000000002e287Initial program 90.0%
associate-/l*85.9%
associate-*l/88.7%
*-commutative88.7%
cancel-sign-sub88.7%
*-commutative88.7%
associate-*l/85.9%
associate-+r-85.9%
associate-*l/88.7%
*-commutative88.7%
cancel-sign-sub88.7%
*-commutative88.7%
associate-*l/85.9%
*-commutative85.9%
associate-/l*88.7%
Simplified88.7%
associate-/l*92.8%
div-inv92.8%
*-commutative92.8%
Applied egg-rr92.8%
if 2.0000000000000002e287 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) Initial program 13.0%
*-commutative13.0%
associate-*l/15.9%
associate-+l+15.9%
associate-*r/24.1%
*-commutative24.1%
Simplified24.1%
Taylor expanded in t around 0 80.6%
Final simplification90.7%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (* y b) t))
(t_2 (/ (+ x (* y (/ z t))) (+ a (+ 1.0 (* y (/ b t)))))))
(if (<= t -2.75e-223)
t_2
(if (<= t 1.26e-232)
(/ z b)
(if (<= t 7.5e-205)
(/ (* y z) (* t (+ 1.0 (+ a t_1))))
(if (<= t 1.5e-191)
(/ z b)
(if (<= t 6e-127)
(/ (+ x (* (* y z) (/ 1.0 t))) (+ 1.0 t_1))
t_2)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (y * b) / t;
double t_2 = (x + (y * (z / t))) / (a + (1.0 + (y * (b / t))));
double tmp;
if (t <= -2.75e-223) {
tmp = t_2;
} else if (t <= 1.26e-232) {
tmp = z / b;
} else if (t <= 7.5e-205) {
tmp = (y * z) / (t * (1.0 + (a + t_1)));
} else if (t <= 1.5e-191) {
tmp = z / b;
} else if (t <= 6e-127) {
tmp = (x + ((y * z) * (1.0 / t))) / (1.0 + t_1);
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (y * b) / t
t_2 = (x + (y * (z / t))) / (a + (1.0d0 + (y * (b / t))))
if (t <= (-2.75d-223)) then
tmp = t_2
else if (t <= 1.26d-232) then
tmp = z / b
else if (t <= 7.5d-205) then
tmp = (y * z) / (t * (1.0d0 + (a + t_1)))
else if (t <= 1.5d-191) then
tmp = z / b
else if (t <= 6d-127) then
tmp = (x + ((y * z) * (1.0d0 / t))) / (1.0d0 + t_1)
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (y * b) / t;
double t_2 = (x + (y * (z / t))) / (a + (1.0 + (y * (b / t))));
double tmp;
if (t <= -2.75e-223) {
tmp = t_2;
} else if (t <= 1.26e-232) {
tmp = z / b;
} else if (t <= 7.5e-205) {
tmp = (y * z) / (t * (1.0 + (a + t_1)));
} else if (t <= 1.5e-191) {
tmp = z / b;
} else if (t <= 6e-127) {
tmp = (x + ((y * z) * (1.0 / t))) / (1.0 + t_1);
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (y * b) / t t_2 = (x + (y * (z / t))) / (a + (1.0 + (y * (b / t)))) tmp = 0 if t <= -2.75e-223: tmp = t_2 elif t <= 1.26e-232: tmp = z / b elif t <= 7.5e-205: tmp = (y * z) / (t * (1.0 + (a + t_1))) elif t <= 1.5e-191: tmp = z / b elif t <= 6e-127: tmp = (x + ((y * z) * (1.0 / t))) / (1.0 + t_1) else: tmp = t_2 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(y * b) / t) t_2 = Float64(Float64(x + Float64(y * Float64(z / t))) / Float64(a + Float64(1.0 + Float64(y * Float64(b / t))))) tmp = 0.0 if (t <= -2.75e-223) tmp = t_2; elseif (t <= 1.26e-232) tmp = Float64(z / b); elseif (t <= 7.5e-205) tmp = Float64(Float64(y * z) / Float64(t * Float64(1.0 + Float64(a + t_1)))); elseif (t <= 1.5e-191) tmp = Float64(z / b); elseif (t <= 6e-127) tmp = Float64(Float64(x + Float64(Float64(y * z) * Float64(1.0 / t))) / Float64(1.0 + t_1)); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (y * b) / t; t_2 = (x + (y * (z / t))) / (a + (1.0 + (y * (b / t)))); tmp = 0.0; if (t <= -2.75e-223) tmp = t_2; elseif (t <= 1.26e-232) tmp = z / b; elseif (t <= 7.5e-205) tmp = (y * z) / (t * (1.0 + (a + t_1))); elseif (t <= 1.5e-191) tmp = z / b; elseif (t <= 6e-127) tmp = (x + ((y * z) * (1.0 / t))) / (1.0 + t_1); else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x + N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(a + N[(1.0 + N[(y * N[(b / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -2.75e-223], t$95$2, If[LessEqual[t, 1.26e-232], N[(z / b), $MachinePrecision], If[LessEqual[t, 7.5e-205], N[(N[(y * z), $MachinePrecision] / N[(t * N[(1.0 + N[(a + t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.5e-191], N[(z / b), $MachinePrecision], If[LessEqual[t, 6e-127], N[(N[(x + N[(N[(y * z), $MachinePrecision] * N[(1.0 / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(1.0 + t$95$1), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y \cdot b}{t}\\
t_2 := \frac{x + y \cdot \frac{z}{t}}{a + \left(1 + y \cdot \frac{b}{t}\right)}\\
\mathbf{if}\;t \leq -2.75 \cdot 10^{-223}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t \leq 1.26 \cdot 10^{-232}:\\
\;\;\;\;\frac{z}{b}\\
\mathbf{elif}\;t \leq 7.5 \cdot 10^{-205}:\\
\;\;\;\;\frac{y \cdot z}{t \cdot \left(1 + \left(a + t_1\right)\right)}\\
\mathbf{elif}\;t \leq 1.5 \cdot 10^{-191}:\\
\;\;\;\;\frac{z}{b}\\
\mathbf{elif}\;t \leq 6 \cdot 10^{-127}:\\
\;\;\;\;\frac{x + \left(y \cdot z\right) \cdot \frac{1}{t}}{1 + t_1}\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if t < -2.75e-223 or 6.00000000000000017e-127 < t Initial program 83.4%
*-commutative83.4%
associate-*l/84.4%
associate-+l+84.4%
associate-*r/89.5%
*-commutative89.5%
Simplified89.5%
if -2.75e-223 < t < 1.25999999999999991e-232 or 7.4999999999999996e-205 < t < 1.5e-191Initial program 33.4%
*-commutative33.4%
associate-*l/24.8%
associate-+l+24.9%
associate-*r/24.5%
*-commutative24.5%
Simplified24.5%
Taylor expanded in t around 0 88.9%
if 1.25999999999999991e-232 < t < 7.4999999999999996e-205Initial program 64.0%
*-commutative64.0%
associate-*l/52.1%
associate-+l+52.1%
associate-*r/51.5%
*-commutative51.5%
Simplified51.5%
Taylor expanded in x around 0 87.2%
if 1.5e-191 < t < 6.00000000000000017e-127Initial program 99.6%
associate-/l*75.0%
associate-*l/74.8%
*-commutative74.8%
cancel-sign-sub74.8%
*-commutative74.8%
associate-*l/75.0%
associate-+r-75.0%
associate-*l/74.8%
*-commutative74.8%
cancel-sign-sub74.8%
*-commutative74.8%
associate-*l/75.0%
*-commutative75.0%
associate-/l*75.0%
Simplified75.0%
associate-/l*100.0%
div-inv99.8%
*-commutative99.8%
Applied egg-rr99.8%
Taylor expanded in a around 0 85.7%
Final simplification89.3%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ x (/ (* y z) t))))
(if (<= a -1.25e+190)
(/ t_1 a)
(if (<= a -3.8e+112)
(/ z b)
(if (<= a -3.5e-9)
(/ t_1 (+ a 1.0))
(if (<= a 3.1e-8)
(/ (+ x (* (* y z) (/ 1.0 t))) (+ 1.0 (/ (* y b) t)))
(/ (+ x (* y (/ z t))) (+ a 1.0))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x + ((y * z) / t);
double tmp;
if (a <= -1.25e+190) {
tmp = t_1 / a;
} else if (a <= -3.8e+112) {
tmp = z / b;
} else if (a <= -3.5e-9) {
tmp = t_1 / (a + 1.0);
} else if (a <= 3.1e-8) {
tmp = (x + ((y * z) * (1.0 / t))) / (1.0 + ((y * b) / t));
} else {
tmp = (x + (y * (z / t))) / (a + 1.0);
}
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) / t)
if (a <= (-1.25d+190)) then
tmp = t_1 / a
else if (a <= (-3.8d+112)) then
tmp = z / b
else if (a <= (-3.5d-9)) then
tmp = t_1 / (a + 1.0d0)
else if (a <= 3.1d-8) then
tmp = (x + ((y * z) * (1.0d0 / t))) / (1.0d0 + ((y * b) / t))
else
tmp = (x + (y * (z / t))) / (a + 1.0d0)
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) / t);
double tmp;
if (a <= -1.25e+190) {
tmp = t_1 / a;
} else if (a <= -3.8e+112) {
tmp = z / b;
} else if (a <= -3.5e-9) {
tmp = t_1 / (a + 1.0);
} else if (a <= 3.1e-8) {
tmp = (x + ((y * z) * (1.0 / t))) / (1.0 + ((y * b) / t));
} else {
tmp = (x + (y * (z / t))) / (a + 1.0);
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x + ((y * z) / t) tmp = 0 if a <= -1.25e+190: tmp = t_1 / a elif a <= -3.8e+112: tmp = z / b elif a <= -3.5e-9: tmp = t_1 / (a + 1.0) elif a <= 3.1e-8: tmp = (x + ((y * z) * (1.0 / t))) / (1.0 + ((y * b) / t)) else: tmp = (x + (y * (z / t))) / (a + 1.0) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x + Float64(Float64(y * z) / t)) tmp = 0.0 if (a <= -1.25e+190) tmp = Float64(t_1 / a); elseif (a <= -3.8e+112) tmp = Float64(z / b); elseif (a <= -3.5e-9) tmp = Float64(t_1 / Float64(a + 1.0)); elseif (a <= 3.1e-8) tmp = Float64(Float64(x + Float64(Float64(y * z) * Float64(1.0 / t))) / Float64(1.0 + Float64(Float64(y * b) / t))); else tmp = Float64(Float64(x + Float64(y * Float64(z / t))) / Float64(a + 1.0)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x + ((y * z) / t); tmp = 0.0; if (a <= -1.25e+190) tmp = t_1 / a; elseif (a <= -3.8e+112) tmp = z / b; elseif (a <= -3.5e-9) tmp = t_1 / (a + 1.0); elseif (a <= 3.1e-8) tmp = (x + ((y * z) * (1.0 / t))) / (1.0 + ((y * b) / t)); else tmp = (x + (y * (z / t))) / (a + 1.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -1.25e+190], N[(t$95$1 / a), $MachinePrecision], If[LessEqual[a, -3.8e+112], N[(z / b), $MachinePrecision], If[LessEqual[a, -3.5e-9], N[(t$95$1 / N[(a + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 3.1e-8], N[(N[(x + N[(N[(y * z), $MachinePrecision] * N[(1.0 / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(1.0 + N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x + N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(a + 1.0), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \frac{y \cdot z}{t}\\
\mathbf{if}\;a \leq -1.25 \cdot 10^{+190}:\\
\;\;\;\;\frac{t_1}{a}\\
\mathbf{elif}\;a \leq -3.8 \cdot 10^{+112}:\\
\;\;\;\;\frac{z}{b}\\
\mathbf{elif}\;a \leq -3.5 \cdot 10^{-9}:\\
\;\;\;\;\frac{t_1}{a + 1}\\
\mathbf{elif}\;a \leq 3.1 \cdot 10^{-8}:\\
\;\;\;\;\frac{x + \left(y \cdot z\right) \cdot \frac{1}{t}}{1 + \frac{y \cdot b}{t}}\\
\mathbf{else}:\\
\;\;\;\;\frac{x + y \cdot \frac{z}{t}}{a + 1}\\
\end{array}
\end{array}
if a < -1.25000000000000009e190Initial program 78.3%
*-commutative78.3%
associate-*l/74.2%
associate-+l+74.2%
associate-*r/78.3%
*-commutative78.3%
Simplified78.3%
Taylor expanded in a around inf 75.7%
if -1.25000000000000009e190 < a < -3.80000000000000008e112Initial program 56.3%
*-commutative56.3%
associate-*l/51.3%
associate-+l+51.3%
associate-*r/55.6%
*-commutative55.6%
Simplified55.6%
Taylor expanded in t around 0 66.3%
if -3.80000000000000008e112 < a < -3.4999999999999999e-9Initial program 86.7%
*-commutative86.7%
associate-*l/86.7%
associate-+l+86.7%
associate-*r/86.7%
*-commutative86.7%
Simplified86.7%
Taylor expanded in b around 0 75.4%
if -3.4999999999999999e-9 < a < 3.1e-8Initial program 80.8%
associate-/l*79.3%
associate-*l/84.4%
*-commutative84.4%
cancel-sign-sub84.4%
*-commutative84.4%
associate-*l/79.3%
associate-+r-79.3%
associate-*l/84.4%
*-commutative84.4%
cancel-sign-sub84.4%
*-commutative84.4%
associate-*l/79.3%
*-commutative79.3%
associate-/l*84.4%
Simplified84.4%
associate-/l*85.1%
div-inv85.1%
*-commutative85.1%
Applied egg-rr85.1%
Taylor expanded in a around 0 80.7%
if 3.1e-8 < a Initial program 69.9%
*-commutative69.9%
associate-*l/70.0%
associate-+l+70.0%
associate-*r/73.3%
*-commutative73.3%
Simplified73.3%
Taylor expanded in b around 0 63.9%
Final simplification74.8%
(FPCore (x y z t a b)
:precision binary64
(if (<= t -7.5e-134)
(/ (+ x (/ (* y z) t)) (+ a 1.0))
(if (<= t 5e-233)
(/ z b)
(if (<= t 3.5e-171)
(/ (* y z) (* t (+ 1.0 (+ a (/ (* y b) t)))))
(/ (+ x (* y (/ z t))) (+ a 1.0))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -7.5e-134) {
tmp = (x + ((y * z) / t)) / (a + 1.0);
} else if (t <= 5e-233) {
tmp = z / b;
} else if (t <= 3.5e-171) {
tmp = (y * z) / (t * (1.0 + (a + ((y * b) / t))));
} else {
tmp = (x + (y * (z / t))) / (a + 1.0);
}
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 <= (-7.5d-134)) then
tmp = (x + ((y * z) / t)) / (a + 1.0d0)
else if (t <= 5d-233) then
tmp = z / b
else if (t <= 3.5d-171) then
tmp = (y * z) / (t * (1.0d0 + (a + ((y * b) / t))))
else
tmp = (x + (y * (z / t))) / (a + 1.0d0)
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 <= -7.5e-134) {
tmp = (x + ((y * z) / t)) / (a + 1.0);
} else if (t <= 5e-233) {
tmp = z / b;
} else if (t <= 3.5e-171) {
tmp = (y * z) / (t * (1.0 + (a + ((y * b) / t))));
} else {
tmp = (x + (y * (z / t))) / (a + 1.0);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if t <= -7.5e-134: tmp = (x + ((y * z) / t)) / (a + 1.0) elif t <= 5e-233: tmp = z / b elif t <= 3.5e-171: tmp = (y * z) / (t * (1.0 + (a + ((y * b) / t)))) else: tmp = (x + (y * (z / t))) / (a + 1.0) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (t <= -7.5e-134) tmp = Float64(Float64(x + Float64(Float64(y * z) / t)) / Float64(a + 1.0)); elseif (t <= 5e-233) tmp = Float64(z / b); elseif (t <= 3.5e-171) tmp = Float64(Float64(y * z) / Float64(t * Float64(1.0 + Float64(a + Float64(Float64(y * b) / t))))); else tmp = Float64(Float64(x + Float64(y * Float64(z / t))) / Float64(a + 1.0)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (t <= -7.5e-134) tmp = (x + ((y * z) / t)) / (a + 1.0); elseif (t <= 5e-233) tmp = z / b; elseif (t <= 3.5e-171) tmp = (y * z) / (t * (1.0 + (a + ((y * b) / t)))); else tmp = (x + (y * (z / t))) / (a + 1.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -7.5e-134], N[(N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] / N[(a + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 5e-233], N[(z / b), $MachinePrecision], If[LessEqual[t, 3.5e-171], N[(N[(y * z), $MachinePrecision] / N[(t * N[(1.0 + N[(a + N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x + N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(a + 1.0), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -7.5 \cdot 10^{-134}:\\
\;\;\;\;\frac{x + \frac{y \cdot z}{t}}{a + 1}\\
\mathbf{elif}\;t \leq 5 \cdot 10^{-233}:\\
\;\;\;\;\frac{z}{b}\\
\mathbf{elif}\;t \leq 3.5 \cdot 10^{-171}:\\
\;\;\;\;\frac{y \cdot z}{t \cdot \left(1 + \left(a + \frac{y \cdot b}{t}\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{x + y \cdot \frac{z}{t}}{a + 1}\\
\end{array}
\end{array}
if t < -7.50000000000000048e-134Initial program 84.9%
*-commutative84.9%
associate-*l/82.6%
associate-+l+82.6%
associate-*r/88.3%
*-commutative88.3%
Simplified88.3%
Taylor expanded in b around 0 73.7%
if -7.50000000000000048e-134 < t < 5.00000000000000012e-233Initial program 46.9%
*-commutative46.9%
associate-*l/41.0%
associate-+l+41.0%
associate-*r/40.7%
*-commutative40.7%
Simplified40.7%
Taylor expanded in t around 0 69.8%
if 5.00000000000000012e-233 < t < 3.49999999999999994e-171Initial program 65.3%
*-commutative65.3%
associate-*l/44.8%
associate-+l+44.8%
associate-*r/44.3%
*-commutative44.3%
Simplified44.3%
Taylor expanded in x around 0 78.6%
if 3.49999999999999994e-171 < t Initial program 85.4%
*-commutative85.4%
associate-*l/89.1%
associate-+l+89.1%
associate-*r/94.5%
*-commutative94.5%
Simplified94.5%
Taylor expanded in b around 0 75.3%
Final simplification73.9%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ x (+ 1.0 (+ a (* b (/ y t)))))))
(if (<= t -3.4e-46)
t_1
(if (<= t -1.25e-132)
(/ (/ y (/ (+ a 1.0) z)) t)
(if (<= t -1.8e-133) x (if (<= t 3.9e-172) (/ z b) t_1))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x / (1.0 + (a + (b * (y / t))));
double tmp;
if (t <= -3.4e-46) {
tmp = t_1;
} else if (t <= -1.25e-132) {
tmp = (y / ((a + 1.0) / z)) / t;
} else if (t <= -1.8e-133) {
tmp = x;
} else if (t <= 3.9e-172) {
tmp = z / b;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = x / (1.0d0 + (a + (b * (y / t))))
if (t <= (-3.4d-46)) then
tmp = t_1
else if (t <= (-1.25d-132)) then
tmp = (y / ((a + 1.0d0) / z)) / t
else if (t <= (-1.8d-133)) then
tmp = x
else if (t <= 3.9d-172) then
tmp = z / b
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 = x / (1.0 + (a + (b * (y / t))));
double tmp;
if (t <= -3.4e-46) {
tmp = t_1;
} else if (t <= -1.25e-132) {
tmp = (y / ((a + 1.0) / z)) / t;
} else if (t <= -1.8e-133) {
tmp = x;
} else if (t <= 3.9e-172) {
tmp = z / b;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x / (1.0 + (a + (b * (y / t)))) tmp = 0 if t <= -3.4e-46: tmp = t_1 elif t <= -1.25e-132: tmp = (y / ((a + 1.0) / z)) / t elif t <= -1.8e-133: tmp = x elif t <= 3.9e-172: tmp = z / b else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x / Float64(1.0 + Float64(a + Float64(b * Float64(y / t))))) tmp = 0.0 if (t <= -3.4e-46) tmp = t_1; elseif (t <= -1.25e-132) tmp = Float64(Float64(y / Float64(Float64(a + 1.0) / z)) / t); elseif (t <= -1.8e-133) tmp = x; elseif (t <= 3.9e-172) tmp = Float64(z / b); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x / (1.0 + (a + (b * (y / t)))); tmp = 0.0; if (t <= -3.4e-46) tmp = t_1; elseif (t <= -1.25e-132) tmp = (y / ((a + 1.0) / z)) / t; elseif (t <= -1.8e-133) tmp = x; elseif (t <= 3.9e-172) tmp = z / b; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x / N[(1.0 + N[(a + N[(b * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -3.4e-46], t$95$1, If[LessEqual[t, -1.25e-132], N[(N[(y / N[(N[(a + 1.0), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[t, -1.8e-133], x, If[LessEqual[t, 3.9e-172], N[(z / b), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{1 + \left(a + b \cdot \frac{y}{t}\right)}\\
\mathbf{if}\;t \leq -3.4 \cdot 10^{-46}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq -1.25 \cdot 10^{-132}:\\
\;\;\;\;\frac{\frac{y}{\frac{a + 1}{z}}}{t}\\
\mathbf{elif}\;t \leq -1.8 \cdot 10^{-133}:\\
\;\;\;\;x\\
\mathbf{elif}\;t \leq 3.9 \cdot 10^{-172}:\\
\;\;\;\;\frac{z}{b}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if t < -3.39999999999999996e-46 or 3.89999999999999973e-172 < t Initial program 85.3%
*-commutative85.3%
associate-*l/88.1%
associate-+l+88.1%
associate-*r/94.3%
*-commutative94.3%
Simplified94.3%
Taylor expanded in x around inf 69.1%
associate-*r/72.5%
Simplified72.5%
if -3.39999999999999996e-46 < t < -1.25e-132Initial program 83.6%
*-commutative83.6%
associate-*l/67.7%
associate-+l+67.7%
associate-*r/67.6%
*-commutative67.6%
Simplified67.6%
Taylor expanded in x around 0 68.1%
times-frac62.7%
associate-*r/62.3%
Simplified62.3%
Taylor expanded in y around 0 50.4%
*-commutative50.4%
associate-/r*50.3%
associate-/l*55.5%
Simplified55.5%
if -1.25e-132 < t < -1.8000000000000002e-133Initial program 100.0%
*-commutative100.0%
associate-*l/100.0%
associate-+l+100.0%
associate-*r/100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in t around inf 100.0%
Taylor expanded in a around 0 100.0%
if -1.8000000000000002e-133 < t < 3.89999999999999973e-172Initial program 50.9%
*-commutative50.9%
associate-*l/41.8%
associate-+l+41.8%
associate-*r/41.5%
*-commutative41.5%
Simplified41.5%
Taylor expanded in t around 0 64.4%
Final simplification69.4%
(FPCore (x y z t a b)
:precision binary64
(if (<= a -1.25e+190)
(/ x a)
(if (<= a -2.5e+111)
(/ z b)
(if (<= a -1.32e+17)
(/ x a)
(if (<= a -1.05e-141)
(/ z b)
(if (<= a 2.3e-18) x (if (<= a 1.75e+86) (/ z b) (/ x a))))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -1.25e+190) {
tmp = x / a;
} else if (a <= -2.5e+111) {
tmp = z / b;
} else if (a <= -1.32e+17) {
tmp = x / a;
} else if (a <= -1.05e-141) {
tmp = z / b;
} else if (a <= 2.3e-18) {
tmp = x;
} else if (a <= 1.75e+86) {
tmp = z / b;
} else {
tmp = x / 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 <= (-1.25d+190)) then
tmp = x / a
else if (a <= (-2.5d+111)) then
tmp = z / b
else if (a <= (-1.32d+17)) then
tmp = x / a
else if (a <= (-1.05d-141)) then
tmp = z / b
else if (a <= 2.3d-18) then
tmp = x
else if (a <= 1.75d+86) then
tmp = z / b
else
tmp = x / 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 <= -1.25e+190) {
tmp = x / a;
} else if (a <= -2.5e+111) {
tmp = z / b;
} else if (a <= -1.32e+17) {
tmp = x / a;
} else if (a <= -1.05e-141) {
tmp = z / b;
} else if (a <= 2.3e-18) {
tmp = x;
} else if (a <= 1.75e+86) {
tmp = z / b;
} else {
tmp = x / a;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if a <= -1.25e+190: tmp = x / a elif a <= -2.5e+111: tmp = z / b elif a <= -1.32e+17: tmp = x / a elif a <= -1.05e-141: tmp = z / b elif a <= 2.3e-18: tmp = x elif a <= 1.75e+86: tmp = z / b else: tmp = x / a return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (a <= -1.25e+190) tmp = Float64(x / a); elseif (a <= -2.5e+111) tmp = Float64(z / b); elseif (a <= -1.32e+17) tmp = Float64(x / a); elseif (a <= -1.05e-141) tmp = Float64(z / b); elseif (a <= 2.3e-18) tmp = x; elseif (a <= 1.75e+86) tmp = Float64(z / b); else tmp = Float64(x / a); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (a <= -1.25e+190) tmp = x / a; elseif (a <= -2.5e+111) tmp = z / b; elseif (a <= -1.32e+17) tmp = x / a; elseif (a <= -1.05e-141) tmp = z / b; elseif (a <= 2.3e-18) tmp = x; elseif (a <= 1.75e+86) tmp = z / b; else tmp = x / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, -1.25e+190], N[(x / a), $MachinePrecision], If[LessEqual[a, -2.5e+111], N[(z / b), $MachinePrecision], If[LessEqual[a, -1.32e+17], N[(x / a), $MachinePrecision], If[LessEqual[a, -1.05e-141], N[(z / b), $MachinePrecision], If[LessEqual[a, 2.3e-18], x, If[LessEqual[a, 1.75e+86], N[(z / b), $MachinePrecision], N[(x / a), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.25 \cdot 10^{+190}:\\
\;\;\;\;\frac{x}{a}\\
\mathbf{elif}\;a \leq -2.5 \cdot 10^{+111}:\\
\;\;\;\;\frac{z}{b}\\
\mathbf{elif}\;a \leq -1.32 \cdot 10^{+17}:\\
\;\;\;\;\frac{x}{a}\\
\mathbf{elif}\;a \leq -1.05 \cdot 10^{-141}:\\
\;\;\;\;\frac{z}{b}\\
\mathbf{elif}\;a \leq 2.3 \cdot 10^{-18}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 1.75 \cdot 10^{+86}:\\
\;\;\;\;\frac{z}{b}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{a}\\
\end{array}
\end{array}
if a < -1.25000000000000009e190 or -2.4999999999999998e111 < a < -1.32e17 or 1.75000000000000009e86 < a Initial program 77.0%
*-commutative77.0%
associate-*l/75.9%
associate-+l+75.9%
associate-*r/79.3%
*-commutative79.3%
Simplified79.3%
Taylor expanded in x around inf 57.5%
associate-*r/58.8%
Simplified58.8%
Taylor expanded in a around inf 56.5%
if -1.25000000000000009e190 < a < -2.4999999999999998e111 or -1.32e17 < a < -1.05e-141 or 2.3000000000000001e-18 < a < 1.75000000000000009e86Initial program 63.5%
*-commutative63.5%
associate-*l/60.8%
associate-+l+60.9%
associate-*r/67.4%
*-commutative67.4%
Simplified67.4%
Taylor expanded in t around 0 51.8%
if -1.05e-141 < a < 2.3000000000000001e-18Initial program 86.0%
*-commutative86.0%
associate-*l/85.1%
associate-+l+85.1%
associate-*r/88.0%
*-commutative88.0%
Simplified88.0%
Taylor expanded in t around inf 53.0%
Taylor expanded in a around 0 53.0%
Final simplification53.9%
(FPCore (x y z t a b) :precision binary64 (if (or (<= t -1.35e-133) (not (<= t 7.7e-171))) (/ (+ x (* y (/ z t))) (+ a 1.0)) (/ z b)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -1.35e-133) || !(t <= 7.7e-171)) {
tmp = (x + (y * (z / t))) / (a + 1.0);
} else {
tmp = z / b;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((t <= (-1.35d-133)) .or. (.not. (t <= 7.7d-171))) then
tmp = (x + (y * (z / t))) / (a + 1.0d0)
else
tmp = z / b
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -1.35e-133) || !(t <= 7.7e-171)) {
tmp = (x + (y * (z / t))) / (a + 1.0);
} else {
tmp = z / b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (t <= -1.35e-133) or not (t <= 7.7e-171): tmp = (x + (y * (z / t))) / (a + 1.0) else: tmp = z / b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((t <= -1.35e-133) || !(t <= 7.7e-171)) tmp = Float64(Float64(x + Float64(y * Float64(z / t))) / Float64(a + 1.0)); else tmp = Float64(z / b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((t <= -1.35e-133) || ~((t <= 7.7e-171))) tmp = (x + (y * (z / t))) / (a + 1.0); else tmp = z / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[t, -1.35e-133], N[Not[LessEqual[t, 7.7e-171]], $MachinePrecision]], N[(N[(x + N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(a + 1.0), $MachinePrecision]), $MachinePrecision], N[(z / b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.35 \cdot 10^{-133} \lor \neg \left(t \leq 7.7 \cdot 10^{-171}\right):\\
\;\;\;\;\frac{x + y \cdot \frac{z}{t}}{a + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{b}\\
\end{array}
\end{array}
if t < -1.3499999999999999e-133 or 7.6999999999999996e-171 < t Initial program 85.2%
*-commutative85.2%
associate-*l/86.3%
associate-+l+86.3%
associate-*r/91.8%
*-commutative91.8%
Simplified91.8%
Taylor expanded in b around 0 73.7%
if -1.3499999999999999e-133 < t < 7.6999999999999996e-171Initial program 50.9%
*-commutative50.9%
associate-*l/41.8%
associate-+l+41.8%
associate-*r/41.5%
*-commutative41.5%
Simplified41.5%
Taylor expanded in t around 0 64.4%
Final simplification71.4%
(FPCore (x y z t a b) :precision binary64 (if (<= t -1.1e-133) (/ (+ x (/ (* y z) t)) (+ a 1.0)) (if (<= t 7.7e-171) (/ z b) (/ (+ x (* y (/ z t))) (+ a 1.0)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -1.1e-133) {
tmp = (x + ((y * z) / t)) / (a + 1.0);
} else if (t <= 7.7e-171) {
tmp = z / b;
} else {
tmp = (x + (y * (z / t))) / (a + 1.0);
}
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-133)) then
tmp = (x + ((y * z) / t)) / (a + 1.0d0)
else if (t <= 7.7d-171) then
tmp = z / b
else
tmp = (x + (y * (z / t))) / (a + 1.0d0)
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-133) {
tmp = (x + ((y * z) / t)) / (a + 1.0);
} else if (t <= 7.7e-171) {
tmp = z / b;
} else {
tmp = (x + (y * (z / t))) / (a + 1.0);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if t <= -1.1e-133: tmp = (x + ((y * z) / t)) / (a + 1.0) elif t <= 7.7e-171: tmp = z / b else: tmp = (x + (y * (z / t))) / (a + 1.0) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (t <= -1.1e-133) tmp = Float64(Float64(x + Float64(Float64(y * z) / t)) / Float64(a + 1.0)); elseif (t <= 7.7e-171) tmp = Float64(z / b); else tmp = Float64(Float64(x + Float64(y * Float64(z / t))) / Float64(a + 1.0)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (t <= -1.1e-133) tmp = (x + ((y * z) / t)) / (a + 1.0); elseif (t <= 7.7e-171) tmp = z / b; else tmp = (x + (y * (z / t))) / (a + 1.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -1.1e-133], N[(N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] / N[(a + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 7.7e-171], N[(z / b), $MachinePrecision], N[(N[(x + N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(a + 1.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.1 \cdot 10^{-133}:\\
\;\;\;\;\frac{x + \frac{y \cdot z}{t}}{a + 1}\\
\mathbf{elif}\;t \leq 7.7 \cdot 10^{-171}:\\
\;\;\;\;\frac{z}{b}\\
\mathbf{else}:\\
\;\;\;\;\frac{x + y \cdot \frac{z}{t}}{a + 1}\\
\end{array}
\end{array}
if t < -1.1e-133Initial program 84.9%
*-commutative84.9%
associate-*l/82.6%
associate-+l+82.6%
associate-*r/88.3%
*-commutative88.3%
Simplified88.3%
Taylor expanded in b around 0 73.7%
if -1.1e-133 < t < 7.6999999999999996e-171Initial program 50.9%
*-commutative50.9%
associate-*l/41.8%
associate-+l+41.8%
associate-*r/41.5%
*-commutative41.5%
Simplified41.5%
Taylor expanded in t around 0 64.4%
if 7.6999999999999996e-171 < t Initial program 85.4%
*-commutative85.4%
associate-*l/89.1%
associate-+l+89.1%
associate-*r/94.5%
*-commutative94.5%
Simplified94.5%
Taylor expanded in b around 0 75.3%
Final simplification72.0%
(FPCore (x y z t a b)
:precision binary64
(if (<= a -1.65e+192)
(/ x a)
(if (<= a -3.1e+112)
(/ z b)
(if (<= a -1.0)
(/ x a)
(if (<= a 2.4e-18)
(- x (* x a))
(if (<= a 1.9e+85) (/ z b) (/ x a)))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -1.65e+192) {
tmp = x / a;
} else if (a <= -3.1e+112) {
tmp = z / b;
} else if (a <= -1.0) {
tmp = x / a;
} else if (a <= 2.4e-18) {
tmp = x - (x * a);
} else if (a <= 1.9e+85) {
tmp = z / b;
} else {
tmp = x / 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 <= (-1.65d+192)) then
tmp = x / a
else if (a <= (-3.1d+112)) then
tmp = z / b
else if (a <= (-1.0d0)) then
tmp = x / a
else if (a <= 2.4d-18) then
tmp = x - (x * a)
else if (a <= 1.9d+85) then
tmp = z / b
else
tmp = x / 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 <= -1.65e+192) {
tmp = x / a;
} else if (a <= -3.1e+112) {
tmp = z / b;
} else if (a <= -1.0) {
tmp = x / a;
} else if (a <= 2.4e-18) {
tmp = x - (x * a);
} else if (a <= 1.9e+85) {
tmp = z / b;
} else {
tmp = x / a;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if a <= -1.65e+192: tmp = x / a elif a <= -3.1e+112: tmp = z / b elif a <= -1.0: tmp = x / a elif a <= 2.4e-18: tmp = x - (x * a) elif a <= 1.9e+85: tmp = z / b else: tmp = x / a return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (a <= -1.65e+192) tmp = Float64(x / a); elseif (a <= -3.1e+112) tmp = Float64(z / b); elseif (a <= -1.0) tmp = Float64(x / a); elseif (a <= 2.4e-18) tmp = Float64(x - Float64(x * a)); elseif (a <= 1.9e+85) tmp = Float64(z / b); else tmp = Float64(x / a); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (a <= -1.65e+192) tmp = x / a; elseif (a <= -3.1e+112) tmp = z / b; elseif (a <= -1.0) tmp = x / a; elseif (a <= 2.4e-18) tmp = x - (x * a); elseif (a <= 1.9e+85) tmp = z / b; else tmp = x / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, -1.65e+192], N[(x / a), $MachinePrecision], If[LessEqual[a, -3.1e+112], N[(z / b), $MachinePrecision], If[LessEqual[a, -1.0], N[(x / a), $MachinePrecision], If[LessEqual[a, 2.4e-18], N[(x - N[(x * a), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.9e+85], N[(z / b), $MachinePrecision], N[(x / a), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.65 \cdot 10^{+192}:\\
\;\;\;\;\frac{x}{a}\\
\mathbf{elif}\;a \leq -3.1 \cdot 10^{+112}:\\
\;\;\;\;\frac{z}{b}\\
\mathbf{elif}\;a \leq -1:\\
\;\;\;\;\frac{x}{a}\\
\mathbf{elif}\;a \leq 2.4 \cdot 10^{-18}:\\
\;\;\;\;x - x \cdot a\\
\mathbf{elif}\;a \leq 1.9 \cdot 10^{+85}:\\
\;\;\;\;\frac{z}{b}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{a}\\
\end{array}
\end{array}
if a < -1.65000000000000005e192 or -3.09999999999999983e112 < a < -1 or 1.89999999999999996e85 < a Initial program 77.5%
*-commutative77.5%
associate-*l/76.4%
associate-+l+76.4%
associate-*r/79.7%
*-commutative79.7%
Simplified79.7%
Taylor expanded in x around inf 57.4%
associate-*r/58.7%
Simplified58.7%
Taylor expanded in a around inf 55.7%
if -1.65000000000000005e192 < a < -3.09999999999999983e112 or 2.39999999999999994e-18 < a < 1.89999999999999996e85Initial program 54.5%
*-commutative54.5%
associate-*l/51.6%
associate-+l+51.6%
associate-*r/54.1%
*-commutative54.1%
Simplified54.1%
Taylor expanded in t around 0 63.4%
if -1 < a < 2.39999999999999994e-18Initial program 81.7%
*-commutative81.7%
associate-*l/80.3%
associate-+l+80.3%
associate-*r/85.3%
*-commutative85.3%
Simplified85.3%
Taylor expanded in t around inf 48.3%
Taylor expanded in a around 0 47.9%
mul-1-neg47.9%
unsub-neg47.9%
Simplified47.9%
Final simplification52.6%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -7.2e+45) (not (<= y 1e+65))) (/ z b) (/ x (+ a 1.0))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -7.2e+45) || !(y <= 1e+65)) {
tmp = z / b;
} else {
tmp = x / (a + 1.0);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((y <= (-7.2d+45)) .or. (.not. (y <= 1d+65))) then
tmp = z / b
else
tmp = x / (a + 1.0d0)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -7.2e+45) || !(y <= 1e+65)) {
tmp = z / b;
} else {
tmp = x / (a + 1.0);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -7.2e+45) or not (y <= 1e+65): tmp = z / b else: tmp = x / (a + 1.0) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -7.2e+45) || !(y <= 1e+65)) tmp = Float64(z / b); else tmp = Float64(x / Float64(a + 1.0)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -7.2e+45) || ~((y <= 1e+65))) tmp = z / b; else tmp = x / (a + 1.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -7.2e+45], N[Not[LessEqual[y, 1e+65]], $MachinePrecision]], N[(z / b), $MachinePrecision], N[(x / N[(a + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -7.2 \cdot 10^{+45} \lor \neg \left(y \leq 10^{+65}\right):\\
\;\;\;\;\frac{z}{b}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{a + 1}\\
\end{array}
\end{array}
if y < -7.2e45 or 9.9999999999999999e64 < y Initial program 52.6%
*-commutative52.6%
associate-*l/57.7%
associate-+l+57.7%
associate-*r/68.7%
*-commutative68.7%
Simplified68.7%
Taylor expanded in t around 0 55.0%
if -7.2e45 < y < 9.9999999999999999e64Initial program 91.3%
*-commutative91.3%
associate-*l/85.8%
associate-+l+85.8%
associate-*r/85.6%
*-commutative85.6%
Simplified85.6%
Taylor expanded in t around inf 65.3%
Final simplification61.4%
(FPCore (x y z t a b) :precision binary64 (if (or (<= a -1.0) (not (<= a 2.5e-18))) (/ x a) x))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -1.0) || !(a <= 2.5e-18)) {
tmp = x / a;
} else {
tmp = 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 ((a <= (-1.0d0)) .or. (.not. (a <= 2.5d-18))) then
tmp = x / a
else
tmp = 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 ((a <= -1.0) || !(a <= 2.5e-18)) {
tmp = x / a;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (a <= -1.0) or not (a <= 2.5e-18): tmp = x / a else: tmp = x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((a <= -1.0) || !(a <= 2.5e-18)) tmp = Float64(x / a); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((a <= -1.0) || ~((a <= 2.5e-18))) tmp = x / a; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[a, -1.0], N[Not[LessEqual[a, 2.5e-18]], $MachinePrecision]], N[(x / a), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1 \lor \neg \left(a \leq 2.5 \cdot 10^{-18}\right):\\
\;\;\;\;\frac{x}{a}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < -1 or 2.50000000000000018e-18 < a Initial program 71.1%
*-commutative71.1%
associate-*l/69.6%
associate-+l+69.6%
associate-*r/72.7%
*-commutative72.7%
Simplified72.7%
Taylor expanded in x around inf 49.9%
associate-*r/50.8%
Simplified50.8%
Taylor expanded in a around inf 46.8%
if -1 < a < 2.50000000000000018e-18Initial program 81.7%
*-commutative81.7%
associate-*l/80.3%
associate-+l+80.3%
associate-*r/85.3%
*-commutative85.3%
Simplified85.3%
Taylor expanded in t around inf 48.3%
Taylor expanded in a around 0 47.2%
Final simplification47.0%
(FPCore (x y z t a b) :precision binary64 x)
double code(double x, double y, double z, double t, double a, double b) {
return x;
}
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
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return x;
}
def code(x, y, z, t, a, b): return x
function code(x, y, z, t, a, b) return x end
function tmp = code(x, y, z, t, a, b) tmp = x; end
code[x_, y_, z_, t_, a_, b_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 76.6%
*-commutative76.6%
associate-*l/75.1%
associate-+l+75.2%
associate-*r/79.2%
*-commutative79.2%
Simplified79.2%
Taylor expanded in t around inf 48.0%
Taylor expanded in a around 0 26.7%
Final simplification26.7%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1
(* 1.0 (* (+ x (* (/ y t) z)) (/ 1.0 (+ (+ a 1.0) (* (/ y t) b)))))))
(if (< t -1.3659085366310088e-271)
t_1
(if (< t 3.036967103737246e-130) (/ z b) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = 1.0 * ((x + ((y / t) * z)) * (1.0 / ((a + 1.0) + ((y / t) * b))));
double tmp;
if (t < -1.3659085366310088e-271) {
tmp = t_1;
} else if (t < 3.036967103737246e-130) {
tmp = z / b;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = 1.0d0 * ((x + ((y / t) * z)) * (1.0d0 / ((a + 1.0d0) + ((y / t) * b))))
if (t < (-1.3659085366310088d-271)) then
tmp = t_1
else if (t < 3.036967103737246d-130) then
tmp = z / b
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 = 1.0 * ((x + ((y / t) * z)) * (1.0 / ((a + 1.0) + ((y / t) * b))));
double tmp;
if (t < -1.3659085366310088e-271) {
tmp = t_1;
} else if (t < 3.036967103737246e-130) {
tmp = z / b;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = 1.0 * ((x + ((y / t) * z)) * (1.0 / ((a + 1.0) + ((y / t) * b)))) tmp = 0 if t < -1.3659085366310088e-271: tmp = t_1 elif t < 3.036967103737246e-130: tmp = z / b else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(1.0 * Float64(Float64(x + Float64(Float64(y / t) * z)) * Float64(1.0 / Float64(Float64(a + 1.0) + Float64(Float64(y / t) * b))))) tmp = 0.0 if (t < -1.3659085366310088e-271) tmp = t_1; elseif (t < 3.036967103737246e-130) tmp = Float64(z / b); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = 1.0 * ((x + ((y / t) * z)) * (1.0 / ((a + 1.0) + ((y / t) * b)))); tmp = 0.0; if (t < -1.3659085366310088e-271) tmp = t_1; elseif (t < 3.036967103737246e-130) tmp = z / b; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(1.0 * N[(N[(x + N[(N[(y / t), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[(N[(a + 1.0), $MachinePrecision] + N[(N[(y / t), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Less[t, -1.3659085366310088e-271], t$95$1, If[Less[t, 3.036967103737246e-130], N[(z / b), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 1 \cdot \left(\left(x + \frac{y}{t} \cdot z\right) \cdot \frac{1}{\left(a + 1\right) + \frac{y}{t} \cdot b}\right)\\
\mathbf{if}\;t < -1.3659085366310088 \cdot 10^{-271}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t < 3.036967103737246 \cdot 10^{-130}:\\
\;\;\;\;\frac{z}{b}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
herbie shell --seed 2023298
(FPCore (x y z t a b)
:name "Diagrams.Solve.Tridiagonal:solveCyclicTriDiagonal from diagrams-solve-0.1, B"
:precision binary64
:herbie-target
(if (< t -1.3659085366310088e-271) (* 1.0 (* (+ x (* (/ y t) z)) (/ 1.0 (+ (+ a 1.0) (* (/ y t) b))))) (if (< t 3.036967103737246e-130) (/ z b) (* 1.0 (* (+ x (* (/ y t) z)) (/ 1.0 (+ (+ a 1.0) (* (/ y t) b)))))))
(/ (+ x (/ (* y z) t)) (+ (+ a 1.0) (/ (* y b) t))))