
(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 (/ (* y b) t))
(t_2 (+ x (/ (* y z) t)))
(t_3 (/ t_2 (+ (+ a 1.0) t_1)))
(t_4 (+ 1.0 (+ a t_1))))
(if (<= t_3 (- INFINITY))
(* z (+ (/ x (* z t_4)) (/ y (* t t_4))))
(if (<= t_3 5e+305) (/ t_2 (+ (+ a 1.0) (* b (/ y t)))) (/ z b)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (y * b) / t;
double t_2 = x + ((y * z) / t);
double t_3 = t_2 / ((a + 1.0) + t_1);
double t_4 = 1.0 + (a + t_1);
double tmp;
if (t_3 <= -((double) INFINITY)) {
tmp = z * ((x / (z * t_4)) + (y / (t * t_4)));
} else if (t_3 <= 5e+305) {
tmp = t_2 / ((a + 1.0) + (b * (y / t)));
} else {
tmp = z / b;
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (y * b) / t;
double t_2 = x + ((y * z) / t);
double t_3 = t_2 / ((a + 1.0) + t_1);
double t_4 = 1.0 + (a + t_1);
double tmp;
if (t_3 <= -Double.POSITIVE_INFINITY) {
tmp = z * ((x / (z * t_4)) + (y / (t * t_4)));
} else if (t_3 <= 5e+305) {
tmp = t_2 / ((a + 1.0) + (b * (y / t)));
} else {
tmp = z / b;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (y * b) / t t_2 = x + ((y * z) / t) t_3 = t_2 / ((a + 1.0) + t_1) t_4 = 1.0 + (a + t_1) tmp = 0 if t_3 <= -math.inf: tmp = z * ((x / (z * t_4)) + (y / (t * t_4))) elif t_3 <= 5e+305: tmp = t_2 / ((a + 1.0) + (b * (y / t))) else: tmp = z / b return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(y * b) / t) t_2 = Float64(x + Float64(Float64(y * z) / t)) t_3 = Float64(t_2 / Float64(Float64(a + 1.0) + t_1)) t_4 = Float64(1.0 + Float64(a + t_1)) tmp = 0.0 if (t_3 <= Float64(-Inf)) tmp = Float64(z * Float64(Float64(x / Float64(z * t_4)) + Float64(y / Float64(t * t_4)))); elseif (t_3 <= 5e+305) tmp = Float64(t_2 / Float64(Float64(a + 1.0) + Float64(b * Float64(y / t)))); else tmp = Float64(z / b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (y * b) / t; t_2 = x + ((y * z) / t); t_3 = t_2 / ((a + 1.0) + t_1); t_4 = 1.0 + (a + t_1); tmp = 0.0; if (t_3 <= -Inf) tmp = z * ((x / (z * t_4)) + (y / (t * t_4))); elseif (t_3 <= 5e+305) tmp = t_2 / ((a + 1.0) + (b * (y / t))); else tmp = z / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(t$95$2 / N[(N[(a + 1.0), $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(1.0 + N[(a + t$95$1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$3, (-Infinity)], N[(z * N[(N[(x / N[(z * t$95$4), $MachinePrecision]), $MachinePrecision] + N[(y / N[(t * t$95$4), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$3, 5e+305], N[(t$95$2 / N[(N[(a + 1.0), $MachinePrecision] + N[(b * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z / b), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y \cdot b}{t}\\
t_2 := x + \frac{y \cdot z}{t}\\
t_3 := \frac{t\_2}{\left(a + 1\right) + t\_1}\\
t_4 := 1 + \left(a + t\_1\right)\\
\mathbf{if}\;t\_3 \leq -\infty:\\
\;\;\;\;z \cdot \left(\frac{x}{z \cdot t\_4} + \frac{y}{t \cdot t\_4}\right)\\
\mathbf{elif}\;t\_3 \leq 5 \cdot 10^{+305}:\\
\;\;\;\;\frac{t\_2}{\left(a + 1\right) + b \cdot \frac{y}{t}}\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{b}\\
\end{array}
\end{array}
if (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < -inf.0Initial program 41.1%
associate-/l*59.0%
associate-/l*59.0%
Simplified59.0%
Taylor expanded in z around inf 93.5%
if -inf.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < 5.00000000000000009e305Initial program 92.4%
*-commutative92.4%
associate-/l*92.8%
Applied egg-rr92.8%
if 5.00000000000000009e305 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) Initial program 6.9%
associate-/l*17.5%
associate-/l*22.4%
Simplified22.4%
Taylor expanded in y around inf 84.2%
Final simplification91.6%
(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 (- INFINITY))
(* y (/ z (* t (+ 1.0 (+ a (/ y (/ t b)))))))
(if (<= t_2 5e+305) (/ t_1 (+ (+ a 1.0) (* b (/ y t)))) (/ z b)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x + ((y * z) / t);
double t_2 = t_1 / ((a + 1.0) + ((y * b) / t));
double tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = y * (z / (t * (1.0 + (a + (y / (t / b))))));
} else if (t_2 <= 5e+305) {
tmp = t_1 / ((a + 1.0) + (b * (y / t)));
} else {
tmp = z / b;
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x + ((y * z) / t);
double t_2 = t_1 / ((a + 1.0) + ((y * b) / t));
double tmp;
if (t_2 <= -Double.POSITIVE_INFINITY) {
tmp = y * (z / (t * (1.0 + (a + (y / (t / b))))));
} else if (t_2 <= 5e+305) {
tmp = t_1 / ((a + 1.0) + (b * (y / t)));
} 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 <= -math.inf: tmp = y * (z / (t * (1.0 + (a + (y / (t / b)))))) elif t_2 <= 5e+305: tmp = t_1 / ((a + 1.0) + (b * (y / t))) 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 <= Float64(-Inf)) tmp = Float64(y * Float64(z / Float64(t * Float64(1.0 + Float64(a + Float64(y / Float64(t / b))))))); elseif (t_2 <= 5e+305) tmp = Float64(t_1 / Float64(Float64(a + 1.0) + Float64(b * Float64(y / t)))); 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 <= -Inf) tmp = y * (z / (t * (1.0 + (a + (y / (t / b)))))); elseif (t_2 <= 5e+305) tmp = t_1 / ((a + 1.0) + (b * (y / t))); 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, (-Infinity)], N[(y * N[(z / N[(t * N[(1.0 + N[(a + N[(y / N[(t / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 5e+305], N[(t$95$1 / N[(N[(a + 1.0), $MachinePrecision] + N[(b * N[(y / t), $MachinePrecision]), $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 -\infty:\\
\;\;\;\;y \cdot \frac{z}{t \cdot \left(1 + \left(a + \frac{y}{\frac{t}{b}}\right)\right)}\\
\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+305}:\\
\;\;\;\;\frac{t\_1}{\left(a + 1\right) + b \cdot \frac{y}{t}}\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{b}\\
\end{array}
\end{array}
if (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < -inf.0Initial program 41.1%
associate-/l*59.0%
associate-/l*59.0%
Simplified59.0%
Taylor expanded in x around 0 64.3%
associate-/l*93.4%
associate-*r/62.8%
*-commutative62.8%
associate-/r/93.4%
Simplified93.4%
if -inf.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < 5.00000000000000009e305Initial program 92.4%
*-commutative92.4%
associate-/l*92.8%
Applied egg-rr92.8%
if 5.00000000000000009e305 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) Initial program 6.9%
associate-/l*17.5%
associate-/l*22.4%
Simplified22.4%
Taylor expanded in y around inf 84.2%
(FPCore (x y z t a b) :precision binary64 (if (or (<= t -1.05e-161) (not (<= t 9e-140))) (/ (+ 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 <= -1.05e-161) || !(t <= 9e-140)) {
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 <= (-1.05d-161)) .or. (.not. (t <= 9d-140))) 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 <= -1.05e-161) || !(t <= 9e-140)) {
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 <= -1.05e-161) or not (t <= 9e-140): 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 <= -1.05e-161) || !(t <= 9e-140)) 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 <= -1.05e-161) || ~((t <= 9e-140))) 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, -1.05e-161], N[Not[LessEqual[t, 9e-140]], $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 -1.05 \cdot 10^{-161} \lor \neg \left(t \leq 9 \cdot 10^{-140}\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 < -1.05e-161 or 9.00000000000000008e-140 < t Initial program 84.0%
associate-/l*86.5%
associate-/l*88.5%
Simplified88.5%
if -1.05e-161 < t < 9.00000000000000008e-140Initial program 54.3%
associate-/l*49.6%
associate-/l*37.4%
Simplified37.4%
Taylor expanded in b around inf 43.2%
associate-/l*37.4%
associate-*r/38.8%
+-commutative38.8%
fma-undefine38.8%
*-commutative38.8%
Simplified38.8%
Taylor expanded in t around 0 75.6%
*-commutative75.6%
Simplified75.6%
Final simplification85.3%
(FPCore (x y z t a b)
:precision binary64
(if (<= t -7.2e-158)
(/ (+ x (* y (/ z t))) (+ (+ a 1.0) (* y (/ b t))))
(if (<= t 8.2e-234)
(+ (/ z b) (/ (* x t) (* y b)))
(/ (+ x (* z (/ y t))) (+ (+ a 1.0) (/ (* y b) t))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -7.2e-158) {
tmp = (x + (y * (z / t))) / ((a + 1.0) + (y * (b / t)));
} else if (t <= 8.2e-234) {
tmp = (z / b) + ((x * t) / (y * b));
} else {
tmp = (x + (z * (y / t))) / ((a + 1.0) + ((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 (t <= (-7.2d-158)) then
tmp = (x + (y * (z / t))) / ((a + 1.0d0) + (y * (b / t)))
else if (t <= 8.2d-234) then
tmp = (z / b) + ((x * t) / (y * b))
else
tmp = (x + (z * (y / t))) / ((a + 1.0d0) + ((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 (t <= -7.2e-158) {
tmp = (x + (y * (z / t))) / ((a + 1.0) + (y * (b / t)));
} else if (t <= 8.2e-234) {
tmp = (z / b) + ((x * t) / (y * b));
} else {
tmp = (x + (z * (y / t))) / ((a + 1.0) + ((y * b) / t));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if t <= -7.2e-158: tmp = (x + (y * (z / t))) / ((a + 1.0) + (y * (b / t))) elif t <= 8.2e-234: tmp = (z / b) + ((x * t) / (y * b)) else: tmp = (x + (z * (y / t))) / ((a + 1.0) + ((y * b) / t)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (t <= -7.2e-158) tmp = Float64(Float64(x + Float64(y * Float64(z / t))) / Float64(Float64(a + 1.0) + Float64(y * Float64(b / t)))); elseif (t <= 8.2e-234) tmp = Float64(Float64(z / b) + Float64(Float64(x * t) / Float64(y * b))); else tmp = Float64(Float64(x + Float64(z * Float64(y / t))) / Float64(Float64(a + 1.0) + Float64(Float64(y * b) / t))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (t <= -7.2e-158) tmp = (x + (y * (z / t))) / ((a + 1.0) + (y * (b / t))); elseif (t <= 8.2e-234) tmp = (z / b) + ((x * t) / (y * b)); else tmp = (x + (z * (y / t))) / ((a + 1.0) + ((y * b) / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -7.2e-158], 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], If[LessEqual[t, 8.2e-234], N[(N[(z / b), $MachinePrecision] + N[(N[(x * t), $MachinePrecision] / N[(y * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x + N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(a + 1.0), $MachinePrecision] + N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -7.2 \cdot 10^{-158}:\\
\;\;\;\;\frac{x + y \cdot \frac{z}{t}}{\left(a + 1\right) + y \cdot \frac{b}{t}}\\
\mathbf{elif}\;t \leq 8.2 \cdot 10^{-234}:\\
\;\;\;\;\frac{z}{b} + \frac{x \cdot t}{y \cdot b}\\
\mathbf{else}:\\
\;\;\;\;\frac{x + z \cdot \frac{y}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}}\\
\end{array}
\end{array}
if t < -7.19999999999999982e-158Initial program 86.7%
associate-/l*90.8%
associate-/l*93.7%
Simplified93.7%
if -7.19999999999999982e-158 < t < 8.20000000000000021e-234Initial program 52.9%
associate-/l*48.5%
associate-/l*35.6%
Simplified35.6%
Taylor expanded in b around inf 48.3%
associate-/l*42.3%
associate-*r/42.2%
+-commutative42.2%
fma-undefine42.2%
*-commutative42.2%
Simplified42.2%
Taylor expanded in t around 0 83.3%
*-commutative83.3%
Simplified83.3%
if 8.20000000000000021e-234 < t Initial program 77.7%
*-commutative77.7%
associate-/l*80.7%
Applied egg-rr80.7%
Final simplification86.1%
(FPCore (x y z t a b) :precision binary64 (if (or (<= a -0.55) (not (<= a 0.00086))) (/ (+ x (* y (/ z t))) (+ a (* y (/ b t)))) (/ (+ x (* z (/ y t))) (+ 1.0 (/ (* y b) t)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -0.55) || !(a <= 0.00086)) {
tmp = (x + (y * (z / t))) / (a + (y * (b / t)));
} else {
tmp = (x + (z * (y / t))) / (1.0 + ((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 ((a <= (-0.55d0)) .or. (.not. (a <= 0.00086d0))) then
tmp = (x + (y * (z / t))) / (a + (y * (b / t)))
else
tmp = (x + (z * (y / t))) / (1.0d0 + ((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 ((a <= -0.55) || !(a <= 0.00086)) {
tmp = (x + (y * (z / t))) / (a + (y * (b / t)));
} else {
tmp = (x + (z * (y / t))) / (1.0 + ((y * b) / t));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (a <= -0.55) or not (a <= 0.00086): tmp = (x + (y * (z / t))) / (a + (y * (b / t))) else: tmp = (x + (z * (y / t))) / (1.0 + ((y * b) / t)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((a <= -0.55) || !(a <= 0.00086)) tmp = Float64(Float64(x + Float64(y * Float64(z / t))) / Float64(a + Float64(y * Float64(b / t)))); else tmp = Float64(Float64(x + Float64(z * Float64(y / t))) / Float64(1.0 + Float64(Float64(y * b) / t))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((a <= -0.55) || ~((a <= 0.00086))) tmp = (x + (y * (z / t))) / (a + (y * (b / t))); else tmp = (x + (z * (y / t))) / (1.0 + ((y * b) / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[a, -0.55], N[Not[LessEqual[a, 0.00086]], $MachinePrecision]], N[(N[(x + N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(a + N[(y * N[(b / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x + N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(1.0 + N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -0.55 \lor \neg \left(a \leq 0.00086\right):\\
\;\;\;\;\frac{x + y \cdot \frac{z}{t}}{a + y \cdot \frac{b}{t}}\\
\mathbf{else}:\\
\;\;\;\;\frac{x + z \cdot \frac{y}{t}}{1 + \frac{y \cdot b}{t}}\\
\end{array}
\end{array}
if a < -0.55000000000000004 or 8.59999999999999979e-4 < a Initial program 79.4%
associate-/l*78.8%
associate-/l*78.8%
Simplified78.8%
Taylor expanded in a around inf 77.7%
if -0.55000000000000004 < a < 8.59999999999999979e-4Initial program 73.8%
*-commutative73.8%
associate-/l*75.8%
Applied egg-rr75.8%
Taylor expanded in a around 0 75.4%
Final simplification76.7%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* y (/ b t))) (t_2 (+ x (* y (/ z t)))))
(if (or (<= a -1.0) (not (<= a 0.0017)))
(/ t_2 (+ a t_1))
(/ t_2 (+ 1.0 t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = y * (b / t);
double t_2 = x + (y * (z / t));
double tmp;
if ((a <= -1.0) || !(a <= 0.0017)) {
tmp = t_2 / (a + t_1);
} else {
tmp = t_2 / (1.0 + 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) :: t_2
real(8) :: tmp
t_1 = y * (b / t)
t_2 = x + (y * (z / t))
if ((a <= (-1.0d0)) .or. (.not. (a <= 0.0017d0))) then
tmp = t_2 / (a + t_1)
else
tmp = t_2 / (1.0d0 + 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 = y * (b / t);
double t_2 = x + (y * (z / t));
double tmp;
if ((a <= -1.0) || !(a <= 0.0017)) {
tmp = t_2 / (a + t_1);
} else {
tmp = t_2 / (1.0 + t_1);
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = y * (b / t) t_2 = x + (y * (z / t)) tmp = 0 if (a <= -1.0) or not (a <= 0.0017): tmp = t_2 / (a + t_1) else: tmp = t_2 / (1.0 + t_1) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(y * Float64(b / t)) t_2 = Float64(x + Float64(y * Float64(z / t))) tmp = 0.0 if ((a <= -1.0) || !(a <= 0.0017)) tmp = Float64(t_2 / Float64(a + t_1)); else tmp = Float64(t_2 / Float64(1.0 + t_1)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = y * (b / t); t_2 = x + (y * (z / t)); tmp = 0.0; if ((a <= -1.0) || ~((a <= 0.0017))) tmp = t_2 / (a + t_1); else tmp = t_2 / (1.0 + t_1); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(y * N[(b / t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[a, -1.0], N[Not[LessEqual[a, 0.0017]], $MachinePrecision]], N[(t$95$2 / N[(a + t$95$1), $MachinePrecision]), $MachinePrecision], N[(t$95$2 / N[(1.0 + t$95$1), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \frac{b}{t}\\
t_2 := x + y \cdot \frac{z}{t}\\
\mathbf{if}\;a \leq -1 \lor \neg \left(a \leq 0.0017\right):\\
\;\;\;\;\frac{t\_2}{a + t\_1}\\
\mathbf{else}:\\
\;\;\;\;\frac{t\_2}{1 + t\_1}\\
\end{array}
\end{array}
if a < -1 or 0.00169999999999999991 < a Initial program 79.4%
associate-/l*78.8%
associate-/l*78.8%
Simplified78.8%
Taylor expanded in a around inf 77.7%
if -1 < a < 0.00169999999999999991Initial program 73.8%
associate-/l*76.1%
associate-/l*73.0%
Simplified73.0%
Taylor expanded in a around 0 72.6%
Final simplification75.4%
(FPCore (x y z t a b) :precision binary64 (if (or (<= t -3e-95) (not (<= t 2.7e-167))) (/ (+ 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 <= -3e-95) || !(t <= 2.7e-167)) {
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 <= (-3d-95)) .or. (.not. (t <= 2.7d-167))) 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 <= -3e-95) || !(t <= 2.7e-167)) {
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 <= -3e-95) or not (t <= 2.7e-167): 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 <= -3e-95) || !(t <= 2.7e-167)) 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 <= -3e-95) || ~((t <= 2.7e-167))) 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[Or[LessEqual[t, -3e-95], N[Not[LessEqual[t, 2.7e-167]], $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 -3 \cdot 10^{-95} \lor \neg \left(t \leq 2.7 \cdot 10^{-167}\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 < -3e-95 or 2.7000000000000001e-167 < t Initial program 83.6%
associate-/l*86.2%
associate-/l*88.2%
Simplified88.2%
Taylor expanded in b around 0 73.1%
if -3e-95 < t < 2.7000000000000001e-167Initial program 57.7%
associate-/l*53.3%
associate-/l*42.0%
Simplified42.0%
Taylor expanded in b around inf 43.1%
associate-/l*37.7%
associate-*r/39.0%
+-commutative39.0%
fma-undefine39.0%
*-commutative39.0%
Simplified39.0%
Taylor expanded in t around 0 74.5%
*-commutative74.5%
Simplified74.5%
Final simplification73.5%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -1.3e+129) (not (<= y 4.4e+41))) (+ (/ z b) (* t (/ (/ x y) 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.3e+129) || !(y <= 4.4e+41)) {
tmp = (z / b) + (t * ((x / y) / 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.3d+129)) .or. (.not. (y <= 4.4d+41))) then
tmp = (z / b) + (t * ((x / y) / 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.3e+129) || !(y <= 4.4e+41)) {
tmp = (z / b) + (t * ((x / y) / 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.3e+129) or not (y <= 4.4e+41): tmp = (z / b) + (t * ((x / y) / 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.3e+129) || !(y <= 4.4e+41)) tmp = Float64(Float64(z / b) + Float64(t * Float64(Float64(x / y) / 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 <= -1.3e+129) || ~((y <= 4.4e+41))) tmp = (z / b) + (t * ((x / y) / 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.3e+129], N[Not[LessEqual[y, 4.4e+41]], $MachinePrecision]], N[(N[(z / b), $MachinePrecision] + N[(t * N[(N[(x / y), $MachinePrecision] / b), $MachinePrecision]), $MachinePrecision]), $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 -1.3 \cdot 10^{+129} \lor \neg \left(y \leq 4.4 \cdot 10^{+41}\right):\\
\;\;\;\;\frac{z}{b} + t \cdot \frac{\frac{x}{y}}{b}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{1 + \left(a + \frac{y \cdot b}{t}\right)}\\
\end{array}
\end{array}
if y < -1.30000000000000006e129 or 4.3999999999999998e41 < y Initial program 53.5%
associate-/l*58.5%
associate-/l*63.5%
Simplified63.5%
Taylor expanded in b around inf 35.7%
associate-/l*36.9%
associate-*r/37.1%
+-commutative37.1%
fma-undefine37.1%
*-commutative37.1%
Simplified37.1%
Taylor expanded in y around 0 44.7%
associate-/l*44.6%
associate-/l*52.7%
Simplified52.7%
Taylor expanded in t around 0 60.0%
associate-/l*61.6%
associate-/l/64.6%
Simplified64.6%
if -1.30000000000000006e129 < y < 4.3999999999999998e41Initial program 90.8%
associate-/l*89.0%
associate-/l*83.7%
Simplified83.7%
Taylor expanded in x around inf 73.2%
Final simplification70.0%
(FPCore (x y z t a b) :precision binary64 (if (or (<= t -8.5e-33) (not (<= t 3.6e-139))) (/ x (+ 1.0 (+ a (/ y (/ t b))))) (+ (/ z b) (/ (* x t) (* y b)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -8.5e-33) || !(t <= 3.6e-139)) {
tmp = x / (1.0 + (a + (y / (t / b))));
} 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 <= (-8.5d-33)) .or. (.not. (t <= 3.6d-139))) then
tmp = x / (1.0d0 + (a + (y / (t / b))))
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 <= -8.5e-33) || !(t <= 3.6e-139)) {
tmp = x / (1.0 + (a + (y / (t / b))));
} else {
tmp = (z / b) + ((x * t) / (y * b));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (t <= -8.5e-33) or not (t <= 3.6e-139): tmp = x / (1.0 + (a + (y / (t / b)))) else: tmp = (z / b) + ((x * t) / (y * b)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((t <= -8.5e-33) || !(t <= 3.6e-139)) tmp = Float64(x / Float64(1.0 + Float64(a + Float64(y / Float64(t / b))))); 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 <= -8.5e-33) || ~((t <= 3.6e-139))) tmp = x / (1.0 + (a + (y / (t / b)))); else tmp = (z / b) + ((x * t) / (y * b)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[t, -8.5e-33], N[Not[LessEqual[t, 3.6e-139]], $MachinePrecision]], N[(x / N[(1.0 + N[(a + N[(y / N[(t / b), $MachinePrecision]), $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 -8.5 \cdot 10^{-33} \lor \neg \left(t \leq 3.6 \cdot 10^{-139}\right):\\
\;\;\;\;\frac{x}{1 + \left(a + \frac{y}{\frac{t}{b}}\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{b} + \frac{x \cdot t}{y \cdot b}\\
\end{array}
\end{array}
if t < -8.49999999999999945e-33 or 3.60000000000000003e-139 < t Initial program 83.5%
associate-/l*86.4%
associate-/l*88.6%
Simplified88.6%
Taylor expanded in x around inf 67.7%
associate-*r/68.8%
*-commutative68.8%
associate-/r/68.8%
Simplified68.8%
if -8.49999999999999945e-33 < t < 3.60000000000000003e-139Initial program 63.6%
associate-/l*60.2%
associate-/l*51.4%
Simplified51.4%
Taylor expanded in b around inf 41.1%
associate-/l*37.0%
associate-*r/38.0%
+-commutative38.0%
fma-undefine38.0%
*-commutative38.0%
Simplified38.0%
Taylor expanded in t around 0 67.8%
*-commutative67.8%
Simplified67.8%
Final simplification68.5%
(FPCore (x y z t a b) :precision binary64 (if (or (<= t -7.2e-33) (not (<= t 4.8e-19))) (/ x (+ 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 <= -7.2e-33) || !(t <= 4.8e-19)) {
tmp = x / (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 <= (-7.2d-33)) .or. (.not. (t <= 4.8d-19))) then
tmp = x / (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 <= -7.2e-33) || !(t <= 4.8e-19)) {
tmp = x / (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 <= -7.2e-33) or not (t <= 4.8e-19): tmp = x / (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 <= -7.2e-33) || !(t <= 4.8e-19)) tmp = Float64(x / 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 <= -7.2e-33) || ~((t <= 4.8e-19))) tmp = x / (a + 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, -7.2e-33], N[Not[LessEqual[t, 4.8e-19]], $MachinePrecision]], N[(x / 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 -7.2 \cdot 10^{-33} \lor \neg \left(t \leq 4.8 \cdot 10^{-19}\right):\\
\;\;\;\;\frac{x}{a + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{b} + \frac{x \cdot t}{y \cdot b}\\
\end{array}
\end{array}
if t < -7.20000000000000068e-33 or 4.80000000000000046e-19 < t Initial program 86.5%
associate-/l*91.3%
associate-/l*94.6%
Simplified94.6%
Taylor expanded in y around 0 67.3%
if -7.20000000000000068e-33 < t < 4.80000000000000046e-19Initial program 64.3%
associate-/l*59.9%
associate-/l*52.4%
Simplified52.4%
Taylor expanded in b around inf 34.3%
associate-/l*31.1%
associate-*r/31.9%
+-commutative31.9%
fma-undefine31.9%
*-commutative31.9%
Simplified31.9%
Taylor expanded in t around 0 60.0%
*-commutative60.0%
Simplified60.0%
Final simplification64.1%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -1.05e+129) (not (<= y 3.5e+41))) (+ (/ z b) (* t (/ (/ x y) b))) (/ x (+ a 1.0))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -1.05e+129) || !(y <= 3.5e+41)) {
tmp = (z / b) + (t * ((x / y) / 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 <= (-1.05d+129)) .or. (.not. (y <= 3.5d+41))) then
tmp = (z / b) + (t * ((x / y) / 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 <= -1.05e+129) || !(y <= 3.5e+41)) {
tmp = (z / b) + (t * ((x / y) / b));
} else {
tmp = x / (a + 1.0);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -1.05e+129) or not (y <= 3.5e+41): tmp = (z / b) + (t * ((x / y) / b)) else: tmp = x / (a + 1.0) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -1.05e+129) || !(y <= 3.5e+41)) tmp = Float64(Float64(z / b) + Float64(t * Float64(Float64(x / y) / 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 <= -1.05e+129) || ~((y <= 3.5e+41))) tmp = (z / b) + (t * ((x / y) / b)); else tmp = x / (a + 1.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -1.05e+129], N[Not[LessEqual[y, 3.5e+41]], $MachinePrecision]], N[(N[(z / b), $MachinePrecision] + N[(t * N[(N[(x / y), $MachinePrecision] / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x / N[(a + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.05 \cdot 10^{+129} \lor \neg \left(y \leq 3.5 \cdot 10^{+41}\right):\\
\;\;\;\;\frac{z}{b} + t \cdot \frac{\frac{x}{y}}{b}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{a + 1}\\
\end{array}
\end{array}
if y < -1.04999999999999998e129 or 3.4999999999999999e41 < y Initial program 53.5%
associate-/l*58.5%
associate-/l*63.5%
Simplified63.5%
Taylor expanded in b around inf 35.7%
associate-/l*36.9%
associate-*r/37.1%
+-commutative37.1%
fma-undefine37.1%
*-commutative37.1%
Simplified37.1%
Taylor expanded in y around 0 44.7%
associate-/l*44.6%
associate-/l*52.7%
Simplified52.7%
Taylor expanded in t around 0 60.0%
associate-/l*61.6%
associate-/l/64.6%
Simplified64.6%
if -1.04999999999999998e129 < y < 3.4999999999999999e41Initial program 90.8%
associate-/l*89.0%
associate-/l*83.7%
Simplified83.7%
Taylor expanded in y around 0 63.8%
Final simplification64.1%
(FPCore (x y z t a b)
:precision binary64
(if (<= t -4.2e-102)
(/ (+ x (* (* y z) (/ 1.0 t))) (+ a 1.0))
(if (<= t 5.5e-165)
(+ (/ z b) (/ (* x t) (* y b)))
(/ (+ x (/ (* y z) t)) (+ a 1.0)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -4.2e-102) {
tmp = (x + ((y * z) * (1.0 / t))) / (a + 1.0);
} else if (t <= 5.5e-165) {
tmp = (z / b) + ((x * t) / (y * b));
} else {
tmp = (x + ((y * z) / t)) / (a + 1.0);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (t <= (-4.2d-102)) then
tmp = (x + ((y * z) * (1.0d0 / t))) / (a + 1.0d0)
else if (t <= 5.5d-165) then
tmp = (z / b) + ((x * t) / (y * b))
else
tmp = (x + ((y * z) / t)) / (a + 1.0d0)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -4.2e-102) {
tmp = (x + ((y * z) * (1.0 / t))) / (a + 1.0);
} else if (t <= 5.5e-165) {
tmp = (z / b) + ((x * t) / (y * b));
} else {
tmp = (x + ((y * z) / t)) / (a + 1.0);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if t <= -4.2e-102: tmp = (x + ((y * z) * (1.0 / t))) / (a + 1.0) elif t <= 5.5e-165: tmp = (z / b) + ((x * t) / (y * b)) else: tmp = (x + ((y * z) / t)) / (a + 1.0) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (t <= -4.2e-102) tmp = Float64(Float64(x + Float64(Float64(y * z) * Float64(1.0 / t))) / Float64(a + 1.0)); elseif (t <= 5.5e-165) tmp = Float64(Float64(z / b) + Float64(Float64(x * t) / Float64(y * b))); else tmp = Float64(Float64(x + Float64(Float64(y * z) / t)) / Float64(a + 1.0)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (t <= -4.2e-102) tmp = (x + ((y * z) * (1.0 / t))) / (a + 1.0); elseif (t <= 5.5e-165) tmp = (z / b) + ((x * t) / (y * b)); else tmp = (x + ((y * z) / t)) / (a + 1.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -4.2e-102], N[(N[(x + N[(N[(y * z), $MachinePrecision] * N[(1.0 / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(a + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 5.5e-165], N[(N[(z / b), $MachinePrecision] + N[(N[(x * t), $MachinePrecision] / N[(y * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] / N[(a + 1.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4.2 \cdot 10^{-102}:\\
\;\;\;\;\frac{x + \left(y \cdot z\right) \cdot \frac{1}{t}}{a + 1}\\
\mathbf{elif}\;t \leq 5.5 \cdot 10^{-165}:\\
\;\;\;\;\frac{z}{b} + \frac{x \cdot t}{y \cdot b}\\
\mathbf{else}:\\
\;\;\;\;\frac{x + \frac{y \cdot z}{t}}{a + 1}\\
\end{array}
\end{array}
if t < -4.2e-102Initial program 86.6%
associate-/l*91.1%
associate-/l*94.3%
Simplified94.3%
Taylor expanded in b around 0 74.0%
clear-num74.0%
associate-/r/74.0%
Applied egg-rr74.0%
if -4.2e-102 < t < 5.49999999999999969e-165Initial program 57.7%
associate-/l*53.3%
associate-/l*42.0%
Simplified42.0%
Taylor expanded in b around inf 43.1%
associate-/l*37.7%
associate-*r/39.0%
+-commutative39.0%
fma-undefine39.0%
*-commutative39.0%
Simplified39.0%
Taylor expanded in t around 0 74.5%
*-commutative74.5%
Simplified74.5%
if 5.49999999999999969e-165 < t Initial program 80.9%
associate-/l*81.9%
associate-/l*82.8%
Simplified82.8%
Taylor expanded in b around 0 72.4%
Final simplification73.5%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -1.05e+129) (not (<= y 6.2e+49))) (/ z b) (/ x (+ a 1.0))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -1.05e+129) || !(y <= 6.2e+49)) {
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 <= (-1.05d+129)) .or. (.not. (y <= 6.2d+49))) 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 <= -1.05e+129) || !(y <= 6.2e+49)) {
tmp = z / b;
} else {
tmp = x / (a + 1.0);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -1.05e+129) or not (y <= 6.2e+49): tmp = z / b else: tmp = x / (a + 1.0) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -1.05e+129) || !(y <= 6.2e+49)) 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 <= -1.05e+129) || ~((y <= 6.2e+49))) 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, -1.05e+129], N[Not[LessEqual[y, 6.2e+49]], $MachinePrecision]], N[(z / b), $MachinePrecision], N[(x / N[(a + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.05 \cdot 10^{+129} \lor \neg \left(y \leq 6.2 \cdot 10^{+49}\right):\\
\;\;\;\;\frac{z}{b}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{a + 1}\\
\end{array}
\end{array}
if y < -1.04999999999999998e129 or 6.19999999999999985e49 < y Initial program 52.0%
associate-/l*57.3%
associate-/l*62.5%
Simplified62.5%
Taylor expanded in y around inf 59.5%
if -1.04999999999999998e129 < y < 6.19999999999999985e49Initial program 90.5%
associate-/l*88.7%
associate-/l*83.6%
Simplified83.6%
Taylor expanded in y around 0 62.7%
Final simplification61.5%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -6.5e+58) (not (<= y 1.3e-21))) (/ z b) (/ x a)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -6.5e+58) || !(y <= 1.3e-21)) {
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 ((y <= (-6.5d+58)) .or. (.not. (y <= 1.3d-21))) 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 ((y <= -6.5e+58) || !(y <= 1.3e-21)) {
tmp = z / b;
} else {
tmp = x / a;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -6.5e+58) or not (y <= 1.3e-21): tmp = z / b else: tmp = x / a return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -6.5e+58) || !(y <= 1.3e-21)) 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 ((y <= -6.5e+58) || ~((y <= 1.3e-21))) tmp = z / b; else tmp = x / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -6.5e+58], N[Not[LessEqual[y, 1.3e-21]], $MachinePrecision]], N[(z / b), $MachinePrecision], N[(x / a), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -6.5 \cdot 10^{+58} \lor \neg \left(y \leq 1.3 \cdot 10^{-21}\right):\\
\;\;\;\;\frac{z}{b}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{a}\\
\end{array}
\end{array}
if y < -6.49999999999999998e58 or 1.30000000000000009e-21 < y Initial program 58.6%
associate-/l*63.9%
associate-/l*67.6%
Simplified67.6%
Taylor expanded in y around inf 52.1%
if -6.49999999999999998e58 < y < 1.30000000000000009e-21Initial program 95.3%
associate-/l*91.5%
associate-/l*84.8%
Simplified84.8%
Taylor expanded in a around inf 50.9%
Taylor expanded in x around inf 43.7%
Final simplification48.0%
(FPCore (x y z t a b) :precision binary64 (if (or (<= a -9e+25) (not (<= a 1.0))) (/ x a) x))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -9e+25) || !(a <= 1.0)) {
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 <= (-9d+25)) .or. (.not. (a <= 1.0d0))) 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 <= -9e+25) || !(a <= 1.0)) {
tmp = x / a;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (a <= -9e+25) or not (a <= 1.0): tmp = x / a else: tmp = x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((a <= -9e+25) || !(a <= 1.0)) 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 <= -9e+25) || ~((a <= 1.0))) tmp = x / a; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[a, -9e+25], N[Not[LessEqual[a, 1.0]], $MachinePrecision]], N[(x / a), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -9 \cdot 10^{+25} \lor \neg \left(a \leq 1\right):\\
\;\;\;\;\frac{x}{a}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < -9.0000000000000006e25 or 1 < a Initial program 79.6%
associate-/l*79.1%
associate-/l*79.1%
Simplified79.1%
Taylor expanded in a around inf 68.2%
Taylor expanded in x around inf 53.1%
if -9.0000000000000006e25 < a < 1Initial program 73.7%
associate-/l*75.9%
associate-/l*72.8%
Simplified72.8%
Taylor expanded in b around 0 52.0%
Taylor expanded in a around 0 51.0%
Taylor expanded in x around inf 38.2%
Final simplification46.1%
(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.8%
associate-/l*77.6%
associate-/l*76.1%
Simplified76.1%
Taylor expanded in b around 0 61.1%
Taylor expanded in a around 0 26.9%
Taylor expanded in x around inf 20.4%
(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 2024132
(FPCore (x y z t a b)
:name "Diagrams.Solve.Tridiagonal:solveCyclicTriDiagonal from diagrams-solve-0.1, B"
:precision binary64
:alt
(! :herbie-platform default (if (< t -1707385670788761/12500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (* 1 (* (+ x (* (/ y t) z)) (/ 1 (+ (+ a 1) (* (/ y t) b))))) (if (< t 1518483551868623/5000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (/ z b) (* 1 (* (+ x (* (/ y t) z)) (/ 1 (+ (+ a 1) (* (/ y t) b))))))))
(/ (+ x (/ (* y z) t)) (+ (+ a 1.0) (/ (* y b) t))))