
(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)) (+ (+ a 1.0) (/ (* y b) t)))))
(if (<= t_1 (- INFINITY))
(/ (* y (/ z (+ 1.0 (fma y (/ b t) a)))) t)
(if (<= t_1 -4e-298)
t_1
(if (<= t_1 0.0)
(* (/ t y) (/ (fma y (/ z t) x) b))
(if (<= t_1 2e+284) t_1 (/ z b)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t));
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = (y * (z / (1.0 + fma(y, (b / t), a)))) / t;
} else if (t_1 <= -4e-298) {
tmp = t_1;
} else if (t_1 <= 0.0) {
tmp = (t / y) * (fma(y, (z / t), x) / b);
} else if (t_1 <= 2e+284) {
tmp = t_1;
} 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(a + 1.0) + Float64(Float64(y * b) / t))) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = Float64(Float64(y * Float64(z / Float64(1.0 + fma(y, Float64(b / t), a)))) / t); elseif (t_1 <= -4e-298) tmp = t_1; elseif (t_1 <= 0.0) tmp = Float64(Float64(t / y) * Float64(fma(y, Float64(z / t), x) / b)); elseif (t_1 <= 2e+284) tmp = t_1; 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[(a + 1.0), $MachinePrecision] + N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(N[(y * N[(z / N[(1.0 + N[(y * N[(b / t), $MachinePrecision] + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[t$95$1, -4e-298], t$95$1, If[LessEqual[t$95$1, 0.0], N[(N[(t / y), $MachinePrecision] * N[(N[(y * N[(z / t), $MachinePrecision] + x), $MachinePrecision] / b), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2e+284], t$95$1, N[(z / b), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}}\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;\frac{y \cdot \frac{z}{1 + \mathsf{fma}\left(y, \frac{b}{t}, a\right)}}{t}\\
\mathbf{elif}\;t\_1 \leq -4 \cdot 10^{-298}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_1 \leq 0:\\
\;\;\;\;\frac{t}{y} \cdot \frac{\mathsf{fma}\left(y, \frac{z}{t}, x\right)}{b}\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+284}:\\
\;\;\;\;t\_1\\
\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.1%
associate-/l*52.1%
associate-/l*52.2%
Simplified52.2%
Taylor expanded in x around 0 61.1%
times-frac89.6%
associate-*l/89.9%
*-commutative89.9%
Simplified89.9%
associate-*l/99.4%
+-commutative99.4%
fma-define99.4%
Applied egg-rr99.4%
if -inf.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < -3.99999999999999965e-298 or 0.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < 2.00000000000000016e284Initial program 99.7%
if -3.99999999999999965e-298 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < 0.0Initial program 49.9%
associate-/l*49.7%
associate-/l*64.5%
Simplified64.5%
Taylor expanded in a around 0 31.5%
associate-*r/46.4%
*-commutative46.4%
Applied egg-rr46.4%
Taylor expanded in b around inf 57.0%
+-commutative57.0%
*-commutative57.0%
associate-*r/46.6%
fma-undefine46.6%
*-commutative46.6%
times-frac73.9%
fma-undefine73.9%
associate-*r/77.5%
*-commutative77.5%
associate-/l*72.3%
fma-undefine72.3%
Simplified72.3%
if 2.00000000000000016e284 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) Initial program 15.9%
associate-/l*19.1%
associate-/l*38.5%
Simplified38.5%
Taylor expanded in y around inf 85.5%
Final simplification93.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (+ x (/ (* y z) t)) (+ (+ a 1.0) (/ (* y b) t)))))
(if (<= t_1 -5e+293)
(* (/ y t) (/ z (+ 1.0 (+ a (* y (/ b t))))))
(if (<= t_1 -4e-298)
t_1
(if (<= t_1 0.0)
(* (/ t y) (/ (fma y (/ z t) x) b))
(if (<= t_1 2e+284) t_1 (/ z b)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t));
double tmp;
if (t_1 <= -5e+293) {
tmp = (y / t) * (z / (1.0 + (a + (y * (b / t)))));
} else if (t_1 <= -4e-298) {
tmp = t_1;
} else if (t_1 <= 0.0) {
tmp = (t / y) * (fma(y, (z / t), x) / b);
} else if (t_1 <= 2e+284) {
tmp = t_1;
} 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(a + 1.0) + Float64(Float64(y * b) / t))) tmp = 0.0 if (t_1 <= -5e+293) tmp = Float64(Float64(y / t) * Float64(z / Float64(1.0 + Float64(a + Float64(y * Float64(b / t)))))); elseif (t_1 <= -4e-298) tmp = t_1; elseif (t_1 <= 0.0) tmp = Float64(Float64(t / y) * Float64(fma(y, Float64(z / t), x) / b)); elseif (t_1 <= 2e+284) tmp = t_1; 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[(a + 1.0), $MachinePrecision] + N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -5e+293], N[(N[(y / t), $MachinePrecision] * N[(z / N[(1.0 + N[(a + N[(y * N[(b / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, -4e-298], t$95$1, If[LessEqual[t$95$1, 0.0], N[(N[(t / y), $MachinePrecision] * N[(N[(y * N[(z / t), $MachinePrecision] + x), $MachinePrecision] / b), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2e+284], t$95$1, N[(z / b), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}}\\
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{+293}:\\
\;\;\;\;\frac{y}{t} \cdot \frac{z}{1 + \left(a + y \cdot \frac{b}{t}\right)}\\
\mathbf{elif}\;t\_1 \leq -4 \cdot 10^{-298}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_1 \leq 0:\\
\;\;\;\;\frac{t}{y} \cdot \frac{\mathsf{fma}\left(y, \frac{z}{t}, x\right)}{b}\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+284}:\\
\;\;\;\;t\_1\\
\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))) < -5.00000000000000033e293Initial program 39.0%
associate-/l*56.3%
associate-/l*56.4%
Simplified56.4%
Taylor expanded in x around 0 64.5%
times-frac90.6%
associate-*l/90.8%
*-commutative90.8%
Simplified90.8%
if -5.00000000000000033e293 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < -3.99999999999999965e-298 or 0.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < 2.00000000000000016e284Initial program 99.7%
if -3.99999999999999965e-298 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < 0.0Initial program 49.9%
associate-/l*49.7%
associate-/l*64.5%
Simplified64.5%
Taylor expanded in a around 0 31.5%
associate-*r/46.4%
*-commutative46.4%
Applied egg-rr46.4%
Taylor expanded in b around inf 57.0%
+-commutative57.0%
*-commutative57.0%
associate-*r/46.6%
fma-undefine46.6%
*-commutative46.6%
times-frac73.9%
fma-undefine73.9%
associate-*r/77.5%
*-commutative77.5%
associate-/l*72.3%
fma-undefine72.3%
Simplified72.3%
if 2.00000000000000016e284 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) Initial program 15.9%
associate-/l*19.1%
associate-/l*38.5%
Simplified38.5%
Taylor expanded in y around inf 85.5%
Final simplification93.1%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ x (/ (* y z) t))) (t_2 (/ t_1 (+ (+ a 1.0) (/ (* y b) t)))))
(if (<= t_2 -5e+293)
(* (/ y t) (/ z (+ 1.0 (+ a (* y (/ b t))))))
(if (<= t_2 2e+284) (/ t_1 (+ (* b (/ y t)) (+ a 1.0))) (/ z b)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x + ((y * z) / t);
double t_2 = t_1 / ((a + 1.0) + ((y * b) / t));
double tmp;
if (t_2 <= -5e+293) {
tmp = (y / t) * (z / (1.0 + (a + (y * (b / t)))));
} else if (t_2 <= 2e+284) {
tmp = t_1 / ((b * (y / 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) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = x + ((y * z) / t)
t_2 = t_1 / ((a + 1.0d0) + ((y * b) / t))
if (t_2 <= (-5d+293)) then
tmp = (y / t) * (z / (1.0d0 + (a + (y * (b / t)))))
else if (t_2 <= 2d+284) then
tmp = t_1 / ((b * (y / 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 t_1 = x + ((y * z) / t);
double t_2 = t_1 / ((a + 1.0) + ((y * b) / t));
double tmp;
if (t_2 <= -5e+293) {
tmp = (y / t) * (z / (1.0 + (a + (y * (b / t)))));
} else if (t_2 <= 2e+284) {
tmp = t_1 / ((b * (y / t)) + (a + 1.0));
} else {
tmp = z / b;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x + ((y * z) / t) t_2 = t_1 / ((a + 1.0) + ((y * b) / t)) tmp = 0 if t_2 <= -5e+293: tmp = (y / t) * (z / (1.0 + (a + (y * (b / t))))) elif t_2 <= 2e+284: tmp = t_1 / ((b * (y / t)) + (a + 1.0)) else: tmp = z / b return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x + Float64(Float64(y * z) / t)) t_2 = Float64(t_1 / Float64(Float64(a + 1.0) + Float64(Float64(y * b) / t))) tmp = 0.0 if (t_2 <= -5e+293) tmp = Float64(Float64(y / t) * Float64(z / Float64(1.0 + Float64(a + Float64(y * Float64(b / t)))))); elseif (t_2 <= 2e+284) tmp = Float64(t_1 / Float64(Float64(b * Float64(y / t)) + Float64(a + 1.0))); 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); t_2 = t_1 / ((a + 1.0) + ((y * b) / t)); tmp = 0.0; if (t_2 <= -5e+293) tmp = (y / t) * (z / (1.0 + (a + (y * (b / t))))); elseif (t_2 <= 2e+284) tmp = t_1 / ((b * (y / t)) + (a + 1.0)); else tmp = z / b; 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]}, Block[{t$95$2 = N[(t$95$1 / N[(N[(a + 1.0), $MachinePrecision] + N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -5e+293], N[(N[(y / t), $MachinePrecision] * N[(z / N[(1.0 + N[(a + N[(y * N[(b / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 2e+284], N[(t$95$1 / N[(N[(b * N[(y / t), $MachinePrecision]), $MachinePrecision] + N[(a + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z / b), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \frac{y \cdot z}{t}\\
t_2 := \frac{t\_1}{\left(a + 1\right) + \frac{y \cdot b}{t}}\\
\mathbf{if}\;t\_2 \leq -5 \cdot 10^{+293}:\\
\;\;\;\;\frac{y}{t} \cdot \frac{z}{1 + \left(a + y \cdot \frac{b}{t}\right)}\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+284}:\\
\;\;\;\;\frac{t\_1}{b \cdot \frac{y}{t} + \left(a + 1\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))) < -5.00000000000000033e293Initial program 39.0%
associate-/l*56.3%
associate-/l*56.4%
Simplified56.4%
Taylor expanded in x around 0 64.5%
times-frac90.6%
associate-*l/90.8%
*-commutative90.8%
Simplified90.8%
if -5.00000000000000033e293 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < 2.00000000000000016e284Initial program 90.5%
*-commutative90.5%
associate-/l*91.9%
Applied egg-rr91.9%
if 2.00000000000000016e284 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) Initial program 15.9%
associate-/l*19.1%
associate-/l*38.5%
Simplified38.5%
Taylor expanded in y around inf 85.5%
Final simplification90.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ x (+ 1.0 (+ a (* y (/ b t))))))
(t_2 (/ (+ x (* z (/ y t))) (+ a 1.0))))
(if (<= y -3.7e+156)
(/ z b)
(if (<= y -6.4e-28)
t_1
(if (<= y 3.7e-125)
t_2
(if (<= y 1850000000.0) t_1 (if (<= y 6e+52) t_2 (/ z b))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x / (1.0 + (a + (y * (b / t))));
double t_2 = (x + (z * (y / t))) / (a + 1.0);
double tmp;
if (y <= -3.7e+156) {
tmp = z / b;
} else if (y <= -6.4e-28) {
tmp = t_1;
} else if (y <= 3.7e-125) {
tmp = t_2;
} else if (y <= 1850000000.0) {
tmp = t_1;
} else if (y <= 6e+52) {
tmp = t_2;
} 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) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = x / (1.0d0 + (a + (y * (b / t))))
t_2 = (x + (z * (y / t))) / (a + 1.0d0)
if (y <= (-3.7d+156)) then
tmp = z / b
else if (y <= (-6.4d-28)) then
tmp = t_1
else if (y <= 3.7d-125) then
tmp = t_2
else if (y <= 1850000000.0d0) then
tmp = t_1
else if (y <= 6d+52) then
tmp = t_2
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 t_1 = x / (1.0 + (a + (y * (b / t))));
double t_2 = (x + (z * (y / t))) / (a + 1.0);
double tmp;
if (y <= -3.7e+156) {
tmp = z / b;
} else if (y <= -6.4e-28) {
tmp = t_1;
} else if (y <= 3.7e-125) {
tmp = t_2;
} else if (y <= 1850000000.0) {
tmp = t_1;
} else if (y <= 6e+52) {
tmp = t_2;
} else {
tmp = z / b;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x / (1.0 + (a + (y * (b / t)))) t_2 = (x + (z * (y / t))) / (a + 1.0) tmp = 0 if y <= -3.7e+156: tmp = z / b elif y <= -6.4e-28: tmp = t_1 elif y <= 3.7e-125: tmp = t_2 elif y <= 1850000000.0: tmp = t_1 elif y <= 6e+52: tmp = t_2 else: tmp = z / b return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x / Float64(1.0 + Float64(a + Float64(y * Float64(b / t))))) t_2 = Float64(Float64(x + Float64(z * Float64(y / t))) / Float64(a + 1.0)) tmp = 0.0 if (y <= -3.7e+156) tmp = Float64(z / b); elseif (y <= -6.4e-28) tmp = t_1; elseif (y <= 3.7e-125) tmp = t_2; elseif (y <= 1850000000.0) tmp = t_1; elseif (y <= 6e+52) tmp = t_2; else tmp = Float64(z / b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x / (1.0 + (a + (y * (b / t)))); t_2 = (x + (z * (y / t))) / (a + 1.0); tmp = 0.0; if (y <= -3.7e+156) tmp = z / b; elseif (y <= -6.4e-28) tmp = t_1; elseif (y <= 3.7e-125) tmp = t_2; elseif (y <= 1850000000.0) tmp = t_1; elseif (y <= 6e+52) tmp = t_2; else tmp = z / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x / N[(1.0 + N[(a + N[(y * N[(b / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x + N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(a + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -3.7e+156], N[(z / b), $MachinePrecision], If[LessEqual[y, -6.4e-28], t$95$1, If[LessEqual[y, 3.7e-125], t$95$2, If[LessEqual[y, 1850000000.0], t$95$1, If[LessEqual[y, 6e+52], t$95$2, N[(z / b), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{1 + \left(a + y \cdot \frac{b}{t}\right)}\\
t_2 := \frac{x + z \cdot \frac{y}{t}}{a + 1}\\
\mathbf{if}\;y \leq -3.7 \cdot 10^{+156}:\\
\;\;\;\;\frac{z}{b}\\
\mathbf{elif}\;y \leq -6.4 \cdot 10^{-28}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 3.7 \cdot 10^{-125}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;y \leq 1850000000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 6 \cdot 10^{+52}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{b}\\
\end{array}
\end{array}
if y < -3.70000000000000001e156 or 6e52 < y Initial program 41.8%
associate-/l*44.6%
associate-/l*60.1%
Simplified60.1%
Taylor expanded in y around inf 64.0%
if -3.70000000000000001e156 < y < -6.39999999999999964e-28 or 3.6999999999999999e-125 < y < 1.85e9Initial program 85.1%
associate-/l*82.5%
associate-/l*83.8%
Simplified83.8%
Taylor expanded in x around inf 61.6%
associate-*l/61.6%
*-commutative61.6%
Simplified61.6%
if -6.39999999999999964e-28 < y < 3.6999999999999999e-125 or 1.85e9 < y < 6e52Initial program 98.1%
*-commutative98.1%
associate-/l*98.0%
Applied egg-rr98.0%
*-commutative98.0%
associate-/l*98.0%
Applied egg-rr98.0%
Taylor expanded in b around 0 90.9%
Final simplification74.2%
(FPCore (x y z t a b)
:precision binary64
(if (<= y -4.4e+150)
(/ z b)
(if (<= y -5.6e-28)
(/ (+ x (* y (/ z t))) (+ 1.0 (* b (/ y t))))
(if (<= y 1.95e-78)
(/ (+ x (/ (* y z) t)) (+ a 1.0))
(if (<= y 3.5e+107)
(/ (+ x (* z (/ y t))) (+ 1.0 (/ (* y b) t)))
(/ z b))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -4.4e+150) {
tmp = z / b;
} else if (y <= -5.6e-28) {
tmp = (x + (y * (z / t))) / (1.0 + (b * (y / t)));
} else if (y <= 1.95e-78) {
tmp = (x + ((y * z) / t)) / (a + 1.0);
} else if (y <= 3.5e+107) {
tmp = (x + (z * (y / t))) / (1.0 + ((y * b) / 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 (y <= (-4.4d+150)) then
tmp = z / b
else if (y <= (-5.6d-28)) then
tmp = (x + (y * (z / t))) / (1.0d0 + (b * (y / t)))
else if (y <= 1.95d-78) then
tmp = (x + ((y * z) / t)) / (a + 1.0d0)
else if (y <= 3.5d+107) then
tmp = (x + (z * (y / t))) / (1.0d0 + ((y * b) / 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 (y <= -4.4e+150) {
tmp = z / b;
} else if (y <= -5.6e-28) {
tmp = (x + (y * (z / t))) / (1.0 + (b * (y / t)));
} else if (y <= 1.95e-78) {
tmp = (x + ((y * z) / t)) / (a + 1.0);
} else if (y <= 3.5e+107) {
tmp = (x + (z * (y / t))) / (1.0 + ((y * b) / t));
} else {
tmp = z / b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -4.4e+150: tmp = z / b elif y <= -5.6e-28: tmp = (x + (y * (z / t))) / (1.0 + (b * (y / t))) elif y <= 1.95e-78: tmp = (x + ((y * z) / t)) / (a + 1.0) elif y <= 3.5e+107: tmp = (x + (z * (y / t))) / (1.0 + ((y * b) / t)) else: tmp = z / b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -4.4e+150) tmp = Float64(z / b); elseif (y <= -5.6e-28) tmp = Float64(Float64(x + Float64(y * Float64(z / t))) / Float64(1.0 + Float64(b * Float64(y / t)))); elseif (y <= 1.95e-78) tmp = Float64(Float64(x + Float64(Float64(y * z) / t)) / Float64(a + 1.0)); elseif (y <= 3.5e+107) tmp = Float64(Float64(x + Float64(z * Float64(y / t))) / Float64(1.0 + Float64(Float64(y * b) / t))); else tmp = Float64(z / b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= -4.4e+150) tmp = z / b; elseif (y <= -5.6e-28) tmp = (x + (y * (z / t))) / (1.0 + (b * (y / t))); elseif (y <= 1.95e-78) tmp = (x + ((y * z) / t)) / (a + 1.0); elseif (y <= 3.5e+107) tmp = (x + (z * (y / t))) / (1.0 + ((y * b) / t)); else tmp = z / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -4.4e+150], N[(z / b), $MachinePrecision], If[LessEqual[y, -5.6e-28], N[(N[(x + N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(1.0 + N[(b * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.95e-78], N[(N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] / N[(a + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.5e+107], N[(N[(x + N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(1.0 + N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z / b), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.4 \cdot 10^{+150}:\\
\;\;\;\;\frac{z}{b}\\
\mathbf{elif}\;y \leq -5.6 \cdot 10^{-28}:\\
\;\;\;\;\frac{x + y \cdot \frac{z}{t}}{1 + b \cdot \frac{y}{t}}\\
\mathbf{elif}\;y \leq 1.95 \cdot 10^{-78}:\\
\;\;\;\;\frac{x + \frac{y \cdot z}{t}}{a + 1}\\
\mathbf{elif}\;y \leq 3.5 \cdot 10^{+107}:\\
\;\;\;\;\frac{x + z \cdot \frac{y}{t}}{1 + \frac{y \cdot b}{t}}\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{b}\\
\end{array}
\end{array}
if y < -4.39999999999999999e150 or 3.4999999999999997e107 < y Initial program 35.9%
associate-/l*39.1%
associate-/l*57.3%
Simplified57.3%
Taylor expanded in y around inf 65.2%
if -4.39999999999999999e150 < y < -5.5999999999999996e-28Initial program 87.7%
associate-/l*87.8%
associate-/l*90.1%
Simplified90.1%
Taylor expanded in a around 0 68.6%
associate-*r/70.7%
*-commutative70.7%
Applied egg-rr70.7%
if -5.5999999999999996e-28 < y < 1.9500000000000001e-78Initial program 95.6%
associate-/l*84.3%
associate-/l*80.8%
Simplified80.8%
Taylor expanded in b around 0 88.3%
if 1.9500000000000001e-78 < y < 3.4999999999999997e107Initial program 83.8%
*-commutative83.8%
associate-/l*83.8%
Applied egg-rr83.8%
*-commutative83.8%
associate-/l*83.9%
Applied egg-rr83.9%
Taylor expanded in a around 0 66.0%
Final simplification76.2%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (+ x (* y (/ z t))) (+ (* y (/ b t)) (+ a 1.0)))))
(if (<= y -3.5e-38)
t_1
(if (<= y 9.2e-135)
(/ (+ x (/ (* y z) t)) (+ a 1.0))
(if (<= y 2.5e+171) t_1 (/ 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 (y <= -3.5e-38) {
tmp = t_1;
} else if (y <= 9.2e-135) {
tmp = (x + ((y * z) / t)) / (a + 1.0);
} else if (y <= 2.5e+171) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = (x + (y * (z / t))) / ((y * (b / t)) + (a + 1.0d0))
if (y <= (-3.5d-38)) then
tmp = t_1
else if (y <= 9.2d-135) then
tmp = (x + ((y * z) / t)) / (a + 1.0d0)
else if (y <= 2.5d+171) then
tmp = t_1
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 t_1 = (x + (y * (z / t))) / ((y * (b / t)) + (a + 1.0));
double tmp;
if (y <= -3.5e-38) {
tmp = t_1;
} else if (y <= 9.2e-135) {
tmp = (x + ((y * z) / t)) / (a + 1.0);
} else if (y <= 2.5e+171) {
tmp = t_1;
} 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)) tmp = 0 if y <= -3.5e-38: tmp = t_1 elif y <= 9.2e-135: tmp = (x + ((y * z) / t)) / (a + 1.0) elif y <= 2.5e+171: tmp = t_1 else: tmp = z / b return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(x + Float64(y * Float64(z / t))) / Float64(Float64(y * Float64(b / t)) + Float64(a + 1.0))) tmp = 0.0 if (y <= -3.5e-38) tmp = t_1; elseif (y <= 9.2e-135) tmp = Float64(Float64(x + Float64(Float64(y * z) / t)) / Float64(a + 1.0)); elseif (y <= 2.5e+171) tmp = t_1; 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)); tmp = 0.0; if (y <= -3.5e-38) tmp = t_1; elseif (y <= 9.2e-135) tmp = (x + ((y * z) / t)) / (a + 1.0); elseif (y <= 2.5e+171) tmp = t_1; else tmp = z / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(x + N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(y * N[(b / t), $MachinePrecision]), $MachinePrecision] + N[(a + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -3.5e-38], t$95$1, If[LessEqual[y, 9.2e-135], N[(N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] / N[(a + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.5e+171], t$95$1, N[(z / b), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x + y \cdot \frac{z}{t}}{y \cdot \frac{b}{t} + \left(a + 1\right)}\\
\mathbf{if}\;y \leq -3.5 \cdot 10^{-38}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 9.2 \cdot 10^{-135}:\\
\;\;\;\;\frac{x + \frac{y \cdot z}{t}}{a + 1}\\
\mathbf{elif}\;y \leq 2.5 \cdot 10^{+171}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{b}\\
\end{array}
\end{array}
if y < -3.5000000000000001e-38 or 9.1999999999999996e-135 < y < 2.5000000000000002e171Initial program 72.6%
associate-/l*72.1%
associate-/l*78.3%
Simplified78.3%
if -3.5000000000000001e-38 < y < 9.1999999999999996e-135Initial program 98.8%
associate-/l*84.7%
associate-/l*80.3%
Simplified80.3%
Taylor expanded in b around 0 92.9%
if 2.5000000000000002e171 < y Initial program 25.9%
associate-/l*29.9%
associate-/l*47.1%
Simplified47.1%
Taylor expanded in y around inf 79.9%
Final simplification83.5%
(FPCore (x y z t a b)
:precision binary64
(if (<= y -3.1e+40)
(/ z b)
(if (<= y -2.6e-25)
(/ x (+ 1.0 (/ (* y b) t)))
(if (<= y -8.5e-46)
(* (/ y t) (/ z (+ a 1.0)))
(if (<= y -3e-72)
(/ (+ x (* y (/ z t))) a)
(if (<= y 1.4e-12) (/ x (+ a 1.0)) (/ z b)))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -3.1e+40) {
tmp = z / b;
} else if (y <= -2.6e-25) {
tmp = x / (1.0 + ((y * b) / t));
} else if (y <= -8.5e-46) {
tmp = (y / t) * (z / (a + 1.0));
} else if (y <= -3e-72) {
tmp = (x + (y * (z / t))) / a;
} else if (y <= 1.4e-12) {
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 <= (-3.1d+40)) then
tmp = z / b
else if (y <= (-2.6d-25)) then
tmp = x / (1.0d0 + ((y * b) / t))
else if (y <= (-8.5d-46)) then
tmp = (y / t) * (z / (a + 1.0d0))
else if (y <= (-3d-72)) then
tmp = (x + (y * (z / t))) / a
else if (y <= 1.4d-12) 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 <= -3.1e+40) {
tmp = z / b;
} else if (y <= -2.6e-25) {
tmp = x / (1.0 + ((y * b) / t));
} else if (y <= -8.5e-46) {
tmp = (y / t) * (z / (a + 1.0));
} else if (y <= -3e-72) {
tmp = (x + (y * (z / t))) / a;
} else if (y <= 1.4e-12) {
tmp = x / (a + 1.0);
} else {
tmp = z / b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -3.1e+40: tmp = z / b elif y <= -2.6e-25: tmp = x / (1.0 + ((y * b) / t)) elif y <= -8.5e-46: tmp = (y / t) * (z / (a + 1.0)) elif y <= -3e-72: tmp = (x + (y * (z / t))) / a elif y <= 1.4e-12: tmp = x / (a + 1.0) else: tmp = z / b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -3.1e+40) tmp = Float64(z / b); elseif (y <= -2.6e-25) tmp = Float64(x / Float64(1.0 + Float64(Float64(y * b) / t))); elseif (y <= -8.5e-46) tmp = Float64(Float64(y / t) * Float64(z / Float64(a + 1.0))); elseif (y <= -3e-72) tmp = Float64(Float64(x + Float64(y * Float64(z / t))) / a); elseif (y <= 1.4e-12) 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 <= -3.1e+40) tmp = z / b; elseif (y <= -2.6e-25) tmp = x / (1.0 + ((y * b) / t)); elseif (y <= -8.5e-46) tmp = (y / t) * (z / (a + 1.0)); elseif (y <= -3e-72) tmp = (x + (y * (z / t))) / a; elseif (y <= 1.4e-12) tmp = x / (a + 1.0); else tmp = z / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -3.1e+40], N[(z / b), $MachinePrecision], If[LessEqual[y, -2.6e-25], N[(x / N[(1.0 + N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -8.5e-46], N[(N[(y / t), $MachinePrecision] * N[(z / N[(a + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -3e-72], N[(N[(x + N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision], If[LessEqual[y, 1.4e-12], N[(x / N[(a + 1.0), $MachinePrecision]), $MachinePrecision], N[(z / b), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.1 \cdot 10^{+40}:\\
\;\;\;\;\frac{z}{b}\\
\mathbf{elif}\;y \leq -2.6 \cdot 10^{-25}:\\
\;\;\;\;\frac{x}{1 + \frac{y \cdot b}{t}}\\
\mathbf{elif}\;y \leq -8.5 \cdot 10^{-46}:\\
\;\;\;\;\frac{y}{t} \cdot \frac{z}{a + 1}\\
\mathbf{elif}\;y \leq -3 \cdot 10^{-72}:\\
\;\;\;\;\frac{x + y \cdot \frac{z}{t}}{a}\\
\mathbf{elif}\;y \leq 1.4 \cdot 10^{-12}:\\
\;\;\;\;\frac{x}{a + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{b}\\
\end{array}
\end{array}
if y < -3.0999999999999998e40 or 1.4000000000000001e-12 < y Initial program 55.5%
associate-/l*57.4%
associate-/l*68.7%
Simplified68.7%
Taylor expanded in y around inf 55.1%
if -3.0999999999999998e40 < y < -2.6e-25Initial program 99.8%
associate-/l*99.8%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in x around inf 73.5%
associate-*l/73.5%
*-commutative73.5%
Simplified73.5%
Taylor expanded in a around 0 58.9%
if -2.6e-25 < y < -8.5000000000000001e-46Initial program 86.5%
associate-/l*73.1%
associate-/l*73.1%
Simplified73.1%
Taylor expanded in x around 0 72.2%
times-frac72.6%
associate-*l/72.6%
*-commutative72.6%
Simplified72.6%
Taylor expanded in y around 0 44.1%
times-frac44.4%
Simplified44.4%
if -8.5000000000000001e-46 < y < -3e-72Initial program 100.0%
associate-/l*100.0%
associate-/l*100.0%
Simplified100.0%
Taylor expanded in a around inf 100.0%
if -3e-72 < y < 1.4000000000000001e-12Initial program 94.7%
associate-/l*82.5%
associate-/l*79.0%
Simplified79.0%
Taylor expanded in y around 0 69.6%
Final simplification62.3%
(FPCore (x y z t a b)
:precision binary64
(if (<= y -1.7e+39)
(/ z b)
(if (<= y -9e-24)
(/ x (+ 1.0 (/ (* y b) t)))
(if (<= y -1.62e-37)
(/ z b)
(if (<= y -1.8e-73)
(/ (+ x (/ (* y z) t)) a)
(if (<= y 8.4e-10) (/ x (+ a 1.0)) (/ z b)))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -1.7e+39) {
tmp = z / b;
} else if (y <= -9e-24) {
tmp = x / (1.0 + ((y * b) / t));
} else if (y <= -1.62e-37) {
tmp = z / b;
} else if (y <= -1.8e-73) {
tmp = (x + ((y * z) / t)) / a;
} else if (y <= 8.4e-10) {
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 <= (-1.7d+39)) then
tmp = z / b
else if (y <= (-9d-24)) then
tmp = x / (1.0d0 + ((y * b) / t))
else if (y <= (-1.62d-37)) then
tmp = z / b
else if (y <= (-1.8d-73)) then
tmp = (x + ((y * z) / t)) / a
else if (y <= 8.4d-10) 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 <= -1.7e+39) {
tmp = z / b;
} else if (y <= -9e-24) {
tmp = x / (1.0 + ((y * b) / t));
} else if (y <= -1.62e-37) {
tmp = z / b;
} else if (y <= -1.8e-73) {
tmp = (x + ((y * z) / t)) / a;
} else if (y <= 8.4e-10) {
tmp = x / (a + 1.0);
} else {
tmp = z / b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -1.7e+39: tmp = z / b elif y <= -9e-24: tmp = x / (1.0 + ((y * b) / t)) elif y <= -1.62e-37: tmp = z / b elif y <= -1.8e-73: tmp = (x + ((y * z) / t)) / a elif y <= 8.4e-10: tmp = x / (a + 1.0) else: tmp = z / b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -1.7e+39) tmp = Float64(z / b); elseif (y <= -9e-24) tmp = Float64(x / Float64(1.0 + Float64(Float64(y * b) / t))); elseif (y <= -1.62e-37) tmp = Float64(z / b); elseif (y <= -1.8e-73) tmp = Float64(Float64(x + Float64(Float64(y * z) / t)) / a); elseif (y <= 8.4e-10) 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 <= -1.7e+39) tmp = z / b; elseif (y <= -9e-24) tmp = x / (1.0 + ((y * b) / t)); elseif (y <= -1.62e-37) tmp = z / b; elseif (y <= -1.8e-73) tmp = (x + ((y * z) / t)) / a; elseif (y <= 8.4e-10) tmp = x / (a + 1.0); else tmp = z / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -1.7e+39], N[(z / b), $MachinePrecision], If[LessEqual[y, -9e-24], N[(x / N[(1.0 + N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -1.62e-37], N[(z / b), $MachinePrecision], If[LessEqual[y, -1.8e-73], N[(N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision], If[LessEqual[y, 8.4e-10], N[(x / N[(a + 1.0), $MachinePrecision]), $MachinePrecision], N[(z / b), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.7 \cdot 10^{+39}:\\
\;\;\;\;\frac{z}{b}\\
\mathbf{elif}\;y \leq -9 \cdot 10^{-24}:\\
\;\;\;\;\frac{x}{1 + \frac{y \cdot b}{t}}\\
\mathbf{elif}\;y \leq -1.62 \cdot 10^{-37}:\\
\;\;\;\;\frac{z}{b}\\
\mathbf{elif}\;y \leq -1.8 \cdot 10^{-73}:\\
\;\;\;\;\frac{x + \frac{y \cdot z}{t}}{a}\\
\mathbf{elif}\;y \leq 8.4 \cdot 10^{-10}:\\
\;\;\;\;\frac{x}{a + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{b}\\
\end{array}
\end{array}
if y < -1.6999999999999999e39 or -8.9999999999999995e-24 < y < -1.6199999999999999e-37 or 8.3999999999999999e-10 < y Initial program 57.2%
associate-/l*59.1%
associate-/l*69.7%
Simplified69.7%
Taylor expanded in y around inf 55.3%
if -1.6999999999999999e39 < y < -8.9999999999999995e-24Initial program 99.7%
associate-/l*99.7%
associate-/l*99.7%
Simplified99.7%
Taylor expanded in x around inf 71.3%
associate-*l/71.3%
*-commutative71.3%
Simplified71.3%
Taylor expanded in a around 0 55.4%
if -1.6199999999999999e-37 < y < -1.8e-73Initial program 100.0%
associate-/l*86.4%
associate-/l*86.4%
Simplified86.4%
Taylor expanded in a around inf 100.0%
if -1.8e-73 < y < 8.3999999999999999e-10Initial program 94.7%
associate-/l*82.5%
associate-/l*79.0%
Simplified79.0%
Taylor expanded in y around 0 69.6%
Final simplification62.7%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -2.9e+201) (not (<= y 2.5e+171))) (/ z b) (/ (+ x (* z (/ y t))) (+ (* b (/ y t)) (+ a 1.0)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -2.9e+201) || !(y <= 2.5e+171)) {
tmp = z / b;
} else {
tmp = (x + (z * (y / t))) / ((b * (y / 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 ((y <= (-2.9d+201)) .or. (.not. (y <= 2.5d+171))) then
tmp = z / b
else
tmp = (x + (z * (y / t))) / ((b * (y / 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 ((y <= -2.9e+201) || !(y <= 2.5e+171)) {
tmp = z / b;
} else {
tmp = (x + (z * (y / t))) / ((b * (y / t)) + (a + 1.0));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -2.9e+201) or not (y <= 2.5e+171): tmp = z / b else: tmp = (x + (z * (y / t))) / ((b * (y / t)) + (a + 1.0)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -2.9e+201) || !(y <= 2.5e+171)) tmp = Float64(z / b); else tmp = Float64(Float64(x + Float64(z * Float64(y / t))) / Float64(Float64(b * Float64(y / t)) + Float64(a + 1.0))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -2.9e+201) || ~((y <= 2.5e+171))) tmp = z / b; else tmp = (x + (z * (y / t))) / ((b * (y / t)) + (a + 1.0)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -2.9e+201], N[Not[LessEqual[y, 2.5e+171]], $MachinePrecision]], N[(z / b), $MachinePrecision], N[(N[(x + N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(b * N[(y / t), $MachinePrecision]), $MachinePrecision] + N[(a + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.9 \cdot 10^{+201} \lor \neg \left(y \leq 2.5 \cdot 10^{+171}\right):\\
\;\;\;\;\frac{z}{b}\\
\mathbf{else}:\\
\;\;\;\;\frac{x + z \cdot \frac{y}{t}}{b \cdot \frac{y}{t} + \left(a + 1\right)}\\
\end{array}
\end{array}
if y < -2.9000000000000002e201 or 2.5000000000000002e171 < y Initial program 25.5%
associate-/l*28.1%
associate-/l*47.4%
Simplified47.4%
Taylor expanded in y around inf 74.5%
if -2.9000000000000002e201 < y < 2.5000000000000002e171Initial program 87.5%
*-commutative87.5%
associate-/l*88.4%
Applied egg-rr88.4%
*-commutative88.4%
associate-/l*89.3%
Applied egg-rr89.3%
Final simplification86.7%
(FPCore (x y z t a b)
:precision binary64
(if (<= y -1.25e+157)
(/ z b)
(if (<= y -5.6e-28)
(/ x (+ 1.0 (+ a (* y (/ b t)))))
(if (<= y 1.1e+49) (/ (+ 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 (y <= -1.25e+157) {
tmp = z / b;
} else if (y <= -5.6e-28) {
tmp = x / (1.0 + (a + (y * (b / t))));
} else if (y <= 1.1e+49) {
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 (y <= (-1.25d+157)) then
tmp = z / b
else if (y <= (-5.6d-28)) then
tmp = x / (1.0d0 + (a + (y * (b / t))))
else if (y <= 1.1d+49) 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 (y <= -1.25e+157) {
tmp = z / b;
} else if (y <= -5.6e-28) {
tmp = x / (1.0 + (a + (y * (b / t))));
} else if (y <= 1.1e+49) {
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 y <= -1.25e+157: tmp = z / b elif y <= -5.6e-28: tmp = x / (1.0 + (a + (y * (b / t)))) elif y <= 1.1e+49: 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 (y <= -1.25e+157) tmp = Float64(z / b); elseif (y <= -5.6e-28) tmp = Float64(x / Float64(1.0 + Float64(a + Float64(y * Float64(b / t))))); elseif (y <= 1.1e+49) tmp = Float64(Float64(x + Float64(Float64(y * 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 (y <= -1.25e+157) tmp = z / b; elseif (y <= -5.6e-28) tmp = x / (1.0 + (a + (y * (b / t)))); elseif (y <= 1.1e+49) 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[LessEqual[y, -1.25e+157], N[(z / b), $MachinePrecision], If[LessEqual[y, -5.6e-28], N[(x / N[(1.0 + N[(a + N[(y * N[(b / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.1e+49], N[(N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] / N[(a + 1.0), $MachinePrecision]), $MachinePrecision], N[(z / b), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.25 \cdot 10^{+157}:\\
\;\;\;\;\frac{z}{b}\\
\mathbf{elif}\;y \leq -5.6 \cdot 10^{-28}:\\
\;\;\;\;\frac{x}{1 + \left(a + y \cdot \frac{b}{t}\right)}\\
\mathbf{elif}\;y \leq 1.1 \cdot 10^{+49}:\\
\;\;\;\;\frac{x + \frac{y \cdot z}{t}}{a + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{b}\\
\end{array}
\end{array}
if y < -1.24999999999999994e157 or 1.1e49 < y Initial program 41.8%
associate-/l*44.6%
associate-/l*60.1%
Simplified60.1%
Taylor expanded in y around inf 64.0%
if -1.24999999999999994e157 < y < -5.5999999999999996e-28Initial program 88.0%
associate-/l*88.1%
associate-/l*90.3%
Simplified90.3%
Taylor expanded in x around inf 58.3%
associate-*l/58.4%
*-commutative58.4%
Simplified58.4%
if -5.5999999999999996e-28 < y < 1.1e49Initial program 94.2%
associate-/l*83.4%
associate-/l*80.5%
Simplified80.5%
Taylor expanded in b around 0 82.3%
Final simplification72.7%
(FPCore (x y z t a b)
:precision binary64
(if (<= y -2.9e+152)
(/ z b)
(if (<= y -2e-28)
(/ (+ x (* y (/ z t))) (+ 1.0 (* b (/ y t))))
(if (<= y 3.8e+51) (/ (+ 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 (y <= -2.9e+152) {
tmp = z / b;
} else if (y <= -2e-28) {
tmp = (x + (y * (z / t))) / (1.0 + (b * (y / t)));
} else if (y <= 3.8e+51) {
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 (y <= (-2.9d+152)) then
tmp = z / b
else if (y <= (-2d-28)) then
tmp = (x + (y * (z / t))) / (1.0d0 + (b * (y / t)))
else if (y <= 3.8d+51) 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 (y <= -2.9e+152) {
tmp = z / b;
} else if (y <= -2e-28) {
tmp = (x + (y * (z / t))) / (1.0 + (b * (y / t)));
} else if (y <= 3.8e+51) {
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 y <= -2.9e+152: tmp = z / b elif y <= -2e-28: tmp = (x + (y * (z / t))) / (1.0 + (b * (y / t))) elif y <= 3.8e+51: 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 (y <= -2.9e+152) tmp = Float64(z / b); elseif (y <= -2e-28) tmp = Float64(Float64(x + Float64(y * Float64(z / t))) / Float64(1.0 + Float64(b * Float64(y / t)))); elseif (y <= 3.8e+51) tmp = Float64(Float64(x + Float64(Float64(y * 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 (y <= -2.9e+152) tmp = z / b; elseif (y <= -2e-28) tmp = (x + (y * (z / t))) / (1.0 + (b * (y / t))); elseif (y <= 3.8e+51) 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[LessEqual[y, -2.9e+152], N[(z / b), $MachinePrecision], If[LessEqual[y, -2e-28], N[(N[(x + N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(1.0 + N[(b * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.8e+51], N[(N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] / N[(a + 1.0), $MachinePrecision]), $MachinePrecision], N[(z / b), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.9 \cdot 10^{+152}:\\
\;\;\;\;\frac{z}{b}\\
\mathbf{elif}\;y \leq -2 \cdot 10^{-28}:\\
\;\;\;\;\frac{x + y \cdot \frac{z}{t}}{1 + b \cdot \frac{y}{t}}\\
\mathbf{elif}\;y \leq 3.8 \cdot 10^{+51}:\\
\;\;\;\;\frac{x + \frac{y \cdot z}{t}}{a + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{b}\\
\end{array}
\end{array}
if y < -2.8999999999999998e152 or 3.7999999999999997e51 < y Initial program 42.6%
associate-/l*45.3%
associate-/l*60.5%
Simplified60.5%
Taylor expanded in y around inf 63.3%
if -2.8999999999999998e152 < y < -1.99999999999999994e-28Initial program 87.7%
associate-/l*87.8%
associate-/l*90.1%
Simplified90.1%
Taylor expanded in a around 0 68.6%
associate-*r/70.7%
*-commutative70.7%
Applied egg-rr70.7%
if -1.99999999999999994e-28 < y < 3.7999999999999997e51Initial program 94.2%
associate-/l*83.4%
associate-/l*80.5%
Simplified80.5%
Taylor expanded in b around 0 82.3%
Final simplification74.4%
(FPCore (x y z t a b)
:precision binary64
(if (<= y -7.5e-38)
(/ z b)
(if (<= y -1.18e-247)
(/ x a)
(if (<= y -6.6e-271) x (if (<= y 1.95e-78) (/ x a) (/ z b))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -7.5e-38) {
tmp = z / b;
} else if (y <= -1.18e-247) {
tmp = x / a;
} else if (y <= -6.6e-271) {
tmp = x;
} else if (y <= 1.95e-78) {
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 <= (-7.5d-38)) then
tmp = z / b
else if (y <= (-1.18d-247)) then
tmp = x / a
else if (y <= (-6.6d-271)) then
tmp = x
else if (y <= 1.95d-78) 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 <= -7.5e-38) {
tmp = z / b;
} else if (y <= -1.18e-247) {
tmp = x / a;
} else if (y <= -6.6e-271) {
tmp = x;
} else if (y <= 1.95e-78) {
tmp = x / a;
} else {
tmp = z / b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -7.5e-38: tmp = z / b elif y <= -1.18e-247: tmp = x / a elif y <= -6.6e-271: tmp = x elif y <= 1.95e-78: tmp = x / a else: tmp = z / b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -7.5e-38) tmp = Float64(z / b); elseif (y <= -1.18e-247) tmp = Float64(x / a); elseif (y <= -6.6e-271) tmp = x; elseif (y <= 1.95e-78) 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 <= -7.5e-38) tmp = z / b; elseif (y <= -1.18e-247) tmp = x / a; elseif (y <= -6.6e-271) tmp = x; elseif (y <= 1.95e-78) tmp = x / a; else tmp = z / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -7.5e-38], N[(z / b), $MachinePrecision], If[LessEqual[y, -1.18e-247], N[(x / a), $MachinePrecision], If[LessEqual[y, -6.6e-271], x, If[LessEqual[y, 1.95e-78], N[(x / a), $MachinePrecision], N[(z / b), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -7.5 \cdot 10^{-38}:\\
\;\;\;\;\frac{z}{b}\\
\mathbf{elif}\;y \leq -1.18 \cdot 10^{-247}:\\
\;\;\;\;\frac{x}{a}\\
\mathbf{elif}\;y \leq -6.6 \cdot 10^{-271}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 1.95 \cdot 10^{-78}:\\
\;\;\;\;\frac{x}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{b}\\
\end{array}
\end{array}
if y < -7.5e-38 or 1.9500000000000001e-78 < y Initial program 62.7%
associate-/l*63.0%
associate-/l*71.9%
Simplified71.9%
Taylor expanded in y around inf 51.3%
if -7.5e-38 < y < -1.17999999999999997e-247 or -6.6000000000000004e-271 < y < 1.9500000000000001e-78Initial program 96.0%
associate-/l*84.3%
associate-/l*80.4%
Simplified80.4%
Taylor expanded in x around inf 74.6%
associate-*l/70.7%
*-commutative70.7%
Simplified70.7%
Taylor expanded in a around inf 48.5%
if -1.17999999999999997e-247 < y < -6.6000000000000004e-271Initial program 100.0%
associate-/l*86.3%
associate-/l*86.3%
Simplified86.3%
Taylor expanded in a around 0 86.3%
Taylor expanded in y around 0 87.1%
Final simplification51.2%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -1.85e+156) (not (<= y 4.5e+52))) (/ z b) (/ x (+ 1.0 (+ a (* y (/ b t)))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -1.85e+156) || !(y <= 4.5e+52)) {
tmp = z / b;
} else {
tmp = x / (1.0 + (a + (y * (b / t))));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((y <= (-1.85d+156)) .or. (.not. (y <= 4.5d+52))) then
tmp = z / b
else
tmp = x / (1.0d0 + (a + (y * (b / t))))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -1.85e+156) || !(y <= 4.5e+52)) {
tmp = z / b;
} else {
tmp = x / (1.0 + (a + (y * (b / t))));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -1.85e+156) or not (y <= 4.5e+52): tmp = z / b else: tmp = x / (1.0 + (a + (y * (b / t)))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -1.85e+156) || !(y <= 4.5e+52)) tmp = Float64(z / b); else tmp = Float64(x / Float64(1.0 + Float64(a + Float64(y * Float64(b / t))))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -1.85e+156) || ~((y <= 4.5e+52))) tmp = z / b; else tmp = x / (1.0 + (a + (y * (b / t)))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -1.85e+156], N[Not[LessEqual[y, 4.5e+52]], $MachinePrecision]], N[(z / b), $MachinePrecision], N[(x / N[(1.0 + N[(a + N[(y * N[(b / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.85 \cdot 10^{+156} \lor \neg \left(y \leq 4.5 \cdot 10^{+52}\right):\\
\;\;\;\;\frac{z}{b}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{1 + \left(a + y \cdot \frac{b}{t}\right)}\\
\end{array}
\end{array}
if y < -1.85000000000000001e156 or 4.5e52 < y Initial program 41.8%
associate-/l*44.6%
associate-/l*60.1%
Simplified60.1%
Taylor expanded in y around inf 64.0%
if -1.85000000000000001e156 < y < 4.5e52Initial program 92.7%
associate-/l*84.5%
associate-/l*82.8%
Simplified82.8%
Taylor expanded in x around inf 66.8%
associate-*l/64.7%
*-commutative64.7%
Simplified64.7%
Final simplification64.5%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -2e+156) (not (<= y 3.1e+50))) (/ z b) (/ x (+ 1.0 (+ a (/ (* y b) t))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -2e+156) || !(y <= 3.1e+50)) {
tmp = z / b;
} else {
tmp = x / (1.0 + (a + ((y * b) / t)));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((y <= (-2d+156)) .or. (.not. (y <= 3.1d+50))) then
tmp = z / b
else
tmp = x / (1.0d0 + (a + ((y * b) / t)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -2e+156) || !(y <= 3.1e+50)) {
tmp = z / b;
} else {
tmp = x / (1.0 + (a + ((y * b) / t)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -2e+156) or not (y <= 3.1e+50): tmp = z / b else: tmp = x / (1.0 + (a + ((y * b) / t))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -2e+156) || !(y <= 3.1e+50)) tmp = Float64(z / b); else tmp = Float64(x / Float64(1.0 + Float64(a + Float64(Float64(y * b) / t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -2e+156) || ~((y <= 3.1e+50))) tmp = z / b; else tmp = x / (1.0 + (a + ((y * b) / t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -2e+156], N[Not[LessEqual[y, 3.1e+50]], $MachinePrecision]], N[(z / b), $MachinePrecision], N[(x / N[(1.0 + N[(a + N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2 \cdot 10^{+156} \lor \neg \left(y \leq 3.1 \cdot 10^{+50}\right):\\
\;\;\;\;\frac{z}{b}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{1 + \left(a + \frac{y \cdot b}{t}\right)}\\
\end{array}
\end{array}
if y < -2e156 or 3.10000000000000003e50 < y Initial program 41.8%
associate-/l*44.6%
associate-/l*60.1%
Simplified60.1%
Taylor expanded in y around inf 64.0%
if -2e156 < y < 3.10000000000000003e50Initial program 92.7%
associate-/l*84.5%
associate-/l*82.8%
Simplified82.8%
Taylor expanded in x around inf 66.8%
Final simplification65.9%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -4e+73) (not (<= y 1.4e-12))) (/ z b) (/ x (+ a 1.0))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -4e+73) || !(y <= 1.4e-12)) {
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 <= (-4d+73)) .or. (.not. (y <= 1.4d-12))) 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 <= -4e+73) || !(y <= 1.4e-12)) {
tmp = z / b;
} else {
tmp = x / (a + 1.0);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -4e+73) or not (y <= 1.4e-12): tmp = z / b else: tmp = x / (a + 1.0) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -4e+73) || !(y <= 1.4e-12)) 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 <= -4e+73) || ~((y <= 1.4e-12))) 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, -4e+73], N[Not[LessEqual[y, 1.4e-12]], $MachinePrecision]], N[(z / b), $MachinePrecision], N[(x / N[(a + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -4 \cdot 10^{+73} \lor \neg \left(y \leq 1.4 \cdot 10^{-12}\right):\\
\;\;\;\;\frac{z}{b}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{a + 1}\\
\end{array}
\end{array}
if y < -3.99999999999999993e73 or 1.4000000000000001e-12 < y Initial program 54.1%
associate-/l*56.1%
associate-/l*67.6%
Simplified67.6%
Taylor expanded in y around inf 57.2%
if -3.99999999999999993e73 < y < 1.4000000000000001e-12Initial program 93.4%
associate-/l*83.6%
associate-/l*81.5%
Simplified81.5%
Taylor expanded in y around 0 62.7%
Final simplification60.3%
(FPCore (x y z t a b) :precision binary64 (if (or (<= a -8e-23) (not (<= a 7.2e+22))) (/ x a) x))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -8e-23) || !(a <= 7.2e+22)) {
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 <= (-8d-23)) .or. (.not. (a <= 7.2d+22))) 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 <= -8e-23) || !(a <= 7.2e+22)) {
tmp = x / a;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (a <= -8e-23) or not (a <= 7.2e+22): tmp = x / a else: tmp = x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((a <= -8e-23) || !(a <= 7.2e+22)) 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 <= -8e-23) || ~((a <= 7.2e+22))) tmp = x / a; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[a, -8e-23], N[Not[LessEqual[a, 7.2e+22]], $MachinePrecision]], N[(x / a), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -8 \cdot 10^{-23} \lor \neg \left(a \leq 7.2 \cdot 10^{+22}\right):\\
\;\;\;\;\frac{x}{a}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < -7.99999999999999968e-23 or 7.2e22 < a Initial program 73.3%
associate-/l*67.1%
associate-/l*72.0%
Simplified72.0%
Taylor expanded in x around inf 52.2%
associate-*l/53.0%
*-commutative53.0%
Simplified53.0%
Taylor expanded in a around inf 46.6%
if -7.99999999999999968e-23 < a < 7.2e22Initial program 80.4%
associate-/l*77.3%
associate-/l*79.7%
Simplified79.7%
Taylor expanded in a around 0 77.0%
Taylor expanded in y around 0 36.4%
Final simplification41.8%
(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%
associate-/l*71.9%
associate-/l*75.6%
Simplified75.6%
Taylor expanded in a around 0 44.6%
Taylor expanded in y around 0 19.1%
Final simplification19.1%
(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 2024050
(FPCore (x y z t a b)
:name "Diagrams.Solve.Tridiagonal:solveCyclicTriDiagonal from diagrams-solve-0.1, B"
:precision binary64
:alt
(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))))