
(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 17 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 (/ (+ x (/ (* y z) t)) (+ (/ (* y b) t) (+ a 1.0)))))
(if (<= t_1 -1e-292)
t_1
(if (<= t_1 0.0)
(+
(+ (/ z b) (* (/ t y) (/ x b)))
(* (/ t y) (/ (* z (- -1.0 a)) (* b b))))
(if (<= t_1 INFINITY)
(+
(* y (/ z (fma t (fma y (/ b t) a) t)))
(/ x (+ 1.0 (+ a (* b (/ y t))))))
(/ z b))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x + ((y * z) / t)) / (((y * b) / t) + (a + 1.0));
double tmp;
if (t_1 <= -1e-292) {
tmp = t_1;
} else if (t_1 <= 0.0) {
tmp = ((z / b) + ((t / y) * (x / b))) + ((t / y) * ((z * (-1.0 - a)) / (b * b)));
} else if (t_1 <= ((double) INFINITY)) {
tmp = (y * (z / fma(t, fma(y, (b / t), a), t))) + (x / (1.0 + (a + (b * (y / t)))));
} else {
tmp = z / b;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(x + Float64(Float64(y * z) / t)) / Float64(Float64(Float64(y * b) / t) + Float64(a + 1.0))) tmp = 0.0 if (t_1 <= -1e-292) tmp = t_1; elseif (t_1 <= 0.0) tmp = Float64(Float64(Float64(z / b) + Float64(Float64(t / y) * Float64(x / b))) + Float64(Float64(t / y) * Float64(Float64(z * Float64(-1.0 - a)) / Float64(b * b)))); elseif (t_1 <= Inf) tmp = Float64(Float64(y * Float64(z / fma(t, fma(y, Float64(b / t), a), t))) + Float64(x / Float64(1.0 + Float64(a + Float64(b * Float64(y / t)))))); else tmp = Float64(z / b); end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] / N[(N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision] + N[(a + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -1e-292], t$95$1, If[LessEqual[t$95$1, 0.0], N[(N[(N[(z / b), $MachinePrecision] + N[(N[(t / y), $MachinePrecision] * N[(x / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(t / y), $MachinePrecision] * N[(N[(z * N[(-1.0 - a), $MachinePrecision]), $MachinePrecision] / N[(b * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, Infinity], N[(N[(y * N[(z / N[(t * N[(y * N[(b / t), $MachinePrecision] + a), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x / N[(1.0 + N[(a + N[(b * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z / b), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x + \frac{y \cdot z}{t}}{\frac{y \cdot b}{t} + \left(a + 1\right)}\\
\mathbf{if}\;t_1 \leq -1 \cdot 10^{-292}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t_1 \leq 0:\\
\;\;\;\;\left(\frac{z}{b} + \frac{t}{y} \cdot \frac{x}{b}\right) + \frac{t}{y} \cdot \frac{z \cdot \left(-1 - a\right)}{b \cdot b}\\
\mathbf{elif}\;t_1 \leq \infty:\\
\;\;\;\;y \cdot \frac{z}{\mathsf{fma}\left(t, \mathsf{fma}\left(y, \frac{b}{t}, a\right), t\right)} + \frac{x}{1 + \left(a + b \cdot \frac{y}{t}\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))) < -1.0000000000000001e-292Initial program 94.4%
if -1.0000000000000001e-292 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < 0.0Initial program 49.2%
*-commutative49.2%
associate-/l*47.7%
associate-*l/62.6%
Simplified62.6%
Taylor expanded in z around 0 64.1%
associate-*l/60.4%
*-commutative60.4%
Simplified60.4%
Taylor expanded in y around inf 71.3%
+-commutative71.3%
times-frac81.9%
times-frac84.2%
*-commutative84.2%
unpow284.2%
Simplified84.2%
if 0.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < +inf.0Initial program 82.9%
*-commutative82.9%
associate-/l*87.5%
associate-*l/84.5%
Simplified84.5%
associate-*l/87.5%
clear-num87.5%
Applied egg-rr87.5%
Taylor expanded in x around 0 86.7%
times-frac94.1%
*-commutative94.1%
associate-*r/92.0%
*-commutative92.0%
associate-*r/92.0%
Simplified92.0%
Taylor expanded in z around 0 86.7%
associate-/r*82.9%
associate-+r+82.9%
associate-/l*82.8%
+-commutative82.8%
associate-/l*82.9%
associate-+r+82.9%
associate-*l/86.7%
associate-+r+86.7%
associate-/l*86.6%
associate-+r+86.6%
associate-/r/84.5%
fma-udef84.5%
associate-*r/92.0%
associate-*l/84.5%
associate-*r/91.1%
associate-/l/89.2%
+-commutative89.2%
Simplified94.1%
if +inf.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) Initial program 0.0%
*-commutative0.0%
associate-/l*0.3%
associate-*l/7.9%
Simplified7.9%
Taylor expanded in t around 0 92.6%
Final simplification92.3%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (+ x (/ (* y z) t)) (+ (/ (* y b) t) (+ a 1.0))))
(t_2 (+ 1.0 (+ a (* b (/ y t))))))
(if (<= t_1 -1e-292)
t_1
(if (<= t_1 0.0)
(+
(+ (/ z b) (* (/ t y) (/ x b)))
(* (/ t y) (/ (* z (- -1.0 a)) (* b b))))
(if (<= t_1 INFINITY) (+ (/ x t_2) (* (/ y t) (/ z t_2))) (/ z b))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x + ((y * z) / t)) / (((y * b) / t) + (a + 1.0));
double t_2 = 1.0 + (a + (b * (y / t)));
double tmp;
if (t_1 <= -1e-292) {
tmp = t_1;
} else if (t_1 <= 0.0) {
tmp = ((z / b) + ((t / y) * (x / b))) + ((t / y) * ((z * (-1.0 - a)) / (b * b)));
} else if (t_1 <= ((double) INFINITY)) {
tmp = (x / t_2) + ((y / t) * (z / 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 = (x + ((y * z) / t)) / (((y * b) / t) + (a + 1.0));
double t_2 = 1.0 + (a + (b * (y / t)));
double tmp;
if (t_1 <= -1e-292) {
tmp = t_1;
} else if (t_1 <= 0.0) {
tmp = ((z / b) + ((t / y) * (x / b))) + ((t / y) * ((z * (-1.0 - a)) / (b * b)));
} else if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = (x / t_2) + ((y / t) * (z / t_2));
} else {
tmp = z / b;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (x + ((y * z) / t)) / (((y * b) / t) + (a + 1.0)) t_2 = 1.0 + (a + (b * (y / t))) tmp = 0 if t_1 <= -1e-292: tmp = t_1 elif t_1 <= 0.0: tmp = ((z / b) + ((t / y) * (x / b))) + ((t / y) * ((z * (-1.0 - a)) / (b * b))) elif t_1 <= math.inf: tmp = (x / t_2) + ((y / t) * (z / t_2)) else: tmp = z / b return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(x + Float64(Float64(y * z) / t)) / Float64(Float64(Float64(y * b) / t) + Float64(a + 1.0))) t_2 = Float64(1.0 + Float64(a + Float64(b * Float64(y / t)))) tmp = 0.0 if (t_1 <= -1e-292) tmp = t_1; elseif (t_1 <= 0.0) tmp = Float64(Float64(Float64(z / b) + Float64(Float64(t / y) * Float64(x / b))) + Float64(Float64(t / y) * Float64(Float64(z * Float64(-1.0 - a)) / Float64(b * b)))); elseif (t_1 <= Inf) tmp = Float64(Float64(x / t_2) + Float64(Float64(y / t) * Float64(z / t_2))); else tmp = Float64(z / b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (x + ((y * z) / t)) / (((y * b) / t) + (a + 1.0)); t_2 = 1.0 + (a + (b * (y / t))); tmp = 0.0; if (t_1 <= -1e-292) tmp = t_1; elseif (t_1 <= 0.0) tmp = ((z / b) + ((t / y) * (x / b))) + ((t / y) * ((z * (-1.0 - a)) / (b * b))); elseif (t_1 <= Inf) tmp = (x / t_2) + ((y / t) * (z / t_2)); else tmp = z / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] / N[(N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision] + N[(a + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(1.0 + N[(a + N[(b * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -1e-292], t$95$1, If[LessEqual[t$95$1, 0.0], N[(N[(N[(z / b), $MachinePrecision] + N[(N[(t / y), $MachinePrecision] * N[(x / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(t / y), $MachinePrecision] * N[(N[(z * N[(-1.0 - a), $MachinePrecision]), $MachinePrecision] / N[(b * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, Infinity], N[(N[(x / t$95$2), $MachinePrecision] + N[(N[(y / t), $MachinePrecision] * N[(z / t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z / b), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x + \frac{y \cdot z}{t}}{\frac{y \cdot b}{t} + \left(a + 1\right)}\\
t_2 := 1 + \left(a + b \cdot \frac{y}{t}\right)\\
\mathbf{if}\;t_1 \leq -1 \cdot 10^{-292}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t_1 \leq 0:\\
\;\;\;\;\left(\frac{z}{b} + \frac{t}{y} \cdot \frac{x}{b}\right) + \frac{t}{y} \cdot \frac{z \cdot \left(-1 - a\right)}{b \cdot b}\\
\mathbf{elif}\;t_1 \leq \infty:\\
\;\;\;\;\frac{x}{t_2} + \frac{y}{t} \cdot \frac{z}{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))) < -1.0000000000000001e-292Initial program 94.4%
if -1.0000000000000001e-292 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < 0.0Initial program 49.2%
*-commutative49.2%
associate-/l*47.7%
associate-*l/62.6%
Simplified62.6%
Taylor expanded in z around 0 64.1%
associate-*l/60.4%
*-commutative60.4%
Simplified60.4%
Taylor expanded in y around inf 71.3%
+-commutative71.3%
times-frac81.9%
times-frac84.2%
*-commutative84.2%
unpow284.2%
Simplified84.2%
if 0.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < +inf.0Initial program 82.9%
*-commutative82.9%
associate-/l*87.5%
associate-*l/84.5%
Simplified84.5%
associate-*l/87.5%
clear-num87.5%
Applied egg-rr87.5%
Taylor expanded in x around 0 86.7%
times-frac94.1%
*-commutative94.1%
associate-*r/92.0%
*-commutative92.0%
associate-*r/92.0%
Simplified92.0%
if +inf.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) Initial program 0.0%
*-commutative0.0%
associate-/l*0.3%
associate-*l/7.9%
Simplified7.9%
Taylor expanded in t around 0 92.6%
Final simplification91.5%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (+ x (/ (* y z) t)) (+ (/ (* y b) t) (+ a 1.0)))))
(if (or (<= t_1 -1e-292) (and (not (<= t_1 0.0)) (<= t_1 1e+287)))
t_1
(+ (/ z b) (/ x (+ 1.0 (+ a (* b (/ y t)))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x + ((y * z) / t)) / (((y * b) / t) + (a + 1.0));
double tmp;
if ((t_1 <= -1e-292) || (!(t_1 <= 0.0) && (t_1 <= 1e+287))) {
tmp = t_1;
} else {
tmp = (z / b) + (x / (1.0 + (a + (b * (y / 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 = (x + ((y * z) / t)) / (((y * b) / t) + (a + 1.0d0))
if ((t_1 <= (-1d-292)) .or. (.not. (t_1 <= 0.0d0)) .and. (t_1 <= 1d+287)) then
tmp = t_1
else
tmp = (z / b) + (x / (1.0d0 + (a + (b * (y / 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 = (x + ((y * z) / t)) / (((y * b) / t) + (a + 1.0));
double tmp;
if ((t_1 <= -1e-292) || (!(t_1 <= 0.0) && (t_1 <= 1e+287))) {
tmp = t_1;
} else {
tmp = (z / b) + (x / (1.0 + (a + (b * (y / t)))));
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (x + ((y * z) / t)) / (((y * b) / t) + (a + 1.0)) tmp = 0 if (t_1 <= -1e-292) or (not (t_1 <= 0.0) and (t_1 <= 1e+287)): tmp = t_1 else: tmp = (z / b) + (x / (1.0 + (a + (b * (y / t))))) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(x + Float64(Float64(y * z) / t)) / Float64(Float64(Float64(y * b) / t) + Float64(a + 1.0))) tmp = 0.0 if ((t_1 <= -1e-292) || (!(t_1 <= 0.0) && (t_1 <= 1e+287))) tmp = t_1; else tmp = Float64(Float64(z / b) + Float64(x / Float64(1.0 + Float64(a + Float64(b * Float64(y / t)))))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (x + ((y * z) / t)) / (((y * b) / t) + (a + 1.0)); tmp = 0.0; if ((t_1 <= -1e-292) || (~((t_1 <= 0.0)) && (t_1 <= 1e+287))) tmp = t_1; else tmp = (z / b) + (x / (1.0 + (a + (b * (y / t))))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] / N[(N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision] + N[(a + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$1, -1e-292], And[N[Not[LessEqual[t$95$1, 0.0]], $MachinePrecision], LessEqual[t$95$1, 1e+287]]], t$95$1, N[(N[(z / b), $MachinePrecision] + N[(x / N[(1.0 + N[(a + N[(b * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x + \frac{y \cdot z}{t}}{\frac{y \cdot b}{t} + \left(a + 1\right)}\\
\mathbf{if}\;t_1 \leq -1 \cdot 10^{-292} \lor \neg \left(t_1 \leq 0\right) \land t_1 \leq 10^{+287}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{b} + \frac{x}{1 + \left(a + b \cdot \frac{y}{t}\right)}\\
\end{array}
\end{array}
if (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < -1.0000000000000001e-292 or 0.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < 1.0000000000000001e287Initial program 96.9%
if -1.0000000000000001e-292 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < 0.0 or 1.0000000000000001e287 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) Initial program 28.6%
*-commutative28.6%
associate-/l*35.3%
associate-*l/42.3%
Simplified42.3%
associate-*l/35.3%
clear-num35.3%
Applied egg-rr35.3%
Taylor expanded in x around 0 36.4%
times-frac41.4%
*-commutative41.4%
associate-*r/42.4%
*-commutative42.4%
associate-*r/46.7%
Simplified46.7%
Taylor expanded in y around inf 72.9%
Final simplification88.5%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (+ x (/ (* y z) t)) (+ (/ (* y b) t) (+ a 1.0)))))
(if (<= t_1 -1e-292)
t_1
(if (<= t_1 0.0)
(+ (/ z b) (/ (+ (/ t (/ b x)) (/ (* (* z t) (- -1.0 a)) (* b b))) y))
(if (<= t_1 1e+287)
t_1
(+ (/ z b) (/ x (+ 1.0 (+ a (* b (/ y t)))))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x + ((y * z) / t)) / (((y * b) / t) + (a + 1.0));
double tmp;
if (t_1 <= -1e-292) {
tmp = t_1;
} else if (t_1 <= 0.0) {
tmp = (z / b) + (((t / (b / x)) + (((z * t) * (-1.0 - a)) / (b * b))) / y);
} else if (t_1 <= 1e+287) {
tmp = t_1;
} else {
tmp = (z / b) + (x / (1.0 + (a + (b * (y / 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 = (x + ((y * z) / t)) / (((y * b) / t) + (a + 1.0d0))
if (t_1 <= (-1d-292)) then
tmp = t_1
else if (t_1 <= 0.0d0) then
tmp = (z / b) + (((t / (b / x)) + (((z * t) * ((-1.0d0) - a)) / (b * b))) / y)
else if (t_1 <= 1d+287) then
tmp = t_1
else
tmp = (z / b) + (x / (1.0d0 + (a + (b * (y / 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 = (x + ((y * z) / t)) / (((y * b) / t) + (a + 1.0));
double tmp;
if (t_1 <= -1e-292) {
tmp = t_1;
} else if (t_1 <= 0.0) {
tmp = (z / b) + (((t / (b / x)) + (((z * t) * (-1.0 - a)) / (b * b))) / y);
} else if (t_1 <= 1e+287) {
tmp = t_1;
} else {
tmp = (z / b) + (x / (1.0 + (a + (b * (y / t)))));
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (x + ((y * z) / t)) / (((y * b) / t) + (a + 1.0)) tmp = 0 if t_1 <= -1e-292: tmp = t_1 elif t_1 <= 0.0: tmp = (z / b) + (((t / (b / x)) + (((z * t) * (-1.0 - a)) / (b * b))) / y) elif t_1 <= 1e+287: tmp = t_1 else: tmp = (z / b) + (x / (1.0 + (a + (b * (y / t))))) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(x + Float64(Float64(y * z) / t)) / Float64(Float64(Float64(y * b) / t) + Float64(a + 1.0))) tmp = 0.0 if (t_1 <= -1e-292) tmp = t_1; elseif (t_1 <= 0.0) tmp = Float64(Float64(z / b) + Float64(Float64(Float64(t / Float64(b / x)) + Float64(Float64(Float64(z * t) * Float64(-1.0 - a)) / Float64(b * b))) / y)); elseif (t_1 <= 1e+287) tmp = t_1; else tmp = Float64(Float64(z / b) + Float64(x / Float64(1.0 + Float64(a + Float64(b * Float64(y / t)))))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (x + ((y * z) / t)) / (((y * b) / t) + (a + 1.0)); tmp = 0.0; if (t_1 <= -1e-292) tmp = t_1; elseif (t_1 <= 0.0) tmp = (z / b) + (((t / (b / x)) + (((z * t) * (-1.0 - a)) / (b * b))) / y); elseif (t_1 <= 1e+287) tmp = t_1; else tmp = (z / b) + (x / (1.0 + (a + (b * (y / t))))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] / N[(N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision] + N[(a + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -1e-292], t$95$1, If[LessEqual[t$95$1, 0.0], N[(N[(z / b), $MachinePrecision] + N[(N[(N[(t / N[(b / x), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(z * t), $MachinePrecision] * N[(-1.0 - a), $MachinePrecision]), $MachinePrecision] / N[(b * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e+287], t$95$1, N[(N[(z / b), $MachinePrecision] + N[(x / N[(1.0 + N[(a + N[(b * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x + \frac{y \cdot z}{t}}{\frac{y \cdot b}{t} + \left(a + 1\right)}\\
\mathbf{if}\;t_1 \leq -1 \cdot 10^{-292}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t_1 \leq 0:\\
\;\;\;\;\frac{z}{b} + \frac{\frac{t}{\frac{b}{x}} + \frac{\left(z \cdot t\right) \cdot \left(-1 - a\right)}{b \cdot b}}{y}\\
\mathbf{elif}\;t_1 \leq 10^{+287}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{b} + \frac{x}{1 + \left(a + b \cdot \frac{y}{t}\right)}\\
\end{array}
\end{array}
if (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < -1.0000000000000001e-292 or 0.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < 1.0000000000000001e287Initial program 96.9%
if -1.0000000000000001e-292 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < 0.0Initial program 49.2%
*-commutative49.2%
associate-/l*47.7%
associate-*l/62.6%
Simplified62.6%
Taylor expanded in z around 0 64.1%
associate-*l/60.4%
*-commutative60.4%
Simplified60.4%
Taylor expanded in y around -inf 79.7%
+-commutative79.7%
associate-*r/79.7%
distribute-lft-out--79.7%
associate-*r*79.7%
metadata-eval79.7%
*-lft-identity79.7%
associate-/l*79.7%
*-commutative79.7%
associate-*r*79.7%
unpow279.7%
Simplified79.7%
if 1.0000000000000001e287 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) Initial program 8.9%
*-commutative8.9%
associate-/l*23.4%
associate-*l/22.9%
Simplified22.9%
associate-*l/23.4%
clear-num23.4%
Applied egg-rr23.4%
Taylor expanded in x around 0 24.2%
times-frac42.0%
*-commutative42.0%
associate-*r/39.5%
*-commutative39.5%
associate-*r/41.7%
Simplified41.7%
Taylor expanded in y around inf 71.8%
Final simplification89.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (+ x (/ (* y z) t)) (+ (/ (* y b) t) (+ a 1.0)))))
(if (<= t_1 -1e-292)
t_1
(if (<= t_1 0.0)
(+
(+ (/ z b) (* (/ t y) (/ x b)))
(* (/ t y) (/ (* z (- -1.0 a)) (* b b))))
(if (<= t_1 1e+287)
t_1
(+ (/ z b) (/ x (+ 1.0 (+ a (* b (/ y t)))))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x + ((y * z) / t)) / (((y * b) / t) + (a + 1.0));
double tmp;
if (t_1 <= -1e-292) {
tmp = t_1;
} else if (t_1 <= 0.0) {
tmp = ((z / b) + ((t / y) * (x / b))) + ((t / y) * ((z * (-1.0 - a)) / (b * b)));
} else if (t_1 <= 1e+287) {
tmp = t_1;
} else {
tmp = (z / b) + (x / (1.0 + (a + (b * (y / 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 = (x + ((y * z) / t)) / (((y * b) / t) + (a + 1.0d0))
if (t_1 <= (-1d-292)) then
tmp = t_1
else if (t_1 <= 0.0d0) then
tmp = ((z / b) + ((t / y) * (x / b))) + ((t / y) * ((z * ((-1.0d0) - a)) / (b * b)))
else if (t_1 <= 1d+287) then
tmp = t_1
else
tmp = (z / b) + (x / (1.0d0 + (a + (b * (y / 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 = (x + ((y * z) / t)) / (((y * b) / t) + (a + 1.0));
double tmp;
if (t_1 <= -1e-292) {
tmp = t_1;
} else if (t_1 <= 0.0) {
tmp = ((z / b) + ((t / y) * (x / b))) + ((t / y) * ((z * (-1.0 - a)) / (b * b)));
} else if (t_1 <= 1e+287) {
tmp = t_1;
} else {
tmp = (z / b) + (x / (1.0 + (a + (b * (y / t)))));
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (x + ((y * z) / t)) / (((y * b) / t) + (a + 1.0)) tmp = 0 if t_1 <= -1e-292: tmp = t_1 elif t_1 <= 0.0: tmp = ((z / b) + ((t / y) * (x / b))) + ((t / y) * ((z * (-1.0 - a)) / (b * b))) elif t_1 <= 1e+287: tmp = t_1 else: tmp = (z / b) + (x / (1.0 + (a + (b * (y / t))))) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(x + Float64(Float64(y * z) / t)) / Float64(Float64(Float64(y * b) / t) + Float64(a + 1.0))) tmp = 0.0 if (t_1 <= -1e-292) tmp = t_1; elseif (t_1 <= 0.0) tmp = Float64(Float64(Float64(z / b) + Float64(Float64(t / y) * Float64(x / b))) + Float64(Float64(t / y) * Float64(Float64(z * Float64(-1.0 - a)) / Float64(b * b)))); elseif (t_1 <= 1e+287) tmp = t_1; else tmp = Float64(Float64(z / b) + Float64(x / Float64(1.0 + Float64(a + Float64(b * Float64(y / t)))))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (x + ((y * z) / t)) / (((y * b) / t) + (a + 1.0)); tmp = 0.0; if (t_1 <= -1e-292) tmp = t_1; elseif (t_1 <= 0.0) tmp = ((z / b) + ((t / y) * (x / b))) + ((t / y) * ((z * (-1.0 - a)) / (b * b))); elseif (t_1 <= 1e+287) tmp = t_1; else tmp = (z / b) + (x / (1.0 + (a + (b * (y / t))))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] / N[(N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision] + N[(a + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -1e-292], t$95$1, If[LessEqual[t$95$1, 0.0], N[(N[(N[(z / b), $MachinePrecision] + N[(N[(t / y), $MachinePrecision] * N[(x / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(t / y), $MachinePrecision] * N[(N[(z * N[(-1.0 - a), $MachinePrecision]), $MachinePrecision] / N[(b * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e+287], t$95$1, N[(N[(z / b), $MachinePrecision] + N[(x / N[(1.0 + N[(a + N[(b * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x + \frac{y \cdot z}{t}}{\frac{y \cdot b}{t} + \left(a + 1\right)}\\
\mathbf{if}\;t_1 \leq -1 \cdot 10^{-292}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t_1 \leq 0:\\
\;\;\;\;\left(\frac{z}{b} + \frac{t}{y} \cdot \frac{x}{b}\right) + \frac{t}{y} \cdot \frac{z \cdot \left(-1 - a\right)}{b \cdot b}\\
\mathbf{elif}\;t_1 \leq 10^{+287}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{b} + \frac{x}{1 + \left(a + b \cdot \frac{y}{t}\right)}\\
\end{array}
\end{array}
if (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < -1.0000000000000001e-292 or 0.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < 1.0000000000000001e287Initial program 96.9%
if -1.0000000000000001e-292 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < 0.0Initial program 49.2%
*-commutative49.2%
associate-/l*47.7%
associate-*l/62.6%
Simplified62.6%
Taylor expanded in z around 0 64.1%
associate-*l/60.4%
*-commutative60.4%
Simplified60.4%
Taylor expanded in y around inf 71.3%
+-commutative71.3%
times-frac81.9%
times-frac84.2%
*-commutative84.2%
unpow284.2%
Simplified84.2%
if 1.0000000000000001e287 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) Initial program 8.9%
*-commutative8.9%
associate-/l*23.4%
associate-*l/22.9%
Simplified22.9%
associate-*l/23.4%
clear-num23.4%
Applied egg-rr23.4%
Taylor expanded in x around 0 24.2%
times-frac42.0%
*-commutative42.0%
associate-*r/39.5%
*-commutative39.5%
associate-*r/41.7%
Simplified41.7%
Taylor expanded in y around inf 71.8%
Final simplification90.2%
(FPCore (x y z t a b)
:precision binary64
(if (or (<= b -3.8e-126)
(not
(or (<= b 1.66e-125) (and (not (<= b 1.8e+106)) (<= b 3.5e+142)))))
(+ (/ z b) (/ x (+ 1.0 (+ a (* b (/ y t))))))
(/ (+ x (/ z (/ t y))) (+ a 1.0))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((b <= -3.8e-126) || !((b <= 1.66e-125) || (!(b <= 1.8e+106) && (b <= 3.5e+142)))) {
tmp = (z / b) + (x / (1.0 + (a + (b * (y / t)))));
} else {
tmp = (x + (z / (t / y))) / (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 ((b <= (-3.8d-126)) .or. (.not. (b <= 1.66d-125) .or. (.not. (b <= 1.8d+106)) .and. (b <= 3.5d+142))) then
tmp = (z / b) + (x / (1.0d0 + (a + (b * (y / t)))))
else
tmp = (x + (z / (t / y))) / (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 ((b <= -3.8e-126) || !((b <= 1.66e-125) || (!(b <= 1.8e+106) && (b <= 3.5e+142)))) {
tmp = (z / b) + (x / (1.0 + (a + (b * (y / t)))));
} else {
tmp = (x + (z / (t / y))) / (a + 1.0);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (b <= -3.8e-126) or not ((b <= 1.66e-125) or (not (b <= 1.8e+106) and (b <= 3.5e+142))): tmp = (z / b) + (x / (1.0 + (a + (b * (y / t))))) else: tmp = (x + (z / (t / y))) / (a + 1.0) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((b <= -3.8e-126) || !((b <= 1.66e-125) || (!(b <= 1.8e+106) && (b <= 3.5e+142)))) tmp = Float64(Float64(z / b) + Float64(x / Float64(1.0 + Float64(a + Float64(b * Float64(y / t)))))); else tmp = Float64(Float64(x + Float64(z / Float64(t / y))) / Float64(a + 1.0)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((b <= -3.8e-126) || ~(((b <= 1.66e-125) || (~((b <= 1.8e+106)) && (b <= 3.5e+142))))) tmp = (z / b) + (x / (1.0 + (a + (b * (y / t))))); else tmp = (x + (z / (t / y))) / (a + 1.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[b, -3.8e-126], N[Not[Or[LessEqual[b, 1.66e-125], And[N[Not[LessEqual[b, 1.8e+106]], $MachinePrecision], LessEqual[b, 3.5e+142]]]], $MachinePrecision]], N[(N[(z / b), $MachinePrecision] + N[(x / N[(1.0 + N[(a + N[(b * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x + N[(z / N[(t / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(a + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -3.8 \cdot 10^{-126} \lor \neg \left(b \leq 1.66 \cdot 10^{-125} \lor \neg \left(b \leq 1.8 \cdot 10^{+106}\right) \land b \leq 3.5 \cdot 10^{+142}\right):\\
\;\;\;\;\frac{z}{b} + \frac{x}{1 + \left(a + b \cdot \frac{y}{t}\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{x + \frac{z}{\frac{t}{y}}}{a + 1}\\
\end{array}
\end{array}
if b < -3.7999999999999999e-126 or 1.65999999999999989e-125 < b < 1.8e106 or 3.49999999999999997e142 < b Initial program 66.6%
*-commutative66.6%
associate-/l*65.1%
associate-*l/69.2%
Simplified69.2%
associate-*l/65.1%
clear-num65.1%
Applied egg-rr65.1%
Taylor expanded in x around 0 69.9%
times-frac68.0%
*-commutative68.0%
associate-*r/69.2%
*-commutative69.2%
associate-*r/71.0%
Simplified71.0%
Taylor expanded in y around inf 81.3%
if -3.7999999999999999e-126 < b < 1.65999999999999989e-125 or 1.8e106 < b < 3.49999999999999997e142Initial program 83.7%
*-commutative83.7%
associate-/l*89.7%
associate-*l/85.3%
Simplified85.3%
Taylor expanded in y around 0 86.4%
Final simplification83.2%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (+ x (/ z (/ t y))) (+ a 1.0))))
(if (<= t -2.9e-152)
t_1
(if (<= t 3.9e-122)
(/ z b)
(if (<= t 4.3e-95)
t_1
(if (<= t 2.6e-53)
(/ z b)
(if (<= t 8e+68) (/ x (+ 1.0 (+ a (/ (* y b) t)))) t_1)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x + (z / (t / y))) / (a + 1.0);
double tmp;
if (t <= -2.9e-152) {
tmp = t_1;
} else if (t <= 3.9e-122) {
tmp = z / b;
} else if (t <= 4.3e-95) {
tmp = t_1;
} else if (t <= 2.6e-53) {
tmp = z / b;
} else if (t <= 8e+68) {
tmp = x / (1.0 + (a + ((y * b) / t)));
} 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 + (z / (t / y))) / (a + 1.0d0)
if (t <= (-2.9d-152)) then
tmp = t_1
else if (t <= 3.9d-122) then
tmp = z / b
else if (t <= 4.3d-95) then
tmp = t_1
else if (t <= 2.6d-53) then
tmp = z / b
else if (t <= 8d+68) then
tmp = x / (1.0d0 + (a + ((y * b) / t)))
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 + (z / (t / y))) / (a + 1.0);
double tmp;
if (t <= -2.9e-152) {
tmp = t_1;
} else if (t <= 3.9e-122) {
tmp = z / b;
} else if (t <= 4.3e-95) {
tmp = t_1;
} else if (t <= 2.6e-53) {
tmp = z / b;
} else if (t <= 8e+68) {
tmp = x / (1.0 + (a + ((y * b) / t)));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (x + (z / (t / y))) / (a + 1.0) tmp = 0 if t <= -2.9e-152: tmp = t_1 elif t <= 3.9e-122: tmp = z / b elif t <= 4.3e-95: tmp = t_1 elif t <= 2.6e-53: tmp = z / b elif t <= 8e+68: tmp = x / (1.0 + (a + ((y * b) / t))) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(x + Float64(z / Float64(t / y))) / Float64(a + 1.0)) tmp = 0.0 if (t <= -2.9e-152) tmp = t_1; elseif (t <= 3.9e-122) tmp = Float64(z / b); elseif (t <= 4.3e-95) tmp = t_1; elseif (t <= 2.6e-53) tmp = Float64(z / b); elseif (t <= 8e+68) tmp = Float64(x / Float64(1.0 + Float64(a + Float64(Float64(y * b) / t)))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (x + (z / (t / y))) / (a + 1.0); tmp = 0.0; if (t <= -2.9e-152) tmp = t_1; elseif (t <= 3.9e-122) tmp = z / b; elseif (t <= 4.3e-95) tmp = t_1; elseif (t <= 2.6e-53) tmp = z / b; elseif (t <= 8e+68) tmp = x / (1.0 + (a + ((y * b) / t))); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(x + N[(z / N[(t / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(a + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -2.9e-152], t$95$1, If[LessEqual[t, 3.9e-122], N[(z / b), $MachinePrecision], If[LessEqual[t, 4.3e-95], t$95$1, If[LessEqual[t, 2.6e-53], N[(z / b), $MachinePrecision], If[LessEqual[t, 8e+68], N[(x / N[(1.0 + N[(a + N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x + \frac{z}{\frac{t}{y}}}{a + 1}\\
\mathbf{if}\;t \leq -2.9 \cdot 10^{-152}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 3.9 \cdot 10^{-122}:\\
\;\;\;\;\frac{z}{b}\\
\mathbf{elif}\;t \leq 4.3 \cdot 10^{-95}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 2.6 \cdot 10^{-53}:\\
\;\;\;\;\frac{z}{b}\\
\mathbf{elif}\;t \leq 8 \cdot 10^{+68}:\\
\;\;\;\;\frac{x}{1 + \left(a + \frac{y \cdot b}{t}\right)}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if t < -2.9000000000000001e-152 or 3.8999999999999999e-122 < t < 4.29999999999999997e-95 or 7.99999999999999962e68 < t Initial program 79.3%
*-commutative79.3%
associate-/l*83.9%
associate-*l/89.6%
Simplified89.6%
Taylor expanded in y around 0 75.4%
if -2.9000000000000001e-152 < t < 3.8999999999999999e-122 or 4.29999999999999997e-95 < t < 2.59999999999999996e-53Initial program 53.0%
*-commutative53.0%
associate-/l*48.2%
associate-*l/40.5%
Simplified40.5%
Taylor expanded in t around 0 74.9%
if 2.59999999999999996e-53 < t < 7.99999999999999962e68Initial program 93.4%
*-commutative93.4%
associate-/l*93.3%
associate-*l/93.3%
Simplified93.3%
Taylor expanded in x around inf 73.5%
Final simplification75.0%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (+ x (/ z (/ t y))) (+ a 1.0))))
(if (<= t -8e-152)
t_1
(if (<= t 1.08e-121)
(/ z b)
(if (or (<= t 4.3e-97) (not (<= t 8.5e-51)))
t_1
(/ (* t (+ x (/ (* y z) t))) (* y b)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x + (z / (t / y))) / (a + 1.0);
double tmp;
if (t <= -8e-152) {
tmp = t_1;
} else if (t <= 1.08e-121) {
tmp = z / b;
} else if ((t <= 4.3e-97) || !(t <= 8.5e-51)) {
tmp = t_1;
} else {
tmp = (t * (x + ((y * z) / t))) / (y * b);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = (x + (z / (t / y))) / (a + 1.0d0)
if (t <= (-8d-152)) then
tmp = t_1
else if (t <= 1.08d-121) then
tmp = z / b
else if ((t <= 4.3d-97) .or. (.not. (t <= 8.5d-51))) then
tmp = t_1
else
tmp = (t * (x + ((y * z) / t))) / (y * b)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x + (z / (t / y))) / (a + 1.0);
double tmp;
if (t <= -8e-152) {
tmp = t_1;
} else if (t <= 1.08e-121) {
tmp = z / b;
} else if ((t <= 4.3e-97) || !(t <= 8.5e-51)) {
tmp = t_1;
} else {
tmp = (t * (x + ((y * z) / t))) / (y * b);
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (x + (z / (t / y))) / (a + 1.0) tmp = 0 if t <= -8e-152: tmp = t_1 elif t <= 1.08e-121: tmp = z / b elif (t <= 4.3e-97) or not (t <= 8.5e-51): tmp = t_1 else: tmp = (t * (x + ((y * z) / t))) / (y * b) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(x + Float64(z / Float64(t / y))) / Float64(a + 1.0)) tmp = 0.0 if (t <= -8e-152) tmp = t_1; elseif (t <= 1.08e-121) tmp = Float64(z / b); elseif ((t <= 4.3e-97) || !(t <= 8.5e-51)) tmp = t_1; else tmp = Float64(Float64(t * Float64(x + Float64(Float64(y * z) / t))) / Float64(y * b)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (x + (z / (t / y))) / (a + 1.0); tmp = 0.0; if (t <= -8e-152) tmp = t_1; elseif (t <= 1.08e-121) tmp = z / b; elseif ((t <= 4.3e-97) || ~((t <= 8.5e-51))) tmp = t_1; else tmp = (t * (x + ((y * z) / t))) / (y * b); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(x + N[(z / N[(t / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(a + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -8e-152], t$95$1, If[LessEqual[t, 1.08e-121], N[(z / b), $MachinePrecision], If[Or[LessEqual[t, 4.3e-97], N[Not[LessEqual[t, 8.5e-51]], $MachinePrecision]], t$95$1, N[(N[(t * N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(y * b), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x + \frac{z}{\frac{t}{y}}}{a + 1}\\
\mathbf{if}\;t \leq -8 \cdot 10^{-152}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 1.08 \cdot 10^{-121}:\\
\;\;\;\;\frac{z}{b}\\
\mathbf{elif}\;t \leq 4.3 \cdot 10^{-97} \lor \neg \left(t \leq 8.5 \cdot 10^{-51}\right):\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\frac{t \cdot \left(x + \frac{y \cdot z}{t}\right)}{y \cdot b}\\
\end{array}
\end{array}
if t < -8.00000000000000053e-152 or 1.08000000000000004e-121 < t < 4.3e-97 or 8.50000000000000036e-51 < t Initial program 81.5%
*-commutative81.5%
associate-/l*85.4%
associate-*l/90.2%
Simplified90.2%
Taylor expanded in y around 0 73.5%
if -8.00000000000000053e-152 < t < 1.08000000000000004e-121Initial program 53.0%
*-commutative53.0%
associate-/l*47.7%
associate-*l/40.1%
Simplified40.1%
Taylor expanded in t around 0 76.8%
if 4.3e-97 < t < 8.50000000000000036e-51Initial program 56.9%
*-commutative56.9%
associate-/l*56.0%
associate-*l/47.9%
Simplified47.9%
Taylor expanded in b around inf 65.1%
Final simplification74.0%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* b (/ y t))))
(if (or (<= t -4.2e-57) (not (<= t 6.5e-123)))
(/ (+ x (* z (/ y t))) (+ (+ a 1.0) t_1))
(+ (/ z b) (/ x (+ 1.0 (+ a t_1)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = b * (y / t);
double tmp;
if ((t <= -4.2e-57) || !(t <= 6.5e-123)) {
tmp = (x + (z * (y / t))) / ((a + 1.0) + t_1);
} else {
tmp = (z / b) + (x / (1.0 + (a + 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 = b * (y / t)
if ((t <= (-4.2d-57)) .or. (.not. (t <= 6.5d-123))) then
tmp = (x + (z * (y / t))) / ((a + 1.0d0) + t_1)
else
tmp = (z / b) + (x / (1.0d0 + (a + 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 = b * (y / t);
double tmp;
if ((t <= -4.2e-57) || !(t <= 6.5e-123)) {
tmp = (x + (z * (y / t))) / ((a + 1.0) + t_1);
} else {
tmp = (z / b) + (x / (1.0 + (a + t_1)));
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = b * (y / t) tmp = 0 if (t <= -4.2e-57) or not (t <= 6.5e-123): tmp = (x + (z * (y / t))) / ((a + 1.0) + t_1) else: tmp = (z / b) + (x / (1.0 + (a + t_1))) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(b * Float64(y / t)) tmp = 0.0 if ((t <= -4.2e-57) || !(t <= 6.5e-123)) tmp = Float64(Float64(x + Float64(z * Float64(y / t))) / Float64(Float64(a + 1.0) + t_1)); else tmp = Float64(Float64(z / b) + Float64(x / Float64(1.0 + Float64(a + t_1)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = b * (y / t); tmp = 0.0; if ((t <= -4.2e-57) || ~((t <= 6.5e-123))) tmp = (x + (z * (y / t))) / ((a + 1.0) + t_1); else tmp = (z / b) + (x / (1.0 + (a + t_1))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(b * N[(y / t), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t, -4.2e-57], N[Not[LessEqual[t, 6.5e-123]], $MachinePrecision]], N[(N[(x + N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(a + 1.0), $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision], N[(N[(z / b), $MachinePrecision] + N[(x / N[(1.0 + N[(a + t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := b \cdot \frac{y}{t}\\
\mathbf{if}\;t \leq -4.2 \cdot 10^{-57} \lor \neg \left(t \leq 6.5 \cdot 10^{-123}\right):\\
\;\;\;\;\frac{x + z \cdot \frac{y}{t}}{\left(a + 1\right) + t_1}\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{b} + \frac{x}{1 + \left(a + t_1\right)}\\
\end{array}
\end{array}
if t < -4.1999999999999999e-57 or 6.49999999999999938e-123 < t Initial program 82.7%
*-commutative82.7%
associate-/l*86.8%
associate-*l/91.3%
Simplified91.3%
Taylor expanded in z around 0 86.1%
associate-*l/91.4%
*-commutative91.4%
Simplified91.4%
if -4.1999999999999999e-57 < t < 6.49999999999999938e-123Initial program 54.8%
*-commutative54.8%
associate-/l*50.8%
associate-*l/45.0%
Simplified45.0%
associate-*l/50.8%
clear-num50.8%
Applied egg-rr50.8%
Taylor expanded in x around 0 63.7%
times-frac53.8%
*-commutative53.8%
associate-*r/48.2%
*-commutative48.2%
associate-*r/48.2%
Simplified48.2%
Taylor expanded in y around inf 80.2%
Final simplification87.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* b (/ y t))) (t_2 (+ (+ a 1.0) t_1)))
(if (<= t -3.2e-57)
(/ (+ x (* y (/ z t))) t_2)
(if (<= t 5.6e-123)
(+ (/ z b) (/ x (+ 1.0 (+ a t_1))))
(/ (+ x (* z (/ y t))) t_2)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = b * (y / t);
double t_2 = (a + 1.0) + t_1;
double tmp;
if (t <= -3.2e-57) {
tmp = (x + (y * (z / t))) / t_2;
} else if (t <= 5.6e-123) {
tmp = (z / b) + (x / (1.0 + (a + t_1)));
} else {
tmp = (x + (z * (y / t))) / 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 = b * (y / t)
t_2 = (a + 1.0d0) + t_1
if (t <= (-3.2d-57)) then
tmp = (x + (y * (z / t))) / t_2
else if (t <= 5.6d-123) then
tmp = (z / b) + (x / (1.0d0 + (a + t_1)))
else
tmp = (x + (z * (y / t))) / 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 = b * (y / t);
double t_2 = (a + 1.0) + t_1;
double tmp;
if (t <= -3.2e-57) {
tmp = (x + (y * (z / t))) / t_2;
} else if (t <= 5.6e-123) {
tmp = (z / b) + (x / (1.0 + (a + t_1)));
} else {
tmp = (x + (z * (y / t))) / t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = b * (y / t) t_2 = (a + 1.0) + t_1 tmp = 0 if t <= -3.2e-57: tmp = (x + (y * (z / t))) / t_2 elif t <= 5.6e-123: tmp = (z / b) + (x / (1.0 + (a + t_1))) else: tmp = (x + (z * (y / t))) / t_2 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(b * Float64(y / t)) t_2 = Float64(Float64(a + 1.0) + t_1) tmp = 0.0 if (t <= -3.2e-57) tmp = Float64(Float64(x + Float64(y * Float64(z / t))) / t_2); elseif (t <= 5.6e-123) tmp = Float64(Float64(z / b) + Float64(x / Float64(1.0 + Float64(a + t_1)))); else tmp = Float64(Float64(x + Float64(z * Float64(y / t))) / t_2); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = b * (y / t); t_2 = (a + 1.0) + t_1; tmp = 0.0; if (t <= -3.2e-57) tmp = (x + (y * (z / t))) / t_2; elseif (t <= 5.6e-123) tmp = (z / b) + (x / (1.0 + (a + t_1))); else tmp = (x + (z * (y / t))) / t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(b * N[(y / t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(a + 1.0), $MachinePrecision] + t$95$1), $MachinePrecision]}, If[LessEqual[t, -3.2e-57], N[(N[(x + N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$2), $MachinePrecision], If[LessEqual[t, 5.6e-123], N[(N[(z / b), $MachinePrecision] + N[(x / N[(1.0 + N[(a + t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x + N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$2), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := b \cdot \frac{y}{t}\\
t_2 := \left(a + 1\right) + t_1\\
\mathbf{if}\;t \leq -3.2 \cdot 10^{-57}:\\
\;\;\;\;\frac{x + y \cdot \frac{z}{t}}{t_2}\\
\mathbf{elif}\;t \leq 5.6 \cdot 10^{-123}:\\
\;\;\;\;\frac{z}{b} + \frac{x}{1 + \left(a + t_1\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{x + z \cdot \frac{y}{t}}{t_2}\\
\end{array}
\end{array}
if t < -3.2000000000000001e-57Initial program 81.0%
*-commutative81.0%
associate-/l*85.3%
associate-*l/93.3%
Simplified93.3%
associate-/r/95.9%
Applied egg-rr95.9%
if -3.2000000000000001e-57 < t < 5.5999999999999998e-123Initial program 54.8%
*-commutative54.8%
associate-/l*50.8%
associate-*l/45.0%
Simplified45.0%
associate-*l/50.8%
clear-num50.8%
Applied egg-rr50.8%
Taylor expanded in x around 0 63.7%
times-frac53.8%
*-commutative53.8%
associate-*r/48.2%
*-commutative48.2%
associate-*r/48.2%
Simplified48.2%
Taylor expanded in y around inf 80.2%
if 5.5999999999999998e-123 < t Initial program 83.9%
*-commutative83.9%
associate-/l*87.8%
associate-*l/89.9%
Simplified89.9%
Taylor expanded in z around 0 84.9%
associate-*l/89.9%
*-commutative89.9%
Simplified89.9%
Final simplification88.1%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* b (/ y t))) (t_2 (+ (+ a 1.0) t_1)))
(if (<= t -4.5e-57)
(/ (+ x (* y (/ z t))) t_2)
(if (<= t 3.4e-121)
(+ (/ z b) (/ x (+ 1.0 (+ a t_1))))
(/ (+ x (/ z (/ t y))) t_2)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = b * (y / t);
double t_2 = (a + 1.0) + t_1;
double tmp;
if (t <= -4.5e-57) {
tmp = (x + (y * (z / t))) / t_2;
} else if (t <= 3.4e-121) {
tmp = (z / b) + (x / (1.0 + (a + t_1)));
} else {
tmp = (x + (z / (t / y))) / 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 = b * (y / t)
t_2 = (a + 1.0d0) + t_1
if (t <= (-4.5d-57)) then
tmp = (x + (y * (z / t))) / t_2
else if (t <= 3.4d-121) then
tmp = (z / b) + (x / (1.0d0 + (a + t_1)))
else
tmp = (x + (z / (t / y))) / 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 = b * (y / t);
double t_2 = (a + 1.0) + t_1;
double tmp;
if (t <= -4.5e-57) {
tmp = (x + (y * (z / t))) / t_2;
} else if (t <= 3.4e-121) {
tmp = (z / b) + (x / (1.0 + (a + t_1)));
} else {
tmp = (x + (z / (t / y))) / t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = b * (y / t) t_2 = (a + 1.0) + t_1 tmp = 0 if t <= -4.5e-57: tmp = (x + (y * (z / t))) / t_2 elif t <= 3.4e-121: tmp = (z / b) + (x / (1.0 + (a + t_1))) else: tmp = (x + (z / (t / y))) / t_2 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(b * Float64(y / t)) t_2 = Float64(Float64(a + 1.0) + t_1) tmp = 0.0 if (t <= -4.5e-57) tmp = Float64(Float64(x + Float64(y * Float64(z / t))) / t_2); elseif (t <= 3.4e-121) tmp = Float64(Float64(z / b) + Float64(x / Float64(1.0 + Float64(a + t_1)))); else tmp = Float64(Float64(x + Float64(z / Float64(t / y))) / t_2); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = b * (y / t); t_2 = (a + 1.0) + t_1; tmp = 0.0; if (t <= -4.5e-57) tmp = (x + (y * (z / t))) / t_2; elseif (t <= 3.4e-121) tmp = (z / b) + (x / (1.0 + (a + t_1))); else tmp = (x + (z / (t / y))) / t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(b * N[(y / t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(a + 1.0), $MachinePrecision] + t$95$1), $MachinePrecision]}, If[LessEqual[t, -4.5e-57], N[(N[(x + N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$2), $MachinePrecision], If[LessEqual[t, 3.4e-121], N[(N[(z / b), $MachinePrecision] + N[(x / N[(1.0 + N[(a + t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x + N[(z / N[(t / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$2), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := b \cdot \frac{y}{t}\\
t_2 := \left(a + 1\right) + t_1\\
\mathbf{if}\;t \leq -4.5 \cdot 10^{-57}:\\
\;\;\;\;\frac{x + y \cdot \frac{z}{t}}{t_2}\\
\mathbf{elif}\;t \leq 3.4 \cdot 10^{-121}:\\
\;\;\;\;\frac{z}{b} + \frac{x}{1 + \left(a + t_1\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{x + \frac{z}{\frac{t}{y}}}{t_2}\\
\end{array}
\end{array}
if t < -4.49999999999999973e-57Initial program 81.0%
*-commutative81.0%
associate-/l*85.3%
associate-*l/93.3%
Simplified93.3%
associate-/r/95.9%
Applied egg-rr95.9%
if -4.49999999999999973e-57 < t < 3.40000000000000001e-121Initial program 54.8%
*-commutative54.8%
associate-/l*50.8%
associate-*l/45.0%
Simplified45.0%
associate-*l/50.8%
clear-num50.8%
Applied egg-rr50.8%
Taylor expanded in x around 0 63.7%
times-frac53.8%
*-commutative53.8%
associate-*r/48.2%
*-commutative48.2%
associate-*r/48.2%
Simplified48.2%
Taylor expanded in y around inf 80.2%
if 3.40000000000000001e-121 < t Initial program 83.9%
*-commutative83.9%
associate-/l*87.8%
associate-*l/89.9%
Simplified89.9%
Final simplification88.1%
(FPCore (x y z t a b) :precision binary64 (if (or (<= t -1.65e-152) (not (<= t 1.12e-122))) (/ x (+ 1.0 (+ a (* b (/ y t))))) (/ z b)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -1.65e-152) || !(t <= 1.12e-122)) {
tmp = x / (1.0 + (a + (b * (y / t))));
} 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.65d-152)) .or. (.not. (t <= 1.12d-122))) then
tmp = x / (1.0d0 + (a + (b * (y / t))))
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.65e-152) || !(t <= 1.12e-122)) {
tmp = x / (1.0 + (a + (b * (y / t))));
} else {
tmp = z / b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (t <= -1.65e-152) or not (t <= 1.12e-122): tmp = x / (1.0 + (a + (b * (y / t)))) else: tmp = z / b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((t <= -1.65e-152) || !(t <= 1.12e-122)) tmp = Float64(x / Float64(1.0 + Float64(a + Float64(b * Float64(y / t))))); 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.65e-152) || ~((t <= 1.12e-122))) tmp = x / (1.0 + (a + (b * (y / t)))); else tmp = z / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[t, -1.65e-152], N[Not[LessEqual[t, 1.12e-122]], $MachinePrecision]], N[(x / N[(1.0 + N[(a + N[(b * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z / b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.65 \cdot 10^{-152} \lor \neg \left(t \leq 1.12 \cdot 10^{-122}\right):\\
\;\;\;\;\frac{x}{1 + \left(a + b \cdot \frac{y}{t}\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{b}\\
\end{array}
\end{array}
if t < -1.64999999999999999e-152 or 1.12e-122 < t Initial program 80.1%
*-commutative80.1%
associate-/l*83.7%
associate-*l/87.7%
Simplified87.7%
associate-*l/83.7%
clear-num83.6%
Applied egg-rr83.6%
Taylor expanded in x around inf 65.8%
*-commutative65.8%
associate-*r/67.9%
Simplified67.9%
if -1.64999999999999999e-152 < t < 1.12e-122Initial program 53.0%
*-commutative53.0%
associate-/l*47.7%
associate-*l/40.1%
Simplified40.1%
Taylor expanded in t around 0 76.8%
Final simplification70.3%
(FPCore (x y z t a b)
:precision binary64
(if (<= y -38.0)
(/ z b)
(if (<= y 4.2e-289)
(/ x a)
(if (<= y 5.2e-245) x (if (<= y 1.7e-117) (/ x a) (/ z b))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -38.0) {
tmp = z / b;
} else if (y <= 4.2e-289) {
tmp = x / a;
} else if (y <= 5.2e-245) {
tmp = x;
} else if (y <= 1.7e-117) {
tmp = x / a;
} 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 (y <= (-38.0d0)) then
tmp = z / b
else if (y <= 4.2d-289) then
tmp = x / a
else if (y <= 5.2d-245) then
tmp = x
else if (y <= 1.7d-117) then
tmp = x / a
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 (y <= -38.0) {
tmp = z / b;
} else if (y <= 4.2e-289) {
tmp = x / a;
} else if (y <= 5.2e-245) {
tmp = x;
} else if (y <= 1.7e-117) {
tmp = x / a;
} else {
tmp = z / b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -38.0: tmp = z / b elif y <= 4.2e-289: tmp = x / a elif y <= 5.2e-245: tmp = x elif y <= 1.7e-117: tmp = x / a else: tmp = z / b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -38.0) tmp = Float64(z / b); elseif (y <= 4.2e-289) tmp = Float64(x / a); elseif (y <= 5.2e-245) tmp = x; elseif (y <= 1.7e-117) tmp = Float64(x / a); else tmp = Float64(z / b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= -38.0) tmp = z / b; elseif (y <= 4.2e-289) tmp = x / a; elseif (y <= 5.2e-245) tmp = x; elseif (y <= 1.7e-117) tmp = x / a; else tmp = z / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -38.0], N[(z / b), $MachinePrecision], If[LessEqual[y, 4.2e-289], N[(x / a), $MachinePrecision], If[LessEqual[y, 5.2e-245], x, If[LessEqual[y, 1.7e-117], N[(x / a), $MachinePrecision], N[(z / b), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -38:\\
\;\;\;\;\frac{z}{b}\\
\mathbf{elif}\;y \leq 4.2 \cdot 10^{-289}:\\
\;\;\;\;\frac{x}{a}\\
\mathbf{elif}\;y \leq 5.2 \cdot 10^{-245}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 1.7 \cdot 10^{-117}:\\
\;\;\;\;\frac{x}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{b}\\
\end{array}
\end{array}
if y < -38 or 1.70000000000000017e-117 < y Initial program 55.3%
*-commutative55.3%
associate-/l*57.9%
associate-*l/59.6%
Simplified59.6%
Taylor expanded in t around 0 49.3%
if -38 < y < 4.1999999999999995e-289 or 5.20000000000000013e-245 < y < 1.70000000000000017e-117Initial program 93.2%
*-commutative93.2%
associate-/l*92.8%
associate-*l/92.9%
Simplified92.9%
Taylor expanded in t around inf 67.3%
Taylor expanded in a around inf 45.4%
if 4.1999999999999995e-289 < y < 5.20000000000000013e-245Initial program 99.7%
*-commutative99.7%
associate-/l*99.5%
associate-*l/99.5%
Simplified99.5%
Taylor expanded in t around inf 80.9%
Taylor expanded in a around 0 73.0%
Final simplification48.6%
(FPCore (x y z t a b)
:precision binary64
(if (<= y -3000.0)
(/ z b)
(if (<= y 8.4e-280)
(/ x a)
(if (<= y 1.9e-249) (- x (* x a)) (if (<= y 2.4e-120) (/ x a) (/ z b))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -3000.0) {
tmp = z / b;
} else if (y <= 8.4e-280) {
tmp = x / a;
} else if (y <= 1.9e-249) {
tmp = x - (x * a);
} else if (y <= 2.4e-120) {
tmp = x / a;
} 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 (y <= (-3000.0d0)) then
tmp = z / b
else if (y <= 8.4d-280) then
tmp = x / a
else if (y <= 1.9d-249) then
tmp = x - (x * a)
else if (y <= 2.4d-120) then
tmp = x / a
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 (y <= -3000.0) {
tmp = z / b;
} else if (y <= 8.4e-280) {
tmp = x / a;
} else if (y <= 1.9e-249) {
tmp = x - (x * a);
} else if (y <= 2.4e-120) {
tmp = x / a;
} else {
tmp = z / b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -3000.0: tmp = z / b elif y <= 8.4e-280: tmp = x / a elif y <= 1.9e-249: tmp = x - (x * a) elif y <= 2.4e-120: tmp = x / a else: tmp = z / b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -3000.0) tmp = Float64(z / b); elseif (y <= 8.4e-280) tmp = Float64(x / a); elseif (y <= 1.9e-249) tmp = Float64(x - Float64(x * a)); elseif (y <= 2.4e-120) tmp = Float64(x / a); else tmp = Float64(z / b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= -3000.0) tmp = z / b; elseif (y <= 8.4e-280) tmp = x / a; elseif (y <= 1.9e-249) tmp = x - (x * a); elseif (y <= 2.4e-120) tmp = x / a; else tmp = z / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -3000.0], N[(z / b), $MachinePrecision], If[LessEqual[y, 8.4e-280], N[(x / a), $MachinePrecision], If[LessEqual[y, 1.9e-249], N[(x - N[(x * a), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.4e-120], N[(x / a), $MachinePrecision], N[(z / b), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3000:\\
\;\;\;\;\frac{z}{b}\\
\mathbf{elif}\;y \leq 8.4 \cdot 10^{-280}:\\
\;\;\;\;\frac{x}{a}\\
\mathbf{elif}\;y \leq 1.9 \cdot 10^{-249}:\\
\;\;\;\;x - x \cdot a\\
\mathbf{elif}\;y \leq 2.4 \cdot 10^{-120}:\\
\;\;\;\;\frac{x}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{b}\\
\end{array}
\end{array}
if y < -3e3 or 2.3999999999999999e-120 < y Initial program 55.3%
*-commutative55.3%
associate-/l*57.9%
associate-*l/59.6%
Simplified59.6%
Taylor expanded in t around 0 49.3%
if -3e3 < y < 8.40000000000000003e-280 or 1.9e-249 < y < 2.3999999999999999e-120Initial program 93.2%
*-commutative93.2%
associate-/l*92.8%
associate-*l/92.9%
Simplified92.9%
Taylor expanded in t around inf 67.3%
Taylor expanded in a around inf 45.4%
if 8.40000000000000003e-280 < y < 1.9e-249Initial program 99.7%
*-commutative99.7%
associate-/l*99.5%
associate-*l/99.5%
Simplified99.5%
Taylor expanded in t around inf 80.9%
Taylor expanded in a around 0 74.5%
+-commutative74.5%
mul-1-neg74.5%
unsub-neg74.5%
Simplified74.5%
Final simplification48.7%
(FPCore (x y z t a b) :precision binary64 (if (<= y -2.8e+136) (/ z b) (if (<= y 5.6e-48) (/ x (+ a 1.0)) (/ z b))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -2.8e+136) {
tmp = z / b;
} else if (y <= 5.6e-48) {
tmp = x / (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 (y <= (-2.8d+136)) then
tmp = z / b
else if (y <= 5.6d-48) then
tmp = x / (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 (y <= -2.8e+136) {
tmp = z / b;
} else if (y <= 5.6e-48) {
tmp = x / (a + 1.0);
} else {
tmp = z / b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -2.8e+136: tmp = z / b elif y <= 5.6e-48: tmp = x / (a + 1.0) else: tmp = z / b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -2.8e+136) tmp = Float64(z / b); elseif (y <= 5.6e-48) tmp = Float64(x / 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 (y <= -2.8e+136) tmp = z / b; elseif (y <= 5.6e-48) tmp = x / (a + 1.0); else tmp = z / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -2.8e+136], N[(z / b), $MachinePrecision], If[LessEqual[y, 5.6e-48], N[(x / N[(a + 1.0), $MachinePrecision]), $MachinePrecision], N[(z / b), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.8 \cdot 10^{+136}:\\
\;\;\;\;\frac{z}{b}\\
\mathbf{elif}\;y \leq 5.6 \cdot 10^{-48}:\\
\;\;\;\;\frac{x}{a + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{b}\\
\end{array}
\end{array}
if y < -2.8000000000000002e136 or 5.6000000000000001e-48 < y Initial program 48.1%
*-commutative48.1%
associate-/l*51.4%
associate-*l/53.5%
Simplified53.5%
Taylor expanded in t around 0 56.0%
if -2.8000000000000002e136 < y < 5.6000000000000001e-48Initial program 91.6%
*-commutative91.6%
associate-/l*91.2%
associate-*l/91.3%
Simplified91.3%
Taylor expanded in t around inf 63.5%
Final simplification60.3%
(FPCore (x y z t a b) :precision binary64 (if (<= a -1.0) (/ x a) (if (<= a 1.0) x (/ x a))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -1.0) {
tmp = x / a;
} else if (a <= 1.0) {
tmp = x;
} 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.0d0)) then
tmp = x / a
else if (a <= 1.0d0) then
tmp = x
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.0) {
tmp = x / a;
} else if (a <= 1.0) {
tmp = x;
} else {
tmp = x / a;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if a <= -1.0: tmp = x / a elif a <= 1.0: tmp = x else: tmp = x / a return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (a <= -1.0) tmp = Float64(x / a); elseif (a <= 1.0) tmp = x; 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.0) tmp = x / a; elseif (a <= 1.0) tmp = x; else tmp = x / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, -1.0], N[(x / a), $MachinePrecision], If[LessEqual[a, 1.0], x, N[(x / a), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1:\\
\;\;\;\;\frac{x}{a}\\
\mathbf{elif}\;a \leq 1:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{a}\\
\end{array}
\end{array}
if a < -1 or 1 < a Initial program 75.2%
*-commutative75.2%
associate-/l*75.4%
associate-*l/77.6%
Simplified77.6%
Taylor expanded in t around inf 55.5%
Taylor expanded in a around inf 54.3%
if -1 < a < 1Initial program 70.9%
*-commutative70.9%
associate-/l*73.0%
associate-*l/72.9%
Simplified72.9%
Taylor expanded in t around inf 35.0%
Taylor expanded in a around 0 33.8%
Final simplification43.3%
(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 72.9%
*-commutative72.9%
associate-/l*74.1%
associate-*l/75.1%
Simplified75.1%
Taylor expanded in t around inf 44.5%
Taylor expanded in a around 0 19.9%
Final simplification19.9%
(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 2023200
(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))))