
(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 16 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 (/ (+ t (* t (fma y (/ b t) a))) z))
(if (<= t_1 -4e-316)
t_1
(if (<= t_1 0.0)
(+ (/ z b) (/ (- (/ x b) (/ z (* b b))) (/ y t)))
(if (<= t_1 2e+306) 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 / ((t + (t * fma(y, (b / t), a))) / z);
} else if (t_1 <= -4e-316) {
tmp = t_1;
} else if (t_1 <= 0.0) {
tmp = (z / b) + (((x / b) - (z / (b * b))) / (y / t));
} else if (t_1 <= 2e+306) {
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(y / Float64(Float64(t + Float64(t * fma(y, Float64(b / t), a))) / z)); elseif (t_1 <= -4e-316) tmp = t_1; elseif (t_1 <= 0.0) tmp = Float64(Float64(z / b) + Float64(Float64(Float64(x / b) - Float64(z / Float64(b * b))) / Float64(y / t))); elseif (t_1 <= 2e+306) 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[(y / N[(N[(t + N[(t * N[(y * N[(b / t), $MachinePrecision] + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, -4e-316], t$95$1, If[LessEqual[t$95$1, 0.0], N[(N[(z / b), $MachinePrecision] + N[(N[(N[(x / b), $MachinePrecision] - N[(z / N[(b * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2e+306], 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}{\frac{t + t \cdot \mathsf{fma}\left(y, \frac{b}{t}, a\right)}{z}}\\
\mathbf{elif}\;t_1 \leq -4 \cdot 10^{-316}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t_1 \leq 0:\\
\;\;\;\;\frac{z}{b} + \frac{\frac{x}{b} - \frac{z}{b \cdot b}}{\frac{y}{t}}\\
\mathbf{elif}\;t_1 \leq 2 \cdot 10^{+306}:\\
\;\;\;\;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 24.4%
*-commutative24.4%
associate-*l/54.0%
*-commutative54.0%
associate-*l/53.5%
Simplified53.5%
Taylor expanded in x around 0 61.0%
associate-/l*79.6%
distribute-rgt-in79.6%
*-lft-identity79.6%
associate-*r/70.4%
fma-def70.4%
Simplified70.4%
if -inf.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < -3.999999984e-316 or 0.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < 2.00000000000000003e306Initial program 99.7%
if -3.999999984e-316 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < 0.0Initial program 51.5%
*-commutative51.5%
associate-/l*48.2%
associate-*l/62.3%
*-commutative62.3%
cancel-sign-sub62.3%
*-commutative62.3%
associate-*l/48.2%
associate-+r-48.2%
associate-*l/62.3%
*-commutative62.3%
cancel-sign-sub62.3%
*-commutative62.3%
associate-/r/62.3%
Simplified62.3%
Taylor expanded in a around 0 33.3%
Taylor expanded in t around 0 62.1%
*-commutative62.1%
associate-/r*73.8%
unpow273.8%
Simplified73.8%
Taylor expanded in y around -inf 78.0%
mul-1-neg78.0%
associate-/l*77.3%
distribute-lft-out--77.3%
unpow277.3%
Simplified77.3%
if 2.00000000000000003e306 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) Initial program 10.4%
*-commutative10.4%
associate-*l/14.9%
*-commutative14.9%
associate-*l/25.7%
Simplified25.7%
Taylor expanded in t around 0 88.9%
Final simplification93.1%
(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 -4e-316)
t_1
(if (<= t_1 0.0)
(+ (/ z b) (* t (- (/ (/ x y) b) (/ z (* y (* b b))))))
(if (<= t_1 2e+306) 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 <= -4e-316) {
tmp = t_1;
} else if (t_1 <= 0.0) {
tmp = (z / b) + (t * (((x / y) / b) - (z / (y * (b * b)))));
} else if (t_1 <= 2e+306) {
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)) / ((a + 1.0d0) + ((y * b) / t))
if (t_1 <= (-4d-316)) then
tmp = t_1
else if (t_1 <= 0.0d0) then
tmp = (z / b) + (t * (((x / y) / b) - (z / (y * (b * b)))))
else if (t_1 <= 2d+306) 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)) / ((a + 1.0) + ((y * b) / t));
double tmp;
if (t_1 <= -4e-316) {
tmp = t_1;
} else if (t_1 <= 0.0) {
tmp = (z / b) + (t * (((x / y) / b) - (z / (y * (b * b)))));
} else if (t_1 <= 2e+306) {
tmp = t_1;
} else {
tmp = z / b;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t)) tmp = 0 if t_1 <= -4e-316: tmp = t_1 elif t_1 <= 0.0: tmp = (z / b) + (t * (((x / y) / b) - (z / (y * (b * b))))) elif t_1 <= 2e+306: 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 <= -4e-316) tmp = t_1; elseif (t_1 <= 0.0) tmp = Float64(Float64(z / b) + Float64(t * Float64(Float64(Float64(x / y) / b) - Float64(z / Float64(y * Float64(b * b)))))); elseif (t_1 <= 2e+306) 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)) / ((a + 1.0) + ((y * b) / t)); tmp = 0.0; if (t_1 <= -4e-316) tmp = t_1; elseif (t_1 <= 0.0) tmp = (z / b) + (t * (((x / y) / b) - (z / (y * (b * b))))); elseif (t_1 <= 2e+306) 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[(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, -4e-316], t$95$1, If[LessEqual[t$95$1, 0.0], N[(N[(z / b), $MachinePrecision] + N[(t * N[(N[(N[(x / y), $MachinePrecision] / b), $MachinePrecision] - N[(z / N[(y * N[(b * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2e+306], 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 -4 \cdot 10^{-316}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t_1 \leq 0:\\
\;\;\;\;\frac{z}{b} + t \cdot \left(\frac{\frac{x}{y}}{b} - \frac{z}{y \cdot \left(b \cdot b\right)}\right)\\
\mathbf{elif}\;t_1 \leq 2 \cdot 10^{+306}:\\
\;\;\;\;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))) < -3.999999984e-316 or 0.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < 2.00000000000000003e306Initial program 95.3%
if -3.999999984e-316 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < 0.0Initial program 51.5%
*-commutative51.5%
associate-/l*48.2%
associate-*l/62.3%
*-commutative62.3%
cancel-sign-sub62.3%
*-commutative62.3%
associate-*l/48.2%
associate-+r-48.2%
associate-*l/62.3%
*-commutative62.3%
cancel-sign-sub62.3%
*-commutative62.3%
associate-/r/62.3%
Simplified62.3%
Taylor expanded in a around 0 33.3%
Taylor expanded in t around 0 62.1%
*-commutative62.1%
associate-/r*73.8%
unpow273.8%
Simplified73.8%
if 2.00000000000000003e306 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) Initial program 10.4%
*-commutative10.4%
associate-*l/14.9%
*-commutative14.9%
associate-*l/25.7%
Simplified25.7%
Taylor expanded in t around 0 88.9%
Final simplification90.7%
(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 -4e-316)
t_1
(if (<= t_1 0.0)
(+ (/ z b) (/ (- (/ x b) (/ z (* b b))) (/ y t)))
(if (<= t_1 2e+306) 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 <= -4e-316) {
tmp = t_1;
} else if (t_1 <= 0.0) {
tmp = (z / b) + (((x / b) - (z / (b * b))) / (y / t));
} else if (t_1 <= 2e+306) {
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)) / ((a + 1.0d0) + ((y * b) / t))
if (t_1 <= (-4d-316)) then
tmp = t_1
else if (t_1 <= 0.0d0) then
tmp = (z / b) + (((x / b) - (z / (b * b))) / (y / t))
else if (t_1 <= 2d+306) 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)) / ((a + 1.0) + ((y * b) / t));
double tmp;
if (t_1 <= -4e-316) {
tmp = t_1;
} else if (t_1 <= 0.0) {
tmp = (z / b) + (((x / b) - (z / (b * b))) / (y / t));
} else if (t_1 <= 2e+306) {
tmp = t_1;
} else {
tmp = z / b;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t)) tmp = 0 if t_1 <= -4e-316: tmp = t_1 elif t_1 <= 0.0: tmp = (z / b) + (((x / b) - (z / (b * b))) / (y / t)) elif t_1 <= 2e+306: 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 <= -4e-316) tmp = t_1; elseif (t_1 <= 0.0) tmp = Float64(Float64(z / b) + Float64(Float64(Float64(x / b) - Float64(z / Float64(b * b))) / Float64(y / t))); elseif (t_1 <= 2e+306) 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)) / ((a + 1.0) + ((y * b) / t)); tmp = 0.0; if (t_1 <= -4e-316) tmp = t_1; elseif (t_1 <= 0.0) tmp = (z / b) + (((x / b) - (z / (b * b))) / (y / t)); elseif (t_1 <= 2e+306) 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[(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, -4e-316], t$95$1, If[LessEqual[t$95$1, 0.0], N[(N[(z / b), $MachinePrecision] + N[(N[(N[(x / b), $MachinePrecision] - N[(z / N[(b * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2e+306], 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 -4 \cdot 10^{-316}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t_1 \leq 0:\\
\;\;\;\;\frac{z}{b} + \frac{\frac{x}{b} - \frac{z}{b \cdot b}}{\frac{y}{t}}\\
\mathbf{elif}\;t_1 \leq 2 \cdot 10^{+306}:\\
\;\;\;\;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))) < -3.999999984e-316 or 0.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < 2.00000000000000003e306Initial program 95.3%
if -3.999999984e-316 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < 0.0Initial program 51.5%
*-commutative51.5%
associate-/l*48.2%
associate-*l/62.3%
*-commutative62.3%
cancel-sign-sub62.3%
*-commutative62.3%
associate-*l/48.2%
associate-+r-48.2%
associate-*l/62.3%
*-commutative62.3%
cancel-sign-sub62.3%
*-commutative62.3%
associate-/r/62.3%
Simplified62.3%
Taylor expanded in a around 0 33.3%
Taylor expanded in t around 0 62.1%
*-commutative62.1%
associate-/r*73.8%
unpow273.8%
Simplified73.8%
Taylor expanded in y around -inf 78.0%
mul-1-neg78.0%
associate-/l*77.3%
distribute-lft-out--77.3%
unpow277.3%
Simplified77.3%
if 2.00000000000000003e306 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) Initial program 10.4%
*-commutative10.4%
associate-*l/14.9%
*-commutative14.9%
associate-*l/25.7%
Simplified25.7%
Taylor expanded in t around 0 88.9%
Final simplification91.3%
(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 2e+306) 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 <= 2e+306) {
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)) / ((a + 1.0d0) + ((y * b) / t))
if (t_1 <= 2d+306) 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)) / ((a + 1.0) + ((y * b) / t));
double tmp;
if (t_1 <= 2e+306) {
tmp = t_1;
} else {
tmp = z / b;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t)) tmp = 0 if t_1 <= 2e+306: 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 <= 2e+306) 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)) / ((a + 1.0) + ((y * b) / t)); tmp = 0.0; if (t_1 <= 2e+306) 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[(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, 2e+306], 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 2 \cdot 10^{+306}:\\
\;\;\;\;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))) < 2.00000000000000003e306Initial program 86.8%
if 2.00000000000000003e306 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) Initial program 10.4%
*-commutative10.4%
associate-*l/14.9%
*-commutative14.9%
associate-*l/25.7%
Simplified25.7%
Taylor expanded in t around 0 88.9%
Final simplification87.2%
(FPCore (x y z t a b) :precision binary64 (if (or (<= t -3.5e-164) (not (<= t 2.1e-95))) (/ (+ x (* y (/ z t))) (+ (+ a 1.0) (* y (/ b t)))) (+ (/ z b) (/ (* x t) (* y b)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -3.5e-164) || !(t <= 2.1e-95)) {
tmp = (x + (y * (z / t))) / ((a + 1.0) + (y * (b / t)));
} else {
tmp = (z / b) + ((x * 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) :: tmp
if ((t <= (-3.5d-164)) .or. (.not. (t <= 2.1d-95))) then
tmp = (x + (y * (z / t))) / ((a + 1.0d0) + (y * (b / t)))
else
tmp = (z / b) + ((x * 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 tmp;
if ((t <= -3.5e-164) || !(t <= 2.1e-95)) {
tmp = (x + (y * (z / t))) / ((a + 1.0) + (y * (b / t)));
} else {
tmp = (z / b) + ((x * t) / (y * b));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (t <= -3.5e-164) or not (t <= 2.1e-95): tmp = (x + (y * (z / t))) / ((a + 1.0) + (y * (b / t))) else: tmp = (z / b) + ((x * t) / (y * b)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((t <= -3.5e-164) || !(t <= 2.1e-95)) tmp = Float64(Float64(x + Float64(y * Float64(z / t))) / Float64(Float64(a + 1.0) + Float64(y * Float64(b / t)))); else tmp = Float64(Float64(z / b) + Float64(Float64(x * t) / Float64(y * b))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((t <= -3.5e-164) || ~((t <= 2.1e-95))) tmp = (x + (y * (z / t))) / ((a + 1.0) + (y * (b / t))); else tmp = (z / b) + ((x * t) / (y * b)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[t, -3.5e-164], N[Not[LessEqual[t, 2.1e-95]], $MachinePrecision]], N[(N[(x + N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(a + 1.0), $MachinePrecision] + N[(y * N[(b / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(z / b), $MachinePrecision] + N[(N[(x * t), $MachinePrecision] / N[(y * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.5 \cdot 10^{-164} \lor \neg \left(t \leq 2.1 \cdot 10^{-95}\right):\\
\;\;\;\;\frac{x + y \cdot \frac{z}{t}}{\left(a + 1\right) + y \cdot \frac{b}{t}}\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{b} + \frac{x \cdot t}{y \cdot b}\\
\end{array}
\end{array}
if t < -3.5e-164 or 2.1e-95 < t Initial program 83.7%
*-commutative83.7%
associate-*l/84.9%
*-commutative84.9%
associate-*l/91.0%
Simplified91.0%
if -3.5e-164 < t < 2.1e-95Initial program 51.5%
*-commutative51.5%
associate-*l/44.3%
*-commutative44.3%
associate-*l/39.6%
Simplified39.6%
Taylor expanded in b around inf 44.5%
associate-/l*41.9%
associate-*r/38.3%
*-commutative38.3%
associate-*l/41.9%
associate-*r/31.5%
fma-udef31.5%
Simplified31.5%
Taylor expanded in t around 0 72.6%
Final simplification85.1%
(FPCore (x y z t a b) :precision binary64 (if (or (<= t -3e-166) (not (<= t 1.45e-125))) (/ (+ x (/ z (/ t y))) (+ a (+ (/ y (/ t b)) 1.0))) (+ (/ z b) (/ (* x t) (* y b)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -3e-166) || !(t <= 1.45e-125)) {
tmp = (x + (z / (t / y))) / (a + ((y / (t / b)) + 1.0));
} else {
tmp = (z / b) + ((x * 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) :: tmp
if ((t <= (-3d-166)) .or. (.not. (t <= 1.45d-125))) then
tmp = (x + (z / (t / y))) / (a + ((y / (t / b)) + 1.0d0))
else
tmp = (z / b) + ((x * 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 tmp;
if ((t <= -3e-166) || !(t <= 1.45e-125)) {
tmp = (x + (z / (t / y))) / (a + ((y / (t / b)) + 1.0));
} else {
tmp = (z / b) + ((x * t) / (y * b));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (t <= -3e-166) or not (t <= 1.45e-125): tmp = (x + (z / (t / y))) / (a + ((y / (t / b)) + 1.0)) else: tmp = (z / b) + ((x * t) / (y * b)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((t <= -3e-166) || !(t <= 1.45e-125)) tmp = Float64(Float64(x + Float64(z / Float64(t / y))) / Float64(a + Float64(Float64(y / Float64(t / b)) + 1.0))); else tmp = Float64(Float64(z / b) + Float64(Float64(x * t) / Float64(y * b))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((t <= -3e-166) || ~((t <= 1.45e-125))) tmp = (x + (z / (t / y))) / (a + ((y / (t / b)) + 1.0)); else tmp = (z / b) + ((x * t) / (y * b)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[t, -3e-166], N[Not[LessEqual[t, 1.45e-125]], $MachinePrecision]], N[(N[(x + N[(z / N[(t / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(a + N[(N[(y / N[(t / b), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(z / b), $MachinePrecision] + N[(N[(x * t), $MachinePrecision] / N[(y * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3 \cdot 10^{-166} \lor \neg \left(t \leq 1.45 \cdot 10^{-125}\right):\\
\;\;\;\;\frac{x + \frac{z}{\frac{t}{y}}}{a + \left(\frac{y}{\frac{t}{b}} + 1\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{b} + \frac{x \cdot t}{y \cdot b}\\
\end{array}
\end{array}
if t < -3.0000000000000003e-166 or 1.4500000000000001e-125 < t Initial program 83.4%
*-commutative83.4%
associate-/l*85.6%
associate-*l/90.8%
*-commutative90.8%
cancel-sign-sub90.8%
*-commutative90.8%
associate-*l/85.6%
associate-+r-85.6%
associate-*l/90.8%
*-commutative90.8%
cancel-sign-sub90.8%
*-commutative90.8%
associate-/r/90.3%
Simplified90.3%
if -3.0000000000000003e-166 < t < 1.4500000000000001e-125Initial program 48.3%
*-commutative48.3%
associate-*l/42.8%
*-commutative42.8%
associate-*l/38.9%
Simplified38.9%
Taylor expanded in b around inf 47.1%
associate-/l*44.1%
associate-*r/41.4%
*-commutative41.4%
associate-*l/44.1%
associate-*r/33.8%
fma-udef33.8%
Simplified33.8%
Taylor expanded in t around 0 75.9%
Final simplification86.2%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ x (+ a 1.0))))
(if (<= t -6.2e+145)
t_1
(if (<= t -6.8e+65)
(* (+ x (* y (/ z t))) (/ 1.0 a))
(if (or (<= t -1.15e-11) (not (<= t 1.05e-103)))
t_1
(+ (/ z b) (/ (* x t) (* y b))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x / (a + 1.0);
double tmp;
if (t <= -6.2e+145) {
tmp = t_1;
} else if (t <= -6.8e+65) {
tmp = (x + (y * (z / t))) * (1.0 / a);
} else if ((t <= -1.15e-11) || !(t <= 1.05e-103)) {
tmp = t_1;
} else {
tmp = (z / b) + ((x * 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 / (a + 1.0d0)
if (t <= (-6.2d+145)) then
tmp = t_1
else if (t <= (-6.8d+65)) then
tmp = (x + (y * (z / t))) * (1.0d0 / a)
else if ((t <= (-1.15d-11)) .or. (.not. (t <= 1.05d-103))) then
tmp = t_1
else
tmp = (z / b) + ((x * 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 / (a + 1.0);
double tmp;
if (t <= -6.2e+145) {
tmp = t_1;
} else if (t <= -6.8e+65) {
tmp = (x + (y * (z / t))) * (1.0 / a);
} else if ((t <= -1.15e-11) || !(t <= 1.05e-103)) {
tmp = t_1;
} else {
tmp = (z / b) + ((x * t) / (y * b));
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x / (a + 1.0) tmp = 0 if t <= -6.2e+145: tmp = t_1 elif t <= -6.8e+65: tmp = (x + (y * (z / t))) * (1.0 / a) elif (t <= -1.15e-11) or not (t <= 1.05e-103): tmp = t_1 else: tmp = (z / b) + ((x * t) / (y * b)) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x / Float64(a + 1.0)) tmp = 0.0 if (t <= -6.2e+145) tmp = t_1; elseif (t <= -6.8e+65) tmp = Float64(Float64(x + Float64(y * Float64(z / t))) * Float64(1.0 / a)); elseif ((t <= -1.15e-11) || !(t <= 1.05e-103)) tmp = t_1; else tmp = Float64(Float64(z / b) + Float64(Float64(x * t) / Float64(y * b))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x / (a + 1.0); tmp = 0.0; if (t <= -6.2e+145) tmp = t_1; elseif (t <= -6.8e+65) tmp = (x + (y * (z / t))) * (1.0 / a); elseif ((t <= -1.15e-11) || ~((t <= 1.05e-103))) tmp = t_1; else tmp = (z / b) + ((x * t) / (y * b)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x / N[(a + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -6.2e+145], t$95$1, If[LessEqual[t, -6.8e+65], N[(N[(x + N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 / a), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[t, -1.15e-11], N[Not[LessEqual[t, 1.05e-103]], $MachinePrecision]], t$95$1, N[(N[(z / b), $MachinePrecision] + N[(N[(x * t), $MachinePrecision] / N[(y * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{a + 1}\\
\mathbf{if}\;t \leq -6.2 \cdot 10^{+145}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq -6.8 \cdot 10^{+65}:\\
\;\;\;\;\left(x + y \cdot \frac{z}{t}\right) \cdot \frac{1}{a}\\
\mathbf{elif}\;t \leq -1.15 \cdot 10^{-11} \lor \neg \left(t \leq 1.05 \cdot 10^{-103}\right):\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{b} + \frac{x \cdot t}{y \cdot b}\\
\end{array}
\end{array}
if t < -6.19999999999999977e145 or -6.7999999999999999e65 < t < -1.15000000000000007e-11 or 1.05000000000000002e-103 < t Initial program 84.9%
*-commutative84.9%
associate-*l/85.0%
*-commutative85.0%
associate-*l/92.0%
Simplified92.0%
Taylor expanded in t around inf 63.6%
if -6.19999999999999977e145 < t < -6.7999999999999999e65Initial program 74.3%
*-commutative74.3%
associate-*l/87.0%
*-commutative87.0%
associate-*l/87.1%
Simplified87.1%
associate-*l/74.4%
*-commutative74.4%
associate-/l*87.0%
clear-num87.1%
Applied egg-rr87.1%
div-inv86.8%
associate-/r/87.0%
clear-num87.1%
associate-+l+87.1%
*-commutative87.1%
Applied egg-rr87.1%
Taylor expanded in a around inf 62.0%
if -1.15000000000000007e-11 < t < 1.05000000000000002e-103Initial program 58.3%
*-commutative58.3%
associate-*l/52.8%
*-commutative52.8%
associate-*l/50.1%
Simplified50.1%
Taylor expanded in b around inf 45.5%
associate-/l*43.4%
associate-*r/41.5%
*-commutative41.5%
associate-*l/43.4%
associate-*r/34.3%
fma-udef34.3%
Simplified34.3%
Taylor expanded in t around 0 70.2%
Final simplification66.2%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ x (+ (+ a 1.0) (* y (/ b t))))))
(if (<= t -6.2e+145)
t_1
(if (<= t -3.15e+61)
(* (+ x (* y (/ z t))) (/ 1.0 a))
(if (or (<= t -6e-14) (not (<= t 1.5e-112)))
t_1
(+ (/ z b) (/ (* x t) (* y b))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x / ((a + 1.0) + (y * (b / t)));
double tmp;
if (t <= -6.2e+145) {
tmp = t_1;
} else if (t <= -3.15e+61) {
tmp = (x + (y * (z / t))) * (1.0 / a);
} else if ((t <= -6e-14) || !(t <= 1.5e-112)) {
tmp = t_1;
} else {
tmp = (z / b) + ((x * 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 / ((a + 1.0d0) + (y * (b / t)))
if (t <= (-6.2d+145)) then
tmp = t_1
else if (t <= (-3.15d+61)) then
tmp = (x + (y * (z / t))) * (1.0d0 / a)
else if ((t <= (-6d-14)) .or. (.not. (t <= 1.5d-112))) then
tmp = t_1
else
tmp = (z / b) + ((x * 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 / ((a + 1.0) + (y * (b / t)));
double tmp;
if (t <= -6.2e+145) {
tmp = t_1;
} else if (t <= -3.15e+61) {
tmp = (x + (y * (z / t))) * (1.0 / a);
} else if ((t <= -6e-14) || !(t <= 1.5e-112)) {
tmp = t_1;
} else {
tmp = (z / b) + ((x * t) / (y * b));
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x / ((a + 1.0) + (y * (b / t))) tmp = 0 if t <= -6.2e+145: tmp = t_1 elif t <= -3.15e+61: tmp = (x + (y * (z / t))) * (1.0 / a) elif (t <= -6e-14) or not (t <= 1.5e-112): tmp = t_1 else: tmp = (z / b) + ((x * t) / (y * b)) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x / Float64(Float64(a + 1.0) + Float64(y * Float64(b / t)))) tmp = 0.0 if (t <= -6.2e+145) tmp = t_1; elseif (t <= -3.15e+61) tmp = Float64(Float64(x + Float64(y * Float64(z / t))) * Float64(1.0 / a)); elseif ((t <= -6e-14) || !(t <= 1.5e-112)) tmp = t_1; else tmp = Float64(Float64(z / b) + Float64(Float64(x * t) / Float64(y * b))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x / ((a + 1.0) + (y * (b / t))); tmp = 0.0; if (t <= -6.2e+145) tmp = t_1; elseif (t <= -3.15e+61) tmp = (x + (y * (z / t))) * (1.0 / a); elseif ((t <= -6e-14) || ~((t <= 1.5e-112))) tmp = t_1; else tmp = (z / b) + ((x * t) / (y * b)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x / N[(N[(a + 1.0), $MachinePrecision] + N[(y * N[(b / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -6.2e+145], t$95$1, If[LessEqual[t, -3.15e+61], N[(N[(x + N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 / a), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[t, -6e-14], N[Not[LessEqual[t, 1.5e-112]], $MachinePrecision]], t$95$1, N[(N[(z / b), $MachinePrecision] + N[(N[(x * t), $MachinePrecision] / N[(y * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{\left(a + 1\right) + y \cdot \frac{b}{t}}\\
\mathbf{if}\;t \leq -6.2 \cdot 10^{+145}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq -3.15 \cdot 10^{+61}:\\
\;\;\;\;\left(x + y \cdot \frac{z}{t}\right) \cdot \frac{1}{a}\\
\mathbf{elif}\;t \leq -6 \cdot 10^{-14} \lor \neg \left(t \leq 1.5 \cdot 10^{-112}\right):\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{b} + \frac{x \cdot t}{y \cdot b}\\
\end{array}
\end{array}
if t < -6.19999999999999977e145 or -3.14999999999999988e61 < t < -5.9999999999999997e-14 or 1.5e-112 < t Initial program 85.0%
*-commutative85.0%
associate-*l/85.1%
*-commutative85.1%
associate-*l/92.1%
Simplified92.1%
Taylor expanded in x around inf 70.9%
if -6.19999999999999977e145 < t < -3.14999999999999988e61Initial program 74.3%
*-commutative74.3%
associate-*l/87.0%
*-commutative87.0%
associate-*l/87.1%
Simplified87.1%
associate-*l/74.4%
*-commutative74.4%
associate-/l*87.0%
clear-num87.1%
Applied egg-rr87.1%
div-inv86.8%
associate-/r/87.0%
clear-num87.1%
associate-+l+87.1%
*-commutative87.1%
Applied egg-rr87.1%
Taylor expanded in a around inf 62.0%
if -5.9999999999999997e-14 < t < 1.5e-112Initial program 57.9%
*-commutative57.9%
associate-*l/52.3%
*-commutative52.3%
associate-*l/49.6%
Simplified49.6%
Taylor expanded in b around inf 45.0%
associate-/l*42.8%
associate-*r/41.0%
*-commutative41.0%
associate-*l/42.8%
associate-*r/34.7%
fma-udef34.7%
Simplified34.7%
Taylor expanded in t around 0 69.9%
Final simplification69.9%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* y (/ b t))))
(if (<= t -2.7e+126)
(/ x (+ (+ a 1.0) t_1))
(if (<= t -1.7e+65)
(* (/ y t) (/ z (+ a (+ t_1 1.0))))
(if (or (<= t -2.4e-71) (not (<= t 5e-105)))
(/ (+ x (/ (* y z) t)) (+ a 1.0))
(+ (/ z b) (/ (* x t) (* y b))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = y * (b / t);
double tmp;
if (t <= -2.7e+126) {
tmp = x / ((a + 1.0) + t_1);
} else if (t <= -1.7e+65) {
tmp = (y / t) * (z / (a + (t_1 + 1.0)));
} else if ((t <= -2.4e-71) || !(t <= 5e-105)) {
tmp = (x + ((y * z) / t)) / (a + 1.0);
} else {
tmp = (z / b) + ((x * 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 = y * (b / t)
if (t <= (-2.7d+126)) then
tmp = x / ((a + 1.0d0) + t_1)
else if (t <= (-1.7d+65)) then
tmp = (y / t) * (z / (a + (t_1 + 1.0d0)))
else if ((t <= (-2.4d-71)) .or. (.not. (t <= 5d-105))) then
tmp = (x + ((y * z) / t)) / (a + 1.0d0)
else
tmp = (z / b) + ((x * 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 = y * (b / t);
double tmp;
if (t <= -2.7e+126) {
tmp = x / ((a + 1.0) + t_1);
} else if (t <= -1.7e+65) {
tmp = (y / t) * (z / (a + (t_1 + 1.0)));
} else if ((t <= -2.4e-71) || !(t <= 5e-105)) {
tmp = (x + ((y * z) / t)) / (a + 1.0);
} else {
tmp = (z / b) + ((x * t) / (y * b));
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = y * (b / t) tmp = 0 if t <= -2.7e+126: tmp = x / ((a + 1.0) + t_1) elif t <= -1.7e+65: tmp = (y / t) * (z / (a + (t_1 + 1.0))) elif (t <= -2.4e-71) or not (t <= 5e-105): tmp = (x + ((y * z) / t)) / (a + 1.0) else: tmp = (z / b) + ((x * t) / (y * b)) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(y * Float64(b / t)) tmp = 0.0 if (t <= -2.7e+126) tmp = Float64(x / Float64(Float64(a + 1.0) + t_1)); elseif (t <= -1.7e+65) tmp = Float64(Float64(y / t) * Float64(z / Float64(a + Float64(t_1 + 1.0)))); elseif ((t <= -2.4e-71) || !(t <= 5e-105)) tmp = Float64(Float64(x + Float64(Float64(y * z) / t)) / Float64(a + 1.0)); else tmp = Float64(Float64(z / b) + Float64(Float64(x * t) / Float64(y * b))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = y * (b / t); tmp = 0.0; if (t <= -2.7e+126) tmp = x / ((a + 1.0) + t_1); elseif (t <= -1.7e+65) tmp = (y / t) * (z / (a + (t_1 + 1.0))); elseif ((t <= -2.4e-71) || ~((t <= 5e-105))) tmp = (x + ((y * z) / t)) / (a + 1.0); else tmp = (z / b) + ((x * t) / (y * b)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(y * N[(b / t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -2.7e+126], N[(x / N[(N[(a + 1.0), $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -1.7e+65], N[(N[(y / t), $MachinePrecision] * N[(z / N[(a + N[(t$95$1 + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[t, -2.4e-71], N[Not[LessEqual[t, 5e-105]], $MachinePrecision]], N[(N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] / N[(a + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(z / b), $MachinePrecision] + N[(N[(x * t), $MachinePrecision] / N[(y * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \frac{b}{t}\\
\mathbf{if}\;t \leq -2.7 \cdot 10^{+126}:\\
\;\;\;\;\frac{x}{\left(a + 1\right) + t_1}\\
\mathbf{elif}\;t \leq -1.7 \cdot 10^{+65}:\\
\;\;\;\;\frac{y}{t} \cdot \frac{z}{a + \left(t_1 + 1\right)}\\
\mathbf{elif}\;t \leq -2.4 \cdot 10^{-71} \lor \neg \left(t \leq 5 \cdot 10^{-105}\right):\\
\;\;\;\;\frac{x + \frac{y \cdot z}{t}}{a + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{b} + \frac{x \cdot t}{y \cdot b}\\
\end{array}
\end{array}
if t < -2.70000000000000002e126Initial program 77.9%
*-commutative77.9%
associate-*l/84.4%
*-commutative84.4%
associate-*l/96.7%
Simplified96.7%
Taylor expanded in x around inf 81.0%
if -2.70000000000000002e126 < t < -1.7e65Initial program 65.0%
*-commutative65.0%
associate-*l/82.3%
*-commutative82.3%
associate-*l/82.5%
Simplified82.5%
associate-*l/65.1%
*-commutative65.1%
associate-/l*82.3%
clear-num82.5%
Applied egg-rr82.5%
Taylor expanded in x around 0 56.0%
times-frac81.8%
associate-+r+81.8%
associate-*r/90.7%
+-commutative90.7%
Simplified90.7%
if -1.7e65 < t < -2.4e-71 or 4.99999999999999963e-105 < t Initial program 87.8%
*-commutative87.8%
associate-*l/85.5%
*-commutative85.5%
associate-*l/90.3%
Simplified90.3%
Taylor expanded in b around 0 79.1%
if -2.4e-71 < t < 4.99999999999999963e-105Initial program 54.1%
*-commutative54.1%
associate-*l/48.8%
*-commutative48.8%
associate-*l/45.8%
Simplified45.8%
Taylor expanded in b around inf 48.0%
associate-/l*45.6%
associate-*r/43.5%
*-commutative43.5%
associate-*l/45.6%
associate-*r/35.4%
fma-udef35.4%
Simplified35.4%
Taylor expanded in t around 0 74.7%
Final simplification78.2%
(FPCore (x y z t a b)
:precision binary64
(if (<= t -1.45e+181)
(/ x (+ (+ a 1.0) (* y (/ b t))))
(if (or (<= t -2.8e-71) (not (<= t 5.5e-109)))
(/ (+ x (/ (* y z) t)) (+ a 1.0))
(+ (/ z b) (/ (* x t) (* y b))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -1.45e+181) {
tmp = x / ((a + 1.0) + (y * (b / t)));
} else if ((t <= -2.8e-71) || !(t <= 5.5e-109)) {
tmp = (x + ((y * z) / t)) / (a + 1.0);
} else {
tmp = (z / b) + ((x * 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) :: tmp
if (t <= (-1.45d+181)) then
tmp = x / ((a + 1.0d0) + (y * (b / t)))
else if ((t <= (-2.8d-71)) .or. (.not. (t <= 5.5d-109))) then
tmp = (x + ((y * z) / t)) / (a + 1.0d0)
else
tmp = (z / b) + ((x * 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 tmp;
if (t <= -1.45e+181) {
tmp = x / ((a + 1.0) + (y * (b / t)));
} else if ((t <= -2.8e-71) || !(t <= 5.5e-109)) {
tmp = (x + ((y * z) / t)) / (a + 1.0);
} else {
tmp = (z / b) + ((x * t) / (y * b));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if t <= -1.45e+181: tmp = x / ((a + 1.0) + (y * (b / t))) elif (t <= -2.8e-71) or not (t <= 5.5e-109): tmp = (x + ((y * z) / t)) / (a + 1.0) else: tmp = (z / b) + ((x * t) / (y * b)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (t <= -1.45e+181) tmp = Float64(x / Float64(Float64(a + 1.0) + Float64(y * Float64(b / t)))); elseif ((t <= -2.8e-71) || !(t <= 5.5e-109)) tmp = Float64(Float64(x + Float64(Float64(y * z) / t)) / Float64(a + 1.0)); else tmp = Float64(Float64(z / b) + Float64(Float64(x * t) / Float64(y * b))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (t <= -1.45e+181) tmp = x / ((a + 1.0) + (y * (b / t))); elseif ((t <= -2.8e-71) || ~((t <= 5.5e-109))) tmp = (x + ((y * z) / t)) / (a + 1.0); else tmp = (z / b) + ((x * t) / (y * b)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -1.45e+181], N[(x / N[(N[(a + 1.0), $MachinePrecision] + N[(y * N[(b / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[t, -2.8e-71], N[Not[LessEqual[t, 5.5e-109]], $MachinePrecision]], N[(N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] / N[(a + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(z / b), $MachinePrecision] + N[(N[(x * t), $MachinePrecision] / N[(y * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.45 \cdot 10^{+181}:\\
\;\;\;\;\frac{x}{\left(a + 1\right) + y \cdot \frac{b}{t}}\\
\mathbf{elif}\;t \leq -2.8 \cdot 10^{-71} \lor \neg \left(t \leq 5.5 \cdot 10^{-109}\right):\\
\;\;\;\;\frac{x + \frac{y \cdot z}{t}}{a + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{b} + \frac{x \cdot t}{y \cdot b}\\
\end{array}
\end{array}
if t < -1.45e181Initial program 65.8%
*-commutative65.8%
associate-*l/75.8%
*-commutative75.8%
associate-*l/94.9%
Simplified94.9%
Taylor expanded in x around inf 76.8%
if -1.45e181 < t < -2.8e-71 or 5.5000000000000003e-109 < t Initial program 87.0%
*-commutative87.0%
associate-*l/86.4%
*-commutative86.4%
associate-*l/90.4%
Simplified90.4%
Taylor expanded in b around 0 77.6%
if -2.8e-71 < t < 5.5000000000000003e-109Initial program 54.1%
*-commutative54.1%
associate-*l/48.8%
*-commutative48.8%
associate-*l/45.8%
Simplified45.8%
Taylor expanded in b around inf 48.0%
associate-/l*45.6%
associate-*r/43.5%
*-commutative43.5%
associate-*l/45.6%
associate-*r/35.4%
fma-udef35.4%
Simplified35.4%
Taylor expanded in t around 0 74.7%
Final simplification76.5%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ x (+ a 1.0))))
(if (<= t -6.2e+145)
t_1
(if (<= t -2.2e+65)
(* (+ x (* y (/ z t))) (/ 1.0 a))
(if (or (<= t -4.5e-12) (not (<= t 1.05e-103))) t_1 (/ z b))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x / (a + 1.0);
double tmp;
if (t <= -6.2e+145) {
tmp = t_1;
} else if (t <= -2.2e+65) {
tmp = (x + (y * (z / t))) * (1.0 / a);
} else if ((t <= -4.5e-12) || !(t <= 1.05e-103)) {
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 / (a + 1.0d0)
if (t <= (-6.2d+145)) then
tmp = t_1
else if (t <= (-2.2d+65)) then
tmp = (x + (y * (z / t))) * (1.0d0 / a)
else if ((t <= (-4.5d-12)) .or. (.not. (t <= 1.05d-103))) 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 / (a + 1.0);
double tmp;
if (t <= -6.2e+145) {
tmp = t_1;
} else if (t <= -2.2e+65) {
tmp = (x + (y * (z / t))) * (1.0 / a);
} else if ((t <= -4.5e-12) || !(t <= 1.05e-103)) {
tmp = t_1;
} else {
tmp = z / b;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x / (a + 1.0) tmp = 0 if t <= -6.2e+145: tmp = t_1 elif t <= -2.2e+65: tmp = (x + (y * (z / t))) * (1.0 / a) elif (t <= -4.5e-12) or not (t <= 1.05e-103): tmp = t_1 else: tmp = z / b return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x / Float64(a + 1.0)) tmp = 0.0 if (t <= -6.2e+145) tmp = t_1; elseif (t <= -2.2e+65) tmp = Float64(Float64(x + Float64(y * Float64(z / t))) * Float64(1.0 / a)); elseif ((t <= -4.5e-12) || !(t <= 1.05e-103)) 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 / (a + 1.0); tmp = 0.0; if (t <= -6.2e+145) tmp = t_1; elseif (t <= -2.2e+65) tmp = (x + (y * (z / t))) * (1.0 / a); elseif ((t <= -4.5e-12) || ~((t <= 1.05e-103))) tmp = t_1; else tmp = z / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x / N[(a + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -6.2e+145], t$95$1, If[LessEqual[t, -2.2e+65], N[(N[(x + N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 / a), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[t, -4.5e-12], N[Not[LessEqual[t, 1.05e-103]], $MachinePrecision]], t$95$1, N[(z / b), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{a + 1}\\
\mathbf{if}\;t \leq -6.2 \cdot 10^{+145}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq -2.2 \cdot 10^{+65}:\\
\;\;\;\;\left(x + y \cdot \frac{z}{t}\right) \cdot \frac{1}{a}\\
\mathbf{elif}\;t \leq -4.5 \cdot 10^{-12} \lor \neg \left(t \leq 1.05 \cdot 10^{-103}\right):\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{b}\\
\end{array}
\end{array}
if t < -6.19999999999999977e145 or -2.1999999999999998e65 < t < -4.49999999999999981e-12 or 1.05000000000000002e-103 < t Initial program 84.9%
*-commutative84.9%
associate-*l/85.0%
*-commutative85.0%
associate-*l/92.0%
Simplified92.0%
Taylor expanded in t around inf 63.6%
if -6.19999999999999977e145 < t < -2.1999999999999998e65Initial program 74.3%
*-commutative74.3%
associate-*l/87.0%
*-commutative87.0%
associate-*l/87.1%
Simplified87.1%
associate-*l/74.4%
*-commutative74.4%
associate-/l*87.0%
clear-num87.1%
Applied egg-rr87.1%
div-inv86.8%
associate-/r/87.0%
clear-num87.1%
associate-+l+87.1%
*-commutative87.1%
Applied egg-rr87.1%
Taylor expanded in a around inf 62.0%
if -4.49999999999999981e-12 < t < 1.05000000000000002e-103Initial program 58.3%
*-commutative58.3%
associate-*l/52.8%
*-commutative52.8%
associate-*l/50.1%
Simplified50.1%
Taylor expanded in t around 0 60.3%
Final simplification62.2%
(FPCore (x y z t a b)
:precision binary64
(if (or (<= t -2.9e+123)
(not
(or (<= t -4.6e+66) (and (not (<= t -4.4e-14)) (<= t 1.05e-103)))))
(/ x (+ a 1.0))
(/ z b)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -2.9e+123) || !((t <= -4.6e+66) || (!(t <= -4.4e-14) && (t <= 1.05e-103)))) {
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 ((t <= (-2.9d+123)) .or. (.not. (t <= (-4.6d+66)) .or. (.not. (t <= (-4.4d-14))) .and. (t <= 1.05d-103))) 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 ((t <= -2.9e+123) || !((t <= -4.6e+66) || (!(t <= -4.4e-14) && (t <= 1.05e-103)))) {
tmp = x / (a + 1.0);
} else {
tmp = z / b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (t <= -2.9e+123) or not ((t <= -4.6e+66) or (not (t <= -4.4e-14) and (t <= 1.05e-103))): tmp = x / (a + 1.0) else: tmp = z / b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((t <= -2.9e+123) || !((t <= -4.6e+66) || (!(t <= -4.4e-14) && (t <= 1.05e-103)))) 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 ((t <= -2.9e+123) || ~(((t <= -4.6e+66) || (~((t <= -4.4e-14)) && (t <= 1.05e-103))))) tmp = x / (a + 1.0); else tmp = z / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[t, -2.9e+123], N[Not[Or[LessEqual[t, -4.6e+66], And[N[Not[LessEqual[t, -4.4e-14]], $MachinePrecision], LessEqual[t, 1.05e-103]]]], $MachinePrecision]], N[(x / N[(a + 1.0), $MachinePrecision]), $MachinePrecision], N[(z / b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.9 \cdot 10^{+123} \lor \neg \left(t \leq -4.6 \cdot 10^{+66} \lor \neg \left(t \leq -4.4 \cdot 10^{-14}\right) \land t \leq 1.05 \cdot 10^{-103}\right):\\
\;\;\;\;\frac{x}{a + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{b}\\
\end{array}
\end{array}
if t < -2.9000000000000001e123 or -4.6e66 < t < -4.4000000000000002e-14 or 1.05000000000000002e-103 < t Initial program 85.3%
*-commutative85.3%
associate-*l/85.4%
*-commutative85.4%
associate-*l/92.3%
Simplified92.3%
Taylor expanded in t around inf 64.6%
if -2.9000000000000001e123 < t < -4.6e66 or -4.4000000000000002e-14 < t < 1.05000000000000002e-103Initial program 59.0%
*-commutative59.0%
associate-*l/55.6%
*-commutative55.6%
associate-*l/53.1%
Simplified53.1%
Taylor expanded in t around 0 59.0%
Final simplification62.1%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ x (+ a 1.0))))
(if (<= t -2.05e+149)
t_1
(if (<= t -1.4e+62)
(/ (+ x (* y (/ z t))) a)
(if (or (<= t -3.1e-12) (not (<= t 1e-103))) t_1 (/ z b))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x / (a + 1.0);
double tmp;
if (t <= -2.05e+149) {
tmp = t_1;
} else if (t <= -1.4e+62) {
tmp = (x + (y * (z / t))) / a;
} else if ((t <= -3.1e-12) || !(t <= 1e-103)) {
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 / (a + 1.0d0)
if (t <= (-2.05d+149)) then
tmp = t_1
else if (t <= (-1.4d+62)) then
tmp = (x + (y * (z / t))) / a
else if ((t <= (-3.1d-12)) .or. (.not. (t <= 1d-103))) 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 / (a + 1.0);
double tmp;
if (t <= -2.05e+149) {
tmp = t_1;
} else if (t <= -1.4e+62) {
tmp = (x + (y * (z / t))) / a;
} else if ((t <= -3.1e-12) || !(t <= 1e-103)) {
tmp = t_1;
} else {
tmp = z / b;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x / (a + 1.0) tmp = 0 if t <= -2.05e+149: tmp = t_1 elif t <= -1.4e+62: tmp = (x + (y * (z / t))) / a elif (t <= -3.1e-12) or not (t <= 1e-103): tmp = t_1 else: tmp = z / b return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x / Float64(a + 1.0)) tmp = 0.0 if (t <= -2.05e+149) tmp = t_1; elseif (t <= -1.4e+62) tmp = Float64(Float64(x + Float64(y * Float64(z / t))) / a); elseif ((t <= -3.1e-12) || !(t <= 1e-103)) 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 / (a + 1.0); tmp = 0.0; if (t <= -2.05e+149) tmp = t_1; elseif (t <= -1.4e+62) tmp = (x + (y * (z / t))) / a; elseif ((t <= -3.1e-12) || ~((t <= 1e-103))) tmp = t_1; else tmp = z / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x / N[(a + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -2.05e+149], t$95$1, If[LessEqual[t, -1.4e+62], N[(N[(x + N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision], If[Or[LessEqual[t, -3.1e-12], N[Not[LessEqual[t, 1e-103]], $MachinePrecision]], t$95$1, N[(z / b), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{a + 1}\\
\mathbf{if}\;t \leq -2.05 \cdot 10^{+149}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq -1.4 \cdot 10^{+62}:\\
\;\;\;\;\frac{x + y \cdot \frac{z}{t}}{a}\\
\mathbf{elif}\;t \leq -3.1 \cdot 10^{-12} \lor \neg \left(t \leq 10^{-103}\right):\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{b}\\
\end{array}
\end{array}
if t < -2.0499999999999998e149 or -1.40000000000000007e62 < t < -3.1000000000000001e-12 or 9.99999999999999958e-104 < t Initial program 84.8%
*-commutative84.8%
associate-*l/84.9%
*-commutative84.9%
associate-*l/92.0%
Simplified92.0%
Taylor expanded in t around inf 63.3%
if -2.0499999999999998e149 < t < -1.40000000000000007e62Initial program 75.9%
*-commutative75.9%
associate-*l/87.8%
*-commutative87.8%
associate-*l/87.9%
Simplified87.9%
associate-*l/76.0%
*-commutative76.0%
associate-/l*87.8%
clear-num87.9%
Applied egg-rr87.9%
Taylor expanded in a around inf 58.1%
+-commutative58.1%
associate-*r/64.3%
Simplified64.3%
if -3.1000000000000001e-12 < t < 9.99999999999999958e-104Initial program 58.3%
*-commutative58.3%
associate-*l/52.8%
*-commutative52.8%
associate-*l/50.1%
Simplified50.1%
Taylor expanded in t around 0 60.3%
Final simplification62.2%
(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 77.2%
*-commutative77.2%
associate-/l*77.7%
associate-*l/80.4%
*-commutative80.4%
cancel-sign-sub80.4%
*-commutative80.4%
associate-*l/77.7%
associate-+r-77.7%
associate-*l/80.4%
*-commutative80.4%
cancel-sign-sub80.4%
*-commutative80.4%
associate-/r/79.2%
Simplified79.2%
Taylor expanded in x around inf 52.7%
Taylor expanded in a around inf 44.8%
if -1 < a < 1Initial program 69.2%
*-commutative69.2%
associate-/l*68.5%
associate-*l/72.3%
*-commutative72.3%
cancel-sign-sub72.3%
*-commutative72.3%
associate-*l/68.5%
associate-+r-68.5%
associate-*l/72.3%
*-commutative72.3%
cancel-sign-sub72.3%
*-commutative72.3%
associate-/r/70.9%
Simplified70.9%
Taylor expanded in x around inf 45.9%
Taylor expanded in a around 0 44.5%
Taylor expanded in y around 0 36.8%
Final simplification40.9%
(FPCore (x y z t a b) :precision binary64 (if (<= t -3.3e+123) (/ x a) (if (<= t 2.7e-95) (/ z b) (/ x a))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -3.3e+123) {
tmp = x / a;
} else if (t <= 2.7e-95) {
tmp = z / b;
} else {
tmp = x / a;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (t <= (-3.3d+123)) then
tmp = x / a
else if (t <= 2.7d-95) then
tmp = z / b
else
tmp = x / a
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -3.3e+123) {
tmp = x / a;
} else if (t <= 2.7e-95) {
tmp = z / b;
} else {
tmp = x / a;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if t <= -3.3e+123: tmp = x / a elif t <= 2.7e-95: tmp = z / b else: tmp = x / a return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (t <= -3.3e+123) tmp = Float64(x / a); elseif (t <= 2.7e-95) tmp = Float64(z / b); else tmp = Float64(x / a); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (t <= -3.3e+123) tmp = x / a; elseif (t <= 2.7e-95) tmp = z / b; else tmp = x / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -3.3e+123], N[(x / a), $MachinePrecision], If[LessEqual[t, 2.7e-95], N[(z / b), $MachinePrecision], N[(x / a), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.3 \cdot 10^{+123}:\\
\;\;\;\;\frac{x}{a}\\
\mathbf{elif}\;t \leq 2.7 \cdot 10^{-95}:\\
\;\;\;\;\frac{z}{b}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{a}\\
\end{array}
\end{array}
if t < -3.30000000000000003e123 or 2.7e-95 < t Initial program 86.5%
*-commutative86.5%
associate-/l*88.3%
associate-*l/95.7%
*-commutative95.7%
cancel-sign-sub95.7%
*-commutative95.7%
associate-*l/88.3%
associate-+r-88.3%
associate-*l/95.7%
*-commutative95.7%
cancel-sign-sub95.7%
*-commutative95.7%
associate-/r/96.6%
Simplified96.6%
Taylor expanded in x around inf 69.5%
Taylor expanded in a around inf 39.5%
if -3.30000000000000003e123 < t < 2.7e-95Initial program 62.5%
*-commutative62.5%
associate-*l/58.3%
*-commutative58.3%
associate-*l/56.3%
Simplified56.3%
Taylor expanded in t around 0 53.8%
Final simplification47.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 73.4%
*-commutative73.4%
associate-/l*73.3%
associate-*l/76.5%
*-commutative76.5%
cancel-sign-sub76.5%
*-commutative76.5%
associate-*l/73.3%
associate-+r-73.3%
associate-*l/76.5%
*-commutative76.5%
cancel-sign-sub76.5%
*-commutative76.5%
associate-/r/75.2%
Simplified75.2%
Taylor expanded in x around inf 49.4%
Taylor expanded in a around 0 29.2%
Taylor expanded in y around 0 19.6%
Final simplification19.6%
(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 2023279
(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))))