
(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 15 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b) :precision binary64 (/ (+ x (/ (* y z) t)) (+ (+ a 1.0) (/ (* y b) t))))
double code(double x, double y, double z, double t, double a, double b) {
return (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t));
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = (x + ((y * z) / t)) / ((a + 1.0d0) + ((y * b) / t))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t));
}
def code(x, y, z, t, a, b): return (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t))
function code(x, y, z, t, a, b) return Float64(Float64(x + Float64(Float64(y * z) / t)) / Float64(Float64(a + 1.0) + Float64(Float64(y * b) / t))) end
function tmp = code(x, y, z, t, a, b) tmp = (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t)); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] / N[(N[(a + 1.0), $MachinePrecision] + N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}}
\end{array}
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (+ x (/ (* y z) t)) (+ (/ (* y b) t) (+ a 1.0))))
(t_2 (+ 1.0 (+ a (/ y (/ t b))))))
(if (<= t_1 (- INFINITY))
(* z (+ (/ (/ x z) t_2) (/ y (* t t_2))))
(if (<= t_1 5e+302)
t_1
(if (<= t_1 INFINITY)
(* y (/ z (+ (* y b) (* t (+ a 1.0)))))
(fma
t
(+ (/ (/ x b) y) (* z (/ (- -1.0 a) (* y (pow b 2.0)))))
(/ z b)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x + ((y * z) / t)) / (((y * b) / t) + (a + 1.0));
double t_2 = 1.0 + (a + (y / (t / b)));
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = z * (((x / z) / t_2) + (y / (t * t_2)));
} else if (t_1 <= 5e+302) {
tmp = t_1;
} else if (t_1 <= ((double) INFINITY)) {
tmp = y * (z / ((y * b) + (t * (a + 1.0))));
} else {
tmp = fma(t, (((x / b) / y) + (z * ((-1.0 - a) / (y * pow(b, 2.0))))), (z / b));
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(x + Float64(Float64(y * z) / t)) / Float64(Float64(Float64(y * b) / t) + Float64(a + 1.0))) t_2 = Float64(1.0 + Float64(a + Float64(y / Float64(t / b)))) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = Float64(z * Float64(Float64(Float64(x / z) / t_2) + Float64(y / Float64(t * t_2)))); elseif (t_1 <= 5e+302) tmp = t_1; elseif (t_1 <= Inf) tmp = Float64(y * Float64(z / Float64(Float64(y * b) + Float64(t * Float64(a + 1.0))))); else tmp = fma(t, Float64(Float64(Float64(x / b) / y) + Float64(z * Float64(Float64(-1.0 - a) / Float64(y * (b ^ 2.0))))), Float64(z / b)); end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] / N[(N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision] + N[(a + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(1.0 + N[(a + N[(y / N[(t / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(z * N[(N[(N[(x / z), $MachinePrecision] / t$95$2), $MachinePrecision] + N[(y / N[(t * t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 5e+302], t$95$1, If[LessEqual[t$95$1, Infinity], N[(y * N[(z / N[(N[(y * b), $MachinePrecision] + N[(t * N[(a + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t * N[(N[(N[(x / b), $MachinePrecision] / y), $MachinePrecision] + N[(z * N[(N[(-1.0 - a), $MachinePrecision] / N[(y * N[Power[b, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(z / b), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x + \frac{y \cdot z}{t}}{\frac{y \cdot b}{t} + \left(a + 1\right)}\\
t_2 := 1 + \left(a + \frac{y}{\frac{t}{b}}\right)\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;z \cdot \left(\frac{\frac{x}{z}}{t\_2} + \frac{y}{t \cdot t\_2}\right)\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+302}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_1 \leq \infty:\\
\;\;\;\;y \cdot \frac{z}{y \cdot b + t \cdot \left(a + 1\right)}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t, \frac{\frac{x}{b}}{y} + z \cdot \frac{-1 - a}{y \cdot {b}^{2}}, \frac{z}{b}\right)\\
\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 29.3%
associate-/l*48.3%
associate-/l*48.3%
Simplified48.3%
Taylor expanded in z around inf 99.4%
associate-/r*99.4%
associate-*r/99.4%
*-commutative99.4%
associate-/r/99.4%
associate-*r/79.5%
*-commutative79.5%
associate-/r/98.9%
Simplified98.9%
if -inf.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < 5e302Initial program 92.8%
if 5e302 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < +inf.0Initial program 29.6%
associate-/l*53.1%
associate-/l*53.0%
Simplified53.0%
Taylor expanded in x around 0 61.0%
associate-/l*99.5%
associate-*r/67.0%
*-commutative67.0%
associate-/r/99.5%
Simplified99.5%
Taylor expanded in t around 0 99.5%
if +inf.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) Initial program 0.0%
associate-/l*0.6%
associate-/l*14.1%
Simplified14.1%
Taylor expanded in y around inf 72.2%
associate--l+72.2%
sub-neg72.2%
associate-/l*72.2%
associate-/l*81.1%
distribute-rgt-neg-in81.1%
distribute-lft-in81.1%
sub-neg81.1%
+-commutative81.1%
fma-define81.1%
Simplified95.0%
Final simplification93.9%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (+ x (/ (* y z) t)) (+ (/ (* y b) t) (+ a 1.0))))
(t_2 (+ 1.0 (+ a (/ y (/ t b))))))
(if (<= t_1 (- INFINITY))
(* z (+ (/ (/ x z) t_2) (/ y (* t t_2))))
(if (<= t_1 5e+302) t_1 (/ z b)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x + ((y * z) / t)) / (((y * b) / t) + (a + 1.0));
double t_2 = 1.0 + (a + (y / (t / b)));
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = z * (((x / z) / t_2) + (y / (t * t_2)));
} else if (t_1 <= 5e+302) {
tmp = t_1;
} else {
tmp = z / b;
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x + ((y * z) / t)) / (((y * b) / t) + (a + 1.0));
double t_2 = 1.0 + (a + (y / (t / b)));
double tmp;
if (t_1 <= -Double.POSITIVE_INFINITY) {
tmp = z * (((x / z) / t_2) + (y / (t * t_2)));
} else if (t_1 <= 5e+302) {
tmp = t_1;
} else {
tmp = z / b;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (x + ((y * z) / t)) / (((y * b) / t) + (a + 1.0)) t_2 = 1.0 + (a + (y / (t / b))) tmp = 0 if t_1 <= -math.inf: tmp = z * (((x / z) / t_2) + (y / (t * t_2))) elif t_1 <= 5e+302: 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(Float64(y * b) / t) + Float64(a + 1.0))) t_2 = Float64(1.0 + Float64(a + Float64(y / Float64(t / b)))) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = Float64(z * Float64(Float64(Float64(x / z) / t_2) + Float64(y / Float64(t * t_2)))); elseif (t_1 <= 5e+302) tmp = t_1; else tmp = Float64(z / b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (x + ((y * z) / t)) / (((y * b) / t) + (a + 1.0)); t_2 = 1.0 + (a + (y / (t / b))); tmp = 0.0; if (t_1 <= -Inf) tmp = z * (((x / z) / t_2) + (y / (t * t_2))); elseif (t_1 <= 5e+302) 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[(N[(y * b), $MachinePrecision] / t), $MachinePrecision] + N[(a + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(1.0 + N[(a + N[(y / N[(t / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(z * N[(N[(N[(x / z), $MachinePrecision] / t$95$2), $MachinePrecision] + N[(y / N[(t * t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 5e+302], t$95$1, N[(z / b), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x + \frac{y \cdot z}{t}}{\frac{y \cdot b}{t} + \left(a + 1\right)}\\
t_2 := 1 + \left(a + \frac{y}{\frac{t}{b}}\right)\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;z \cdot \left(\frac{\frac{x}{z}}{t\_2} + \frac{y}{t \cdot t\_2}\right)\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+302}:\\
\;\;\;\;t\_1\\
\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 29.3%
associate-/l*48.3%
associate-/l*48.3%
Simplified48.3%
Taylor expanded in z around inf 99.4%
associate-/r*99.4%
associate-*r/99.4%
*-commutative99.4%
associate-/r/99.4%
associate-*r/79.5%
*-commutative79.5%
associate-/r/98.9%
Simplified98.9%
if -inf.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < 5e302Initial program 92.8%
if 5e302 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) Initial program 7.4%
associate-/l*13.8%
associate-/l*23.8%
Simplified23.8%
Taylor expanded in y around inf 86.1%
Final simplification92.0%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (+ x (/ (* y z) t)) (+ (/ (* y b) t) (+ a 1.0)))))
(if (<= t_1 (- INFINITY))
(* y (/ z (+ (* y b) (* t (+ a 1.0)))))
(if (<= t_1 5e+302) t_1 (/ z b)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x + ((y * z) / t)) / (((y * b) / t) + (a + 1.0));
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = y * (z / ((y * b) + (t * (a + 1.0))));
} else if (t_1 <= 5e+302) {
tmp = t_1;
} else {
tmp = z / b;
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x + ((y * z) / t)) / (((y * b) / t) + (a + 1.0));
double tmp;
if (t_1 <= -Double.POSITIVE_INFINITY) {
tmp = y * (z / ((y * b) + (t * (a + 1.0))));
} else if (t_1 <= 5e+302) {
tmp = t_1;
} else {
tmp = z / b;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (x + ((y * z) / t)) / (((y * b) / t) + (a + 1.0)) tmp = 0 if t_1 <= -math.inf: tmp = y * (z / ((y * b) + (t * (a + 1.0)))) elif t_1 <= 5e+302: 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(Float64(y * b) / t) + Float64(a + 1.0))) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = Float64(y * Float64(z / Float64(Float64(y * b) + Float64(t * Float64(a + 1.0))))); elseif (t_1 <= 5e+302) tmp = t_1; else tmp = Float64(z / b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (x + ((y * z) / t)) / (((y * b) / t) + (a + 1.0)); tmp = 0.0; if (t_1 <= -Inf) tmp = y * (z / ((y * b) + (t * (a + 1.0)))); elseif (t_1 <= 5e+302) 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[(N[(y * b), $MachinePrecision] / t), $MachinePrecision] + N[(a + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(y * N[(z / N[(N[(y * b), $MachinePrecision] + N[(t * N[(a + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 5e+302], t$95$1, N[(z / b), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x + \frac{y \cdot z}{t}}{\frac{y \cdot b}{t} + \left(a + 1\right)}\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;y \cdot \frac{z}{y \cdot b + t \cdot \left(a + 1\right)}\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+302}:\\
\;\;\;\;t\_1\\
\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 29.3%
associate-/l*48.3%
associate-/l*48.3%
Simplified48.3%
Taylor expanded in x around 0 52.7%
associate-/l*85.6%
associate-*r/65.7%
*-commutative65.7%
associate-/r/85.1%
Simplified85.1%
Taylor expanded in t around 0 85.6%
if -inf.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < 5e302Initial program 92.8%
if 5e302 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) Initial program 7.4%
associate-/l*13.8%
associate-/l*23.8%
Simplified23.8%
Taylor expanded in y around inf 86.1%
Final simplification91.0%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ x (* y (/ z t)))) (t_2 (* y (/ b t))))
(if (or (<= (+ a 1.0) -1e+19) (not (<= (+ a 1.0) 1.0)))
(/ t_1 (+ a t_2))
(/ t_1 (+ 1.0 t_2)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x + (y * (z / t));
double t_2 = y * (b / t);
double tmp;
if (((a + 1.0) <= -1e+19) || !((a + 1.0) <= 1.0)) {
tmp = t_1 / (a + t_2);
} else {
tmp = t_1 / (1.0 + t_2);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = x + (y * (z / t))
t_2 = y * (b / t)
if (((a + 1.0d0) <= (-1d+19)) .or. (.not. ((a + 1.0d0) <= 1.0d0))) then
tmp = t_1 / (a + t_2)
else
tmp = t_1 / (1.0d0 + t_2)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x + (y * (z / t));
double t_2 = y * (b / t);
double tmp;
if (((a + 1.0) <= -1e+19) || !((a + 1.0) <= 1.0)) {
tmp = t_1 / (a + t_2);
} else {
tmp = t_1 / (1.0 + t_2);
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x + (y * (z / t)) t_2 = y * (b / t) tmp = 0 if ((a + 1.0) <= -1e+19) or not ((a + 1.0) <= 1.0): tmp = t_1 / (a + t_2) else: tmp = t_1 / (1.0 + t_2) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x + Float64(y * Float64(z / t))) t_2 = Float64(y * Float64(b / t)) tmp = 0.0 if ((Float64(a + 1.0) <= -1e+19) || !(Float64(a + 1.0) <= 1.0)) tmp = Float64(t_1 / Float64(a + t_2)); else tmp = Float64(t_1 / Float64(1.0 + t_2)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x + (y * (z / t)); t_2 = y * (b / t); tmp = 0.0; if (((a + 1.0) <= -1e+19) || ~(((a + 1.0) <= 1.0))) tmp = t_1 / (a + t_2); else tmp = t_1 / (1.0 + t_2); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x + N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(y * N[(b / t), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[N[(a + 1.0), $MachinePrecision], -1e+19], N[Not[LessEqual[N[(a + 1.0), $MachinePrecision], 1.0]], $MachinePrecision]], N[(t$95$1 / N[(a + t$95$2), $MachinePrecision]), $MachinePrecision], N[(t$95$1 / N[(1.0 + t$95$2), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + y \cdot \frac{z}{t}\\
t_2 := y \cdot \frac{b}{t}\\
\mathbf{if}\;a + 1 \leq -1 \cdot 10^{+19} \lor \neg \left(a + 1 \leq 1\right):\\
\;\;\;\;\frac{t\_1}{a + t\_2}\\
\mathbf{else}:\\
\;\;\;\;\frac{t\_1}{1 + t\_2}\\
\end{array}
\end{array}
if (+.f64 a #s(literal 1 binary64)) < -1e19 or 1 < (+.f64 a #s(literal 1 binary64)) Initial program 71.3%
associate-/l*69.8%
associate-/l*72.9%
Simplified72.9%
Taylor expanded in a around inf 72.4%
if -1e19 < (+.f64 a #s(literal 1 binary64)) < 1Initial program 72.4%
associate-/l*74.1%
associate-/l*72.6%
Simplified72.6%
Taylor expanded in a around 0 72.2%
Final simplification72.3%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* y (/ b t))) (t_2 (+ a t_1)) (t_3 (+ x (* y (/ z t)))))
(if (<= (+ a 1.0) -1e+19)
(/ t_3 t_2)
(if (<= (+ a 1.0) 1.0) (/ t_3 (+ 1.0 t_1)) (/ (+ x (/ y (/ t z))) t_2)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = y * (b / t);
double t_2 = a + t_1;
double t_3 = x + (y * (z / t));
double tmp;
if ((a + 1.0) <= -1e+19) {
tmp = t_3 / t_2;
} else if ((a + 1.0) <= 1.0) {
tmp = t_3 / (1.0 + t_1);
} else {
tmp = (x + (y / (t / z))) / t_2;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = y * (b / t)
t_2 = a + t_1
t_3 = x + (y * (z / t))
if ((a + 1.0d0) <= (-1d+19)) then
tmp = t_3 / t_2
else if ((a + 1.0d0) <= 1.0d0) then
tmp = t_3 / (1.0d0 + t_1)
else
tmp = (x + (y / (t / z))) / t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = y * (b / t);
double t_2 = a + t_1;
double t_3 = x + (y * (z / t));
double tmp;
if ((a + 1.0) <= -1e+19) {
tmp = t_3 / t_2;
} else if ((a + 1.0) <= 1.0) {
tmp = t_3 / (1.0 + t_1);
} else {
tmp = (x + (y / (t / z))) / t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = y * (b / t) t_2 = a + t_1 t_3 = x + (y * (z / t)) tmp = 0 if (a + 1.0) <= -1e+19: tmp = t_3 / t_2 elif (a + 1.0) <= 1.0: tmp = t_3 / (1.0 + t_1) else: tmp = (x + (y / (t / z))) / t_2 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(y * Float64(b / t)) t_2 = Float64(a + t_1) t_3 = Float64(x + Float64(y * Float64(z / t))) tmp = 0.0 if (Float64(a + 1.0) <= -1e+19) tmp = Float64(t_3 / t_2); elseif (Float64(a + 1.0) <= 1.0) tmp = Float64(t_3 / Float64(1.0 + t_1)); else tmp = Float64(Float64(x + Float64(y / Float64(t / z))) / t_2); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = y * (b / t); t_2 = a + t_1; t_3 = x + (y * (z / t)); tmp = 0.0; if ((a + 1.0) <= -1e+19) tmp = t_3 / t_2; elseif ((a + 1.0) <= 1.0) tmp = t_3 / (1.0 + t_1); else tmp = (x + (y / (t / z))) / t_2; 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[(a + t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[(x + N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(a + 1.0), $MachinePrecision], -1e+19], N[(t$95$3 / t$95$2), $MachinePrecision], If[LessEqual[N[(a + 1.0), $MachinePrecision], 1.0], N[(t$95$3 / N[(1.0 + t$95$1), $MachinePrecision]), $MachinePrecision], N[(N[(x + N[(y / N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$2), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \frac{b}{t}\\
t_2 := a + t\_1\\
t_3 := x + y \cdot \frac{z}{t}\\
\mathbf{if}\;a + 1 \leq -1 \cdot 10^{+19}:\\
\;\;\;\;\frac{t\_3}{t\_2}\\
\mathbf{elif}\;a + 1 \leq 1:\\
\;\;\;\;\frac{t\_3}{1 + t\_1}\\
\mathbf{else}:\\
\;\;\;\;\frac{x + \frac{y}{\frac{t}{z}}}{t\_2}\\
\end{array}
\end{array}
if (+.f64 a #s(literal 1 binary64)) < -1e19Initial program 73.1%
associate-/l*71.8%
associate-/l*76.4%
Simplified76.4%
Taylor expanded in a around inf 76.4%
if -1e19 < (+.f64 a #s(literal 1 binary64)) < 1Initial program 72.4%
associate-/l*74.1%
associate-/l*72.6%
Simplified72.6%
Taylor expanded in a around 0 72.2%
if 1 < (+.f64 a #s(literal 1 binary64)) Initial program 69.4%
associate-/l*67.7%
associate-/l*69.4%
Simplified69.4%
clear-num69.3%
un-div-inv70.5%
Applied egg-rr70.5%
Taylor expanded in a around inf 69.4%
(FPCore (x y z t a b)
:precision binary64
(if (<= y -3e-20)
(/ (+ x (* y (/ z t))) (+ (+ a 1.0) (* y (/ b t))))
(if (<= y 3.3e+133)
(/ (+ x (* z (/ y t))) (+ (/ (* y b) t) (+ a 1.0)))
(/ z b))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -3e-20) {
tmp = (x + (y * (z / t))) / ((a + 1.0) + (y * (b / t)));
} else if (y <= 3.3e+133) {
tmp = (x + (z * (y / t))) / (((y * b) / t) + (a + 1.0));
} else {
tmp = z / b;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (y <= (-3d-20)) then
tmp = (x + (y * (z / t))) / ((a + 1.0d0) + (y * (b / t)))
else if (y <= 3.3d+133) then
tmp = (x + (z * (y / t))) / (((y * b) / t) + (a + 1.0d0))
else
tmp = z / b
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -3e-20) {
tmp = (x + (y * (z / t))) / ((a + 1.0) + (y * (b / t)));
} else if (y <= 3.3e+133) {
tmp = (x + (z * (y / t))) / (((y * b) / t) + (a + 1.0));
} else {
tmp = z / b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -3e-20: tmp = (x + (y * (z / t))) / ((a + 1.0) + (y * (b / t))) elif y <= 3.3e+133: tmp = (x + (z * (y / t))) / (((y * b) / t) + (a + 1.0)) else: tmp = z / b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -3e-20) tmp = Float64(Float64(x + Float64(y * Float64(z / t))) / Float64(Float64(a + 1.0) + Float64(y * Float64(b / t)))); elseif (y <= 3.3e+133) tmp = Float64(Float64(x + Float64(z * Float64(y / t))) / Float64(Float64(Float64(y * b) / t) + Float64(a + 1.0))); else tmp = Float64(z / b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= -3e-20) tmp = (x + (y * (z / t))) / ((a + 1.0) + (y * (b / t))); elseif (y <= 3.3e+133) tmp = (x + (z * (y / t))) / (((y * b) / t) + (a + 1.0)); else tmp = z / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -3e-20], 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[y, 3.3e+133], N[(N[(x + N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision] + N[(a + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z / b), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3 \cdot 10^{-20}:\\
\;\;\;\;\frac{x + y \cdot \frac{z}{t}}{\left(a + 1\right) + y \cdot \frac{b}{t}}\\
\mathbf{elif}\;y \leq 3.3 \cdot 10^{+133}:\\
\;\;\;\;\frac{x + z \cdot \frac{y}{t}}{\frac{y \cdot b}{t} + \left(a + 1\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{b}\\
\end{array}
\end{array}
if y < -3.00000000000000029e-20Initial program 60.8%
associate-/l*67.2%
associate-/l*73.2%
Simplified73.2%
if -3.00000000000000029e-20 < y < 3.3e133Initial program 92.9%
*-commutative92.9%
associate-/l*91.9%
Applied egg-rr91.9%
if 3.3e133 < y Initial program 31.0%
associate-/l*33.0%
associate-/l*40.2%
Simplified40.2%
Taylor expanded in y around inf 72.9%
Final simplification83.2%
(FPCore (x y z t a b)
:precision binary64
(if (<= y -2.8e+83)
(* y (/ z (+ (* y b) (* t (+ a 1.0)))))
(if (<= y -4.1e-134)
(/ x (+ 1.0 (+ a (* b (/ y t)))))
(if (<= y 1e+78) (/ (+ x (/ (* y z) t)) (+ a 1.0)) (/ z b)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -2.8e+83) {
tmp = y * (z / ((y * b) + (t * (a + 1.0))));
} else if (y <= -4.1e-134) {
tmp = x / (1.0 + (a + (b * (y / t))));
} else if (y <= 1e+78) {
tmp = (x + ((y * z) / t)) / (a + 1.0);
} else {
tmp = z / b;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (y <= (-2.8d+83)) then
tmp = y * (z / ((y * b) + (t * (a + 1.0d0))))
else if (y <= (-4.1d-134)) then
tmp = x / (1.0d0 + (a + (b * (y / t))))
else if (y <= 1d+78) then
tmp = (x + ((y * z) / t)) / (a + 1.0d0)
else
tmp = z / b
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -2.8e+83) {
tmp = y * (z / ((y * b) + (t * (a + 1.0))));
} else if (y <= -4.1e-134) {
tmp = x / (1.0 + (a + (b * (y / t))));
} else if (y <= 1e+78) {
tmp = (x + ((y * z) / t)) / (a + 1.0);
} else {
tmp = z / b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -2.8e+83: tmp = y * (z / ((y * b) + (t * (a + 1.0)))) elif y <= -4.1e-134: tmp = x / (1.0 + (a + (b * (y / t)))) elif y <= 1e+78: tmp = (x + ((y * z) / t)) / (a + 1.0) else: tmp = z / b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -2.8e+83) tmp = Float64(y * Float64(z / Float64(Float64(y * b) + Float64(t * Float64(a + 1.0))))); elseif (y <= -4.1e-134) tmp = Float64(x / Float64(1.0 + Float64(a + Float64(b * Float64(y / t))))); elseif (y <= 1e+78) tmp = Float64(Float64(x + Float64(Float64(y * z) / t)) / Float64(a + 1.0)); else tmp = Float64(z / b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= -2.8e+83) tmp = y * (z / ((y * b) + (t * (a + 1.0)))); elseif (y <= -4.1e-134) tmp = x / (1.0 + (a + (b * (y / t)))); elseif (y <= 1e+78) tmp = (x + ((y * z) / t)) / (a + 1.0); else tmp = z / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -2.8e+83], N[(y * N[(z / N[(N[(y * b), $MachinePrecision] + N[(t * N[(a + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -4.1e-134], N[(x / N[(1.0 + N[(a + N[(b * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1e+78], N[(N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] / N[(a + 1.0), $MachinePrecision]), $MachinePrecision], N[(z / b), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.8 \cdot 10^{+83}:\\
\;\;\;\;y \cdot \frac{z}{y \cdot b + t \cdot \left(a + 1\right)}\\
\mathbf{elif}\;y \leq -4.1 \cdot 10^{-134}:\\
\;\;\;\;\frac{x}{1 + \left(a + b \cdot \frac{y}{t}\right)}\\
\mathbf{elif}\;y \leq 10^{+78}:\\
\;\;\;\;\frac{x + \frac{y \cdot z}{t}}{a + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{b}\\
\end{array}
\end{array}
if y < -2.8e83Initial program 56.3%
associate-/l*65.7%
associate-/l*72.1%
Simplified72.1%
Taylor expanded in x around 0 34.6%
associate-/l*52.3%
associate-*r/45.6%
*-commutative45.6%
associate-/r/52.1%
Simplified52.1%
Taylor expanded in t around 0 54.3%
if -2.8e83 < y < -4.1000000000000002e-134Initial program 83.9%
associate-/l*81.6%
associate-/l*79.3%
Simplified79.3%
Taylor expanded in x around inf 67.7%
*-commutative67.7%
associate-*r/65.4%
clear-num65.4%
div-inv65.3%
associate-/r/69.9%
Applied egg-rr69.9%
if -4.1000000000000002e-134 < y < 1.00000000000000001e78Initial program 93.5%
associate-/l*89.9%
associate-/l*86.2%
Simplified86.2%
Taylor expanded in b around 0 77.9%
if 1.00000000000000001e78 < y Initial program 39.6%
associate-/l*41.3%
associate-/l*47.2%
Simplified47.2%
Taylor expanded in y around inf 70.2%
Final simplification70.6%
(FPCore (x y z t a b)
:precision binary64
(if (<= y -2.6e+83)
(/ z b)
(if (<= y -3.8e-135)
(/ x (+ 1.0 (+ a (* b (/ y t)))))
(if (<= y 3.4e+78) (/ (+ x (/ (* y z) t)) (+ a 1.0)) (/ z b)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -2.6e+83) {
tmp = z / b;
} else if (y <= -3.8e-135) {
tmp = x / (1.0 + (a + (b * (y / t))));
} else if (y <= 3.4e+78) {
tmp = (x + ((y * z) / t)) / (a + 1.0);
} else {
tmp = z / b;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (y <= (-2.6d+83)) then
tmp = z / b
else if (y <= (-3.8d-135)) then
tmp = x / (1.0d0 + (a + (b * (y / t))))
else if (y <= 3.4d+78) then
tmp = (x + ((y * z) / t)) / (a + 1.0d0)
else
tmp = z / b
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -2.6e+83) {
tmp = z / b;
} else if (y <= -3.8e-135) {
tmp = x / (1.0 + (a + (b * (y / t))));
} else if (y <= 3.4e+78) {
tmp = (x + ((y * z) / t)) / (a + 1.0);
} else {
tmp = z / b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -2.6e+83: tmp = z / b elif y <= -3.8e-135: tmp = x / (1.0 + (a + (b * (y / t)))) elif y <= 3.4e+78: tmp = (x + ((y * z) / t)) / (a + 1.0) else: tmp = z / b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -2.6e+83) tmp = Float64(z / b); elseif (y <= -3.8e-135) tmp = Float64(x / Float64(1.0 + Float64(a + Float64(b * Float64(y / t))))); elseif (y <= 3.4e+78) tmp = Float64(Float64(x + Float64(Float64(y * z) / t)) / Float64(a + 1.0)); else tmp = Float64(z / b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= -2.6e+83) tmp = z / b; elseif (y <= -3.8e-135) tmp = x / (1.0 + (a + (b * (y / t)))); elseif (y <= 3.4e+78) tmp = (x + ((y * z) / t)) / (a + 1.0); else tmp = z / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -2.6e+83], N[(z / b), $MachinePrecision], If[LessEqual[y, -3.8e-135], N[(x / N[(1.0 + N[(a + N[(b * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.4e+78], N[(N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] / N[(a + 1.0), $MachinePrecision]), $MachinePrecision], N[(z / b), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.6 \cdot 10^{+83}:\\
\;\;\;\;\frac{z}{b}\\
\mathbf{elif}\;y \leq -3.8 \cdot 10^{-135}:\\
\;\;\;\;\frac{x}{1 + \left(a + b \cdot \frac{y}{t}\right)}\\
\mathbf{elif}\;y \leq 3.4 \cdot 10^{+78}:\\
\;\;\;\;\frac{x + \frac{y \cdot z}{t}}{a + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{b}\\
\end{array}
\end{array}
if y < -2.6000000000000001e83 or 3.40000000000000007e78 < y Initial program 46.4%
associate-/l*51.2%
associate-/l*57.3%
Simplified57.3%
Taylor expanded in y around inf 57.8%
if -2.6000000000000001e83 < y < -3.8000000000000003e-135Initial program 83.9%
associate-/l*81.6%
associate-/l*79.3%
Simplified79.3%
Taylor expanded in x around inf 67.7%
*-commutative67.7%
associate-*r/65.4%
clear-num65.4%
div-inv65.3%
associate-/r/69.9%
Applied egg-rr69.9%
if -3.8000000000000003e-135 < y < 3.40000000000000007e78Initial program 93.5%
associate-/l*89.9%
associate-/l*86.2%
Simplified86.2%
Taylor expanded in b around 0 77.9%
Final simplification68.0%
(FPCore (x y z t a b)
:precision binary64
(if (<= y -2.5e+83)
(/ z b)
(if (<= y -1.02e-206)
(/ x (+ 1.0 (+ a (* b (/ y t)))))
(if (<= y 5.1e+79) (/ (+ x (* y (/ z t))) (+ a 1.0)) (/ z b)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -2.5e+83) {
tmp = z / b;
} else if (y <= -1.02e-206) {
tmp = x / (1.0 + (a + (b * (y / t))));
} else if (y <= 5.1e+79) {
tmp = (x + (y * (z / t))) / (a + 1.0);
} else {
tmp = z / b;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (y <= (-2.5d+83)) then
tmp = z / b
else if (y <= (-1.02d-206)) then
tmp = x / (1.0d0 + (a + (b * (y / t))))
else if (y <= 5.1d+79) then
tmp = (x + (y * (z / t))) / (a + 1.0d0)
else
tmp = z / b
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -2.5e+83) {
tmp = z / b;
} else if (y <= -1.02e-206) {
tmp = x / (1.0 + (a + (b * (y / t))));
} else if (y <= 5.1e+79) {
tmp = (x + (y * (z / t))) / (a + 1.0);
} else {
tmp = z / b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -2.5e+83: tmp = z / b elif y <= -1.02e-206: tmp = x / (1.0 + (a + (b * (y / t)))) elif y <= 5.1e+79: tmp = (x + (y * (z / t))) / (a + 1.0) else: tmp = z / b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -2.5e+83) tmp = Float64(z / b); elseif (y <= -1.02e-206) tmp = Float64(x / Float64(1.0 + Float64(a + Float64(b * Float64(y / t))))); elseif (y <= 5.1e+79) tmp = Float64(Float64(x + Float64(y * Float64(z / t))) / Float64(a + 1.0)); else tmp = Float64(z / b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= -2.5e+83) tmp = z / b; elseif (y <= -1.02e-206) tmp = x / (1.0 + (a + (b * (y / t)))); elseif (y <= 5.1e+79) tmp = (x + (y * (z / t))) / (a + 1.0); else tmp = z / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -2.5e+83], N[(z / b), $MachinePrecision], If[LessEqual[y, -1.02e-206], N[(x / N[(1.0 + N[(a + N[(b * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 5.1e+79], N[(N[(x + N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(a + 1.0), $MachinePrecision]), $MachinePrecision], N[(z / b), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.5 \cdot 10^{+83}:\\
\;\;\;\;\frac{z}{b}\\
\mathbf{elif}\;y \leq -1.02 \cdot 10^{-206}:\\
\;\;\;\;\frac{x}{1 + \left(a + b \cdot \frac{y}{t}\right)}\\
\mathbf{elif}\;y \leq 5.1 \cdot 10^{+79}:\\
\;\;\;\;\frac{x + y \cdot \frac{z}{t}}{a + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{b}\\
\end{array}
\end{array}
if y < -2.50000000000000014e83 or 5.1000000000000001e79 < y Initial program 46.4%
associate-/l*51.2%
associate-/l*57.3%
Simplified57.3%
Taylor expanded in y around inf 57.8%
if -2.50000000000000014e83 < y < -1.0200000000000001e-206Initial program 87.9%
associate-/l*84.4%
associate-/l*79.4%
Simplified79.4%
Taylor expanded in x around inf 70.5%
*-commutative70.5%
associate-*r/67.2%
clear-num67.1%
div-inv68.4%
associate-/r/72.2%
Applied egg-rr72.2%
if -1.0200000000000001e-206 < y < 5.1000000000000001e79Initial program 92.5%
associate-/l*89.4%
associate-/l*87.3%
Simplified87.3%
Taylor expanded in b around 0 77.6%
associate-*r/75.6%
*-commutative75.6%
Applied egg-rr75.6%
Final simplification67.3%
(FPCore (x y z t a b) :precision binary64 (if (<= y 6.2e+134) (/ (+ x (* y (/ z t))) (+ (+ a 1.0) (* y (/ b t)))) (/ z b)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= 6.2e+134) {
tmp = (x + (y * (z / t))) / ((a + 1.0) + (y * (b / t)));
} else {
tmp = z / b;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (y <= 6.2d+134) then
tmp = (x + (y * (z / t))) / ((a + 1.0d0) + (y * (b / t)))
else
tmp = z / b
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= 6.2e+134) {
tmp = (x + (y * (z / t))) / ((a + 1.0) + (y * (b / t)));
} else {
tmp = z / b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= 6.2e+134: tmp = (x + (y * (z / t))) / ((a + 1.0) + (y * (b / t))) else: tmp = z / b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= 6.2e+134) tmp = Float64(Float64(x + Float64(y * Float64(z / t))) / Float64(Float64(a + 1.0) + Float64(y * Float64(b / t)))); else tmp = Float64(z / b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= 6.2e+134) tmp = (x + (y * (z / t))) / ((a + 1.0) + (y * (b / t))); else tmp = z / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, 6.2e+134], 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[(z / b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 6.2 \cdot 10^{+134}:\\
\;\;\;\;\frac{x + y \cdot \frac{z}{t}}{\left(a + 1\right) + y \cdot \frac{b}{t}}\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{b}\\
\end{array}
\end{array}
if y < 6.19999999999999963e134Initial program 82.8%
associate-/l*82.5%
associate-/l*81.5%
Simplified81.5%
if 6.19999999999999963e134 < y Initial program 31.0%
associate-/l*33.0%
associate-/l*40.2%
Simplified40.2%
Taylor expanded in y around inf 72.9%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -6.2e+83) (not (<= y 5e+49))) (/ z b) (/ x (+ 1.0 (+ a (* b (/ y t)))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -6.2e+83) || !(y <= 5e+49)) {
tmp = z / b;
} else {
tmp = x / (1.0 + (a + (b * (y / t))));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((y <= (-6.2d+83)) .or. (.not. (y <= 5d+49))) then
tmp = z / b
else
tmp = x / (1.0d0 + (a + (b * (y / t))))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -6.2e+83) || !(y <= 5e+49)) {
tmp = z / b;
} else {
tmp = x / (1.0 + (a + (b * (y / t))));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -6.2e+83) or not (y <= 5e+49): tmp = z / b else: tmp = x / (1.0 + (a + (b * (y / t)))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -6.2e+83) || !(y <= 5e+49)) tmp = Float64(z / b); else tmp = Float64(x / Float64(1.0 + Float64(a + Float64(b * Float64(y / t))))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -6.2e+83) || ~((y <= 5e+49))) tmp = z / b; else tmp = x / (1.0 + (a + (b * (y / t)))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -6.2e+83], N[Not[LessEqual[y, 5e+49]], $MachinePrecision]], N[(z / b), $MachinePrecision], N[(x / N[(1.0 + N[(a + N[(b * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -6.2 \cdot 10^{+83} \lor \neg \left(y \leq 5 \cdot 10^{+49}\right):\\
\;\;\;\;\frac{z}{b}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{1 + \left(a + b \cdot \frac{y}{t}\right)}\\
\end{array}
\end{array}
if y < -6.19999999999999984e83 or 5.0000000000000004e49 < y Initial program 47.8%
associate-/l*52.4%
associate-/l*58.3%
Simplified58.3%
Taylor expanded in y around inf 57.9%
if -6.19999999999999984e83 < y < 5.0000000000000004e49Initial program 91.1%
associate-/l*87.8%
associate-/l*84.4%
Simplified84.4%
Taylor expanded in x around inf 70.6%
*-commutative70.6%
associate-*r/68.6%
clear-num68.6%
div-inv69.1%
associate-/r/71.3%
Applied egg-rr71.3%
Final simplification65.3%
(FPCore (x y z t a b) :precision binary64 (if (<= y -4.2e-140) (/ (+ x (* y (/ z t))) (+ 1.0 (* y (/ b t)))) (if (<= y 5e+79) (/ (+ x (/ (* y z) t)) (+ a 1.0)) (/ z b))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -4.2e-140) {
tmp = (x + (y * (z / t))) / (1.0 + (y * (b / t)));
} else if (y <= 5e+79) {
tmp = (x + ((y * z) / t)) / (a + 1.0);
} else {
tmp = z / b;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (y <= (-4.2d-140)) then
tmp = (x + (y * (z / t))) / (1.0d0 + (y * (b / t)))
else if (y <= 5d+79) then
tmp = (x + ((y * z) / t)) / (a + 1.0d0)
else
tmp = z / b
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -4.2e-140) {
tmp = (x + (y * (z / t))) / (1.0 + (y * (b / t)));
} else if (y <= 5e+79) {
tmp = (x + ((y * z) / t)) / (a + 1.0);
} else {
tmp = z / b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -4.2e-140: tmp = (x + (y * (z / t))) / (1.0 + (y * (b / t))) elif y <= 5e+79: tmp = (x + ((y * z) / t)) / (a + 1.0) else: tmp = z / b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -4.2e-140) tmp = Float64(Float64(x + Float64(y * Float64(z / t))) / Float64(1.0 + Float64(y * Float64(b / t)))); elseif (y <= 5e+79) tmp = Float64(Float64(x + Float64(Float64(y * z) / t)) / Float64(a + 1.0)); else tmp = Float64(z / b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= -4.2e-140) tmp = (x + (y * (z / t))) / (1.0 + (y * (b / t))); elseif (y <= 5e+79) tmp = (x + ((y * z) / t)) / (a + 1.0); else tmp = z / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -4.2e-140], N[(N[(x + N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(1.0 + N[(y * N[(b / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 5e+79], N[(N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] / N[(a + 1.0), $MachinePrecision]), $MachinePrecision], N[(z / b), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.2 \cdot 10^{-140}:\\
\;\;\;\;\frac{x + y \cdot \frac{z}{t}}{1 + y \cdot \frac{b}{t}}\\
\mathbf{elif}\;y \leq 5 \cdot 10^{+79}:\\
\;\;\;\;\frac{x + \frac{y \cdot z}{t}}{a + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{b}\\
\end{array}
\end{array}
if y < -4.20000000000000035e-140Initial program 70.4%
associate-/l*74.0%
associate-/l*76.2%
Simplified76.2%
Taylor expanded in a around 0 57.6%
if -4.20000000000000035e-140 < y < 5e79Initial program 93.4%
associate-/l*89.7%
associate-/l*86.0%
Simplified86.0%
Taylor expanded in b around 0 78.4%
if 5e79 < y Initial program 39.6%
associate-/l*41.3%
associate-/l*47.2%
Simplified47.2%
Taylor expanded in y around inf 70.2%
Final simplification69.2%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -2.45e-20) (not (<= y 1.55e+40))) (/ z b) (/ x (+ a 1.0))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -2.45e-20) || !(y <= 1.55e+40)) {
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 <= (-2.45d-20)) .or. (.not. (y <= 1.55d+40))) 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 <= -2.45e-20) || !(y <= 1.55e+40)) {
tmp = z / b;
} else {
tmp = x / (a + 1.0);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -2.45e-20) or not (y <= 1.55e+40): tmp = z / b else: tmp = x / (a + 1.0) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -2.45e-20) || !(y <= 1.55e+40)) 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 <= -2.45e-20) || ~((y <= 1.55e+40))) 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, -2.45e-20], N[Not[LessEqual[y, 1.55e+40]], $MachinePrecision]], N[(z / b), $MachinePrecision], N[(x / N[(a + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.45 \cdot 10^{-20} \lor \neg \left(y \leq 1.55 \cdot 10^{+40}\right):\\
\;\;\;\;\frac{z}{b}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{a + 1}\\
\end{array}
\end{array}
if y < -2.4500000000000001e-20 or 1.5499999999999999e40 < y Initial program 51.3%
associate-/l*55.2%
associate-/l*60.9%
Simplified60.9%
Taylor expanded in y around inf 55.6%
if -2.4500000000000001e-20 < y < 1.5499999999999999e40Initial program 94.5%
associate-/l*90.6%
associate-/l*85.9%
Simplified85.9%
Taylor expanded in y around 0 60.3%
Final simplification57.8%
(FPCore (x y z t a b) :precision binary64 (if (or (<= t -2.45e+85) (not (<= t 2.6e+36))) (/ x a) (/ z b)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -2.45e+85) || !(t <= 2.6e+36)) {
tmp = x / a;
} else {
tmp = z / b;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((t <= (-2.45d+85)) .or. (.not. (t <= 2.6d+36))) then
tmp = x / a
else
tmp = z / b
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -2.45e+85) || !(t <= 2.6e+36)) {
tmp = x / a;
} else {
tmp = z / b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (t <= -2.45e+85) or not (t <= 2.6e+36): tmp = x / a else: tmp = z / b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((t <= -2.45e+85) || !(t <= 2.6e+36)) tmp = Float64(x / a); else tmp = Float64(z / b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((t <= -2.45e+85) || ~((t <= 2.6e+36))) tmp = x / a; else tmp = z / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[t, -2.45e+85], N[Not[LessEqual[t, 2.6e+36]], $MachinePrecision]], N[(x / a), $MachinePrecision], N[(z / b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.45 \cdot 10^{+85} \lor \neg \left(t \leq 2.6 \cdot 10^{+36}\right):\\
\;\;\;\;\frac{x}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{b}\\
\end{array}
\end{array}
if t < -2.4499999999999998e85 or 2.6000000000000001e36 < t Initial program 81.8%
associate-/l*87.2%
associate-/l*95.7%
Simplified95.7%
Taylor expanded in x around inf 68.5%
Taylor expanded in a around inf 34.6%
if -2.4499999999999998e85 < t < 2.6000000000000001e36Initial program 66.4%
associate-/l*63.6%
associate-/l*60.1%
Simplified60.1%
Taylor expanded in y around inf 51.8%
Final simplification45.7%
(FPCore (x y z t a b) :precision binary64 (/ x a))
double code(double x, double y, double z, double t, double a, double b) {
return x / a;
}
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 / a
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return x / a;
}
def code(x, y, z, t, a, b): return x / a
function code(x, y, z, t, a, b) return Float64(x / a) end
function tmp = code(x, y, z, t, a, b) tmp = x / a; end
code[x_, y_, z_, t_, a_, b_] := N[(x / a), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{a}
\end{array}
Initial program 71.8%
associate-/l*72.0%
associate-/l*72.8%
Simplified72.8%
Taylor expanded in x around inf 49.4%
Taylor expanded in a around inf 22.0%
(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 2024150
(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))))