
(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)))))
(if (<= t_1 (- INFINITY))
(* (/ y t) (/ z (+ 1.0 (fma y (/ b t) a))))
(if (<= t_1 -2e-318)
(/ (+ x (* z (/ y t))) (+ a (+ 1.0 (/ b (/ t y)))))
(if (<= t_1 0.0)
(+ (/ (* t (/ x b)) y) (/ z b))
(if (<= t_1 5e+292) 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 / t) * (z / (1.0 + fma(y, (b / t), a)));
} else if (t_1 <= -2e-318) {
tmp = (x + (z * (y / t))) / (a + (1.0 + (b / (t / y))));
} else if (t_1 <= 0.0) {
tmp = ((t * (x / b)) / y) + (z / b);
} else if (t_1 <= 5e+292) {
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(Float64(y / t) * Float64(z / Float64(1.0 + fma(y, Float64(b / t), a)))); elseif (t_1 <= -2e-318) tmp = Float64(Float64(x + Float64(z * Float64(y / t))) / Float64(a + Float64(1.0 + Float64(b / Float64(t / y))))); elseif (t_1 <= 0.0) tmp = Float64(Float64(Float64(t * Float64(x / b)) / y) + Float64(z / b)); elseif (t_1 <= 5e+292) tmp = t_1; else tmp = Float64(z / b); end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] / N[(N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision] + N[(a + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(N[(y / t), $MachinePrecision] * N[(z / N[(1.0 + N[(y * N[(b / t), $MachinePrecision] + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, -2e-318], N[(N[(x + N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(a + N[(1.0 + N[(b / N[(t / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 0.0], N[(N[(N[(t * N[(x / b), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision] + N[(z / b), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 5e+292], 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:\\
\;\;\;\;\frac{y}{t} \cdot \frac{z}{1 + \mathsf{fma}\left(y, \frac{b}{t}, a\right)}\\
\mathbf{elif}\;t_1 \leq -2 \cdot 10^{-318}:\\
\;\;\;\;\frac{x + z \cdot \frac{y}{t}}{a + \left(1 + \frac{b}{\frac{t}{y}}\right)}\\
\mathbf{elif}\;t_1 \leq 0:\\
\;\;\;\;\frac{t \cdot \frac{x}{b}}{y} + \frac{z}{b}\\
\mathbf{elif}\;t_1 \leq 5 \cdot 10^{+292}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{b}\\
\end{array}
\end{array}
if (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < -inf.0Initial program 30.6%
*-commutative30.6%
associate-*l/59.0%
associate-+l+59.0%
associate-*r/59.0%
*-commutative59.0%
Simplified59.0%
Taylor expanded in x around 0 49.2%
times-frac87.2%
+-commutative87.2%
associate-*l/87.3%
*-commutative87.3%
fma-def87.3%
Simplified87.3%
if -inf.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < -2.0000024e-318Initial program 99.4%
associate-/l*94.3%
associate-*l/94.2%
*-commutative94.2%
cancel-sign-sub94.2%
*-commutative94.2%
associate-*l/94.3%
associate-+r-94.3%
associate-*l/94.2%
*-commutative94.2%
cancel-sign-sub94.2%
*-commutative94.2%
associate-*l/94.3%
*-commutative94.3%
associate-/l*94.1%
Simplified94.1%
associate-/r/99.5%
Applied egg-rr99.5%
if -2.0000024e-318 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < -0.0Initial program 55.8%
*-commutative55.8%
associate-*l/55.5%
associate-+l+55.5%
associate-*r/62.0%
*-commutative62.0%
Simplified62.0%
Taylor expanded in t around 0 75.6%
Taylor expanded in x around inf 75.7%
*-commutative75.7%
times-frac74.4%
Simplified74.4%
associate-*r/81.6%
Applied egg-rr81.6%
if -0.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < 4.9999999999999996e292Initial program 99.7%
if 4.9999999999999996e292 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) Initial program 6.3%
*-commutative6.3%
associate-*l/23.8%
associate-+l+23.8%
associate-*r/23.8%
*-commutative23.8%
Simplified23.8%
Taylor expanded in t around 0 86.0%
Final simplification94.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (+ x (/ (* y z) t)) (+ (/ (* y b) t) (+ a 1.0))))
(t_2 (/ b (/ t y))))
(if (<= t_1 (- INFINITY))
(* (/ y t) (/ z (+ 1.0 (+ a t_2))))
(if (<= t_1 -2e-318)
(/ (+ x (* z (/ y t))) (+ a (+ 1.0 t_2)))
(if (<= t_1 0.0)
(+ (/ (* t (/ x b)) y) (/ z b))
(if (<= t_1 5e+292) 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 = b / (t / y);
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = (y / t) * (z / (1.0 + (a + t_2)));
} else if (t_1 <= -2e-318) {
tmp = (x + (z * (y / t))) / (a + (1.0 + t_2));
} else if (t_1 <= 0.0) {
tmp = ((t * (x / b)) / y) + (z / b);
} else if (t_1 <= 5e+292) {
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 = b / (t / y);
double tmp;
if (t_1 <= -Double.POSITIVE_INFINITY) {
tmp = (y / t) * (z / (1.0 + (a + t_2)));
} else if (t_1 <= -2e-318) {
tmp = (x + (z * (y / t))) / (a + (1.0 + t_2));
} else if (t_1 <= 0.0) {
tmp = ((t * (x / b)) / y) + (z / b);
} else if (t_1 <= 5e+292) {
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 = b / (t / y) tmp = 0 if t_1 <= -math.inf: tmp = (y / t) * (z / (1.0 + (a + t_2))) elif t_1 <= -2e-318: tmp = (x + (z * (y / t))) / (a + (1.0 + t_2)) elif t_1 <= 0.0: tmp = ((t * (x / b)) / y) + (z / b) elif t_1 <= 5e+292: 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(b / Float64(t / y)) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = Float64(Float64(y / t) * Float64(z / Float64(1.0 + Float64(a + t_2)))); elseif (t_1 <= -2e-318) tmp = Float64(Float64(x + Float64(z * Float64(y / t))) / Float64(a + Float64(1.0 + t_2))); elseif (t_1 <= 0.0) tmp = Float64(Float64(Float64(t * Float64(x / b)) / y) + Float64(z / b)); elseif (t_1 <= 5e+292) 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 = b / (t / y); tmp = 0.0; if (t_1 <= -Inf) tmp = (y / t) * (z / (1.0 + (a + t_2))); elseif (t_1 <= -2e-318) tmp = (x + (z * (y / t))) / (a + (1.0 + t_2)); elseif (t_1 <= 0.0) tmp = ((t * (x / b)) / y) + (z / b); elseif (t_1 <= 5e+292) 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[(b / N[(t / y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(N[(y / t), $MachinePrecision] * N[(z / N[(1.0 + N[(a + t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, -2e-318], N[(N[(x + N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(a + N[(1.0 + t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 0.0], N[(N[(N[(t * N[(x / b), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision] + N[(z / b), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 5e+292], 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 := \frac{b}{\frac{t}{y}}\\
\mathbf{if}\;t_1 \leq -\infty:\\
\;\;\;\;\frac{y}{t} \cdot \frac{z}{1 + \left(a + t_2\right)}\\
\mathbf{elif}\;t_1 \leq -2 \cdot 10^{-318}:\\
\;\;\;\;\frac{x + z \cdot \frac{y}{t}}{a + \left(1 + t_2\right)}\\
\mathbf{elif}\;t_1 \leq 0:\\
\;\;\;\;\frac{t \cdot \frac{x}{b}}{y} + \frac{z}{b}\\
\mathbf{elif}\;t_1 \leq 5 \cdot 10^{+292}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{b}\\
\end{array}
\end{array}
if (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < -inf.0Initial program 30.6%
associate-/l*58.9%
associate-*l/48.0%
*-commutative48.0%
cancel-sign-sub48.0%
*-commutative48.0%
associate-*l/58.9%
associate-+r-58.9%
associate-*l/48.0%
*-commutative48.0%
cancel-sign-sub48.0%
*-commutative48.0%
associate-*l/58.9%
*-commutative58.9%
associate-/l*48.6%
Simplified48.6%
associate-/r/48.6%
Applied egg-rr48.6%
Taylor expanded in x around 0 49.2%
times-frac87.2%
associate-/l*77.0%
Simplified77.0%
if -inf.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < -2.0000024e-318Initial program 99.4%
associate-/l*94.3%
associate-*l/94.2%
*-commutative94.2%
cancel-sign-sub94.2%
*-commutative94.2%
associate-*l/94.3%
associate-+r-94.3%
associate-*l/94.2%
*-commutative94.2%
cancel-sign-sub94.2%
*-commutative94.2%
associate-*l/94.3%
*-commutative94.3%
associate-/l*94.1%
Simplified94.1%
associate-/r/99.5%
Applied egg-rr99.5%
if -2.0000024e-318 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < -0.0Initial program 55.8%
*-commutative55.8%
associate-*l/55.5%
associate-+l+55.5%
associate-*r/62.0%
*-commutative62.0%
Simplified62.0%
Taylor expanded in t around 0 75.6%
Taylor expanded in x around inf 75.7%
*-commutative75.7%
times-frac74.4%
Simplified74.4%
associate-*r/81.6%
Applied egg-rr81.6%
if -0.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < 4.9999999999999996e292Initial program 99.7%
if 4.9999999999999996e292 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) Initial program 6.3%
*-commutative6.3%
associate-*l/23.8%
associate-+l+23.8%
associate-*r/23.8%
*-commutative23.8%
Simplified23.8%
Taylor expanded in t around 0 86.0%
Final simplification93.6%
(FPCore (x y z t a b) :precision binary64 (if (or (<= t -3.8e-156) (not (<= t 2.6e-102))) (/ (+ x (* z (/ y t))) (+ a (+ 1.0 (/ b (/ t y))))) (/ (+ z (/ (* x t) y)) b)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -3.8e-156) || !(t <= 2.6e-102)) {
tmp = (x + (z * (y / t))) / (a + (1.0 + (b / (t / y))));
} else {
tmp = (z + ((x * t) / y)) / b;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((t <= (-3.8d-156)) .or. (.not. (t <= 2.6d-102))) then
tmp = (x + (z * (y / t))) / (a + (1.0d0 + (b / (t / y))))
else
tmp = (z + ((x * t) / y)) / b
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -3.8e-156) || !(t <= 2.6e-102)) {
tmp = (x + (z * (y / t))) / (a + (1.0 + (b / (t / y))));
} else {
tmp = (z + ((x * t) / y)) / b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (t <= -3.8e-156) or not (t <= 2.6e-102): tmp = (x + (z * (y / t))) / (a + (1.0 + (b / (t / y)))) else: tmp = (z + ((x * t) / y)) / b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((t <= -3.8e-156) || !(t <= 2.6e-102)) tmp = Float64(Float64(x + Float64(z * Float64(y / t))) / Float64(a + Float64(1.0 + Float64(b / Float64(t / y))))); else tmp = Float64(Float64(z + Float64(Float64(x * t) / y)) / b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((t <= -3.8e-156) || ~((t <= 2.6e-102))) tmp = (x + (z * (y / t))) / (a + (1.0 + (b / (t / y)))); else tmp = (z + ((x * t) / y)) / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[t, -3.8e-156], N[Not[LessEqual[t, 2.6e-102]], $MachinePrecision]], N[(N[(x + N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(a + N[(1.0 + N[(b / N[(t / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(z + N[(N[(x * t), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision] / b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.8 \cdot 10^{-156} \lor \neg \left(t \leq 2.6 \cdot 10^{-102}\right):\\
\;\;\;\;\frac{x + z \cdot \frac{y}{t}}{a + \left(1 + \frac{b}{\frac{t}{y}}\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{z + \frac{x \cdot t}{y}}{b}\\
\end{array}
\end{array}
if t < -3.80000000000000008e-156 or 2.59999999999999986e-102 < t Initial program 84.9%
associate-/l*91.2%
associate-*l/91.5%
*-commutative91.5%
cancel-sign-sub91.5%
*-commutative91.5%
associate-*l/91.2%
associate-+r-91.2%
associate-*l/91.5%
*-commutative91.5%
cancel-sign-sub91.5%
*-commutative91.5%
associate-*l/91.2%
*-commutative91.2%
associate-/l*91.6%
Simplified91.6%
associate-/r/92.0%
Applied egg-rr92.0%
if -3.80000000000000008e-156 < t < 2.59999999999999986e-102Initial program 59.7%
*-commutative59.7%
associate-*l/47.3%
associate-+l+47.3%
associate-*r/40.4%
*-commutative40.4%
Simplified40.4%
Taylor expanded in t around 0 61.6%
Taylor expanded in x around inf 77.9%
*-commutative77.9%
times-frac71.1%
Simplified71.1%
Taylor expanded in b around 0 78.1%
Final simplification88.2%
(FPCore (x y z t a b)
:precision binary64
(if (<= t -2.3e-157)
(/ (+ x (* y (/ z t))) (+ a (+ 1.0 (* y (/ b t)))))
(if (<= t 2.6e-102)
(/ (+ z (/ (* x t) y)) b)
(/ (+ x (* z (/ y t))) (+ a (+ 1.0 (/ b (/ t y))))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -2.3e-157) {
tmp = (x + (y * (z / t))) / (a + (1.0 + (y * (b / t))));
} else if (t <= 2.6e-102) {
tmp = (z + ((x * t) / y)) / b;
} else {
tmp = (x + (z * (y / t))) / (a + (1.0 + (b / (t / y))));
}
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.3d-157)) then
tmp = (x + (y * (z / t))) / (a + (1.0d0 + (y * (b / t))))
else if (t <= 2.6d-102) then
tmp = (z + ((x * t) / y)) / b
else
tmp = (x + (z * (y / t))) / (a + (1.0d0 + (b / (t / y))))
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.3e-157) {
tmp = (x + (y * (z / t))) / (a + (1.0 + (y * (b / t))));
} else if (t <= 2.6e-102) {
tmp = (z + ((x * t) / y)) / b;
} else {
tmp = (x + (z * (y / t))) / (a + (1.0 + (b / (t / y))));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if t <= -2.3e-157: tmp = (x + (y * (z / t))) / (a + (1.0 + (y * (b / t)))) elif t <= 2.6e-102: tmp = (z + ((x * t) / y)) / b else: tmp = (x + (z * (y / t))) / (a + (1.0 + (b / (t / y)))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (t <= -2.3e-157) tmp = Float64(Float64(x + Float64(y * Float64(z / t))) / Float64(a + Float64(1.0 + Float64(y * Float64(b / t))))); elseif (t <= 2.6e-102) tmp = Float64(Float64(z + Float64(Float64(x * t) / y)) / b); else tmp = Float64(Float64(x + Float64(z * Float64(y / t))) / Float64(a + Float64(1.0 + Float64(b / Float64(t / y))))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (t <= -2.3e-157) tmp = (x + (y * (z / t))) / (a + (1.0 + (y * (b / t)))); elseif (t <= 2.6e-102) tmp = (z + ((x * t) / y)) / b; else tmp = (x + (z * (y / t))) / (a + (1.0 + (b / (t / y)))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -2.3e-157], N[(N[(x + N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(a + N[(1.0 + N[(y * N[(b / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.6e-102], N[(N[(z + N[(N[(x * t), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision] / b), $MachinePrecision], N[(N[(x + N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(a + N[(1.0 + N[(b / N[(t / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.3 \cdot 10^{-157}:\\
\;\;\;\;\frac{x + y \cdot \frac{z}{t}}{a + \left(1 + y \cdot \frac{b}{t}\right)}\\
\mathbf{elif}\;t \leq 2.6 \cdot 10^{-102}:\\
\;\;\;\;\frac{z + \frac{x \cdot t}{y}}{b}\\
\mathbf{else}:\\
\;\;\;\;\frac{x + z \cdot \frac{y}{t}}{a + \left(1 + \frac{b}{\frac{t}{y}}\right)}\\
\end{array}
\end{array}
if t < -2.29999999999999989e-157Initial program 83.3%
*-commutative83.3%
associate-*l/92.5%
associate-+l+92.5%
associate-*r/94.3%
*-commutative94.3%
Simplified94.3%
if -2.29999999999999989e-157 < t < 2.59999999999999986e-102Initial program 59.7%
*-commutative59.7%
associate-*l/47.3%
associate-+l+47.3%
associate-*r/40.4%
*-commutative40.4%
Simplified40.4%
Taylor expanded in t around 0 61.6%
Taylor expanded in x around inf 77.9%
*-commutative77.9%
times-frac71.1%
Simplified71.1%
Taylor expanded in b around 0 78.1%
if 2.59999999999999986e-102 < t Initial program 87.6%
associate-/l*88.9%
associate-*l/88.6%
*-commutative88.6%
cancel-sign-sub88.6%
*-commutative88.6%
associate-*l/88.9%
associate-+r-88.9%
associate-*l/88.6%
*-commutative88.6%
cancel-sign-sub88.6%
*-commutative88.6%
associate-*l/88.9%
*-commutative88.9%
associate-/l*88.8%
Simplified88.8%
associate-/r/90.2%
Applied egg-rr90.2%
Final simplification88.8%
(FPCore (x y z t a b) :precision binary64 (if (or (<= t -0.88) (not (<= t 3.8e-38))) (/ x (+ a 1.0)) (+ (/ z b) (* t (/ x (* y b))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -0.88) || !(t <= 3.8e-38)) {
tmp = x / (a + 1.0);
} else {
tmp = (z / b) + (t * (x / (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 <= (-0.88d0)) .or. (.not. (t <= 3.8d-38))) then
tmp = x / (a + 1.0d0)
else
tmp = (z / b) + (t * (x / (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 <= -0.88) || !(t <= 3.8e-38)) {
tmp = x / (a + 1.0);
} else {
tmp = (z / b) + (t * (x / (y * b)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (t <= -0.88) or not (t <= 3.8e-38): tmp = x / (a + 1.0) else: tmp = (z / b) + (t * (x / (y * b))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((t <= -0.88) || !(t <= 3.8e-38)) tmp = Float64(x / Float64(a + 1.0)); else tmp = Float64(Float64(z / b) + Float64(t * Float64(x / Float64(y * b)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((t <= -0.88) || ~((t <= 3.8e-38))) tmp = x / (a + 1.0); else tmp = (z / b) + (t * (x / (y * b))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[t, -0.88], N[Not[LessEqual[t, 3.8e-38]], $MachinePrecision]], N[(x / N[(a + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(z / b), $MachinePrecision] + N[(t * N[(x / N[(y * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -0.88 \lor \neg \left(t \leq 3.8 \cdot 10^{-38}\right):\\
\;\;\;\;\frac{x}{a + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{b} + t \cdot \frac{x}{y \cdot b}\\
\end{array}
\end{array}
if t < -0.880000000000000004 or 3.8e-38 < t Initial program 85.5%
*-commutative85.5%
associate-*l/94.9%
associate-+l+94.9%
associate-*r/96.4%
*-commutative96.4%
Simplified96.4%
Taylor expanded in t around inf 62.8%
if -0.880000000000000004 < t < 3.8e-38Initial program 69.8%
*-commutative69.8%
associate-*l/62.3%
associate-+l+62.3%
associate-*r/57.5%
*-commutative57.5%
Simplified57.5%
Taylor expanded in t around 0 53.1%
Taylor expanded in x around inf 67.9%
*-commutative67.9%
Simplified67.9%
Final simplification65.2%
(FPCore (x y z t a b) :precision binary64 (if (or (<= t -9.8) (not (<= t 7e-38))) (/ 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 <= -9.8) || !(t <= 7e-38)) {
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 <= (-9.8d0)) .or. (.not. (t <= 7d-38))) 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 <= -9.8) || !(t <= 7e-38)) {
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 <= -9.8) or not (t <= 7e-38): 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 <= -9.8) || !(t <= 7e-38)) 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 <= -9.8) || ~((t <= 7e-38))) 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, -9.8], N[Not[LessEqual[t, 7e-38]], $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 -9.8 \lor \neg \left(t \leq 7 \cdot 10^{-38}\right):\\
\;\;\;\;\frac{x}{a + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{b} + \frac{x \cdot t}{y \cdot b}\\
\end{array}
\end{array}
if t < -9.8000000000000007 or 7.0000000000000003e-38 < t Initial program 85.5%
*-commutative85.5%
associate-*l/94.9%
associate-+l+94.9%
associate-*r/96.4%
*-commutative96.4%
Simplified96.4%
Taylor expanded in t around inf 62.8%
if -9.8000000000000007 < t < 7.0000000000000003e-38Initial program 69.8%
*-commutative69.8%
associate-*l/62.3%
associate-+l+62.3%
associate-*r/57.5%
*-commutative57.5%
Simplified57.5%
Taylor expanded in t around 0 53.1%
Taylor expanded in x around inf 68.3%
Final simplification65.4%
(FPCore (x y z t a b) :precision binary64 (if (or (<= t -3.8e-70) (not (<= t 4e-38))) (/ x (+ 1.0 (+ a (/ (* y b) t)))) (+ (/ z b) (/ (* x t) (* y b)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -3.8e-70) || !(t <= 4e-38)) {
tmp = x / (1.0 + (a + ((y * b) / t)));
} else {
tmp = (z / b) + ((x * t) / (y * b));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((t <= (-3.8d-70)) .or. (.not. (t <= 4d-38))) then
tmp = x / (1.0d0 + (a + ((y * b) / t)))
else
tmp = (z / b) + ((x * t) / (y * b))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -3.8e-70) || !(t <= 4e-38)) {
tmp = x / (1.0 + (a + ((y * b) / t)));
} else {
tmp = (z / b) + ((x * t) / (y * b));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (t <= -3.8e-70) or not (t <= 4e-38): tmp = x / (1.0 + (a + ((y * b) / t))) else: tmp = (z / b) + ((x * t) / (y * b)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((t <= -3.8e-70) || !(t <= 4e-38)) tmp = Float64(x / Float64(1.0 + Float64(a + Float64(Float64(y * b) / t)))); else tmp = Float64(Float64(z / b) + Float64(Float64(x * t) / Float64(y * b))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((t <= -3.8e-70) || ~((t <= 4e-38))) tmp = x / (1.0 + (a + ((y * b) / t))); else tmp = (z / b) + ((x * t) / (y * b)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[t, -3.8e-70], N[Not[LessEqual[t, 4e-38]], $MachinePrecision]], N[(x / N[(1.0 + N[(a + N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(z / b), $MachinePrecision] + N[(N[(x * t), $MachinePrecision] / N[(y * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.8 \cdot 10^{-70} \lor \neg \left(t \leq 4 \cdot 10^{-38}\right):\\
\;\;\;\;\frac{x}{1 + \left(a + \frac{y \cdot b}{t}\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{b} + \frac{x \cdot t}{y \cdot b}\\
\end{array}
\end{array}
if t < -3.7999999999999998e-70 or 3.9999999999999998e-38 < t Initial program 86.4%
*-commutative86.4%
associate-*l/94.8%
associate-+l+94.8%
associate-*r/96.2%
*-commutative96.2%
Simplified96.2%
Taylor expanded in x around inf 68.7%
if -3.7999999999999998e-70 < t < 3.9999999999999998e-38Initial program 66.2%
*-commutative66.2%
associate-*l/57.5%
associate-+l+57.5%
associate-*r/52.1%
*-commutative52.1%
Simplified52.1%
Taylor expanded in t around 0 55.4%
Taylor expanded in x around inf 71.8%
Final simplification70.0%
(FPCore (x y z t a b) :precision binary64 (if (or (<= t -6.2e-71) (not (<= t 1.4e-39))) (/ x (+ 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 <= -6.2e-71) || !(t <= 1.4e-39)) {
tmp = x / (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 <= (-6.2d-71)) .or. (.not. (t <= 1.4d-39))) then
tmp = x / (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 <= -6.2e-71) || !(t <= 1.4e-39)) {
tmp = x / (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 <= -6.2e-71) or not (t <= 1.4e-39): tmp = x / (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 <= -6.2e-71) || !(t <= 1.4e-39)) tmp = Float64(x / Float64(a + Float64(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 <= -6.2e-71) || ~((t <= 1.4e-39))) tmp = x / (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, -6.2e-71], N[Not[LessEqual[t, 1.4e-39]], $MachinePrecision]], N[(x / N[(a + N[(1.0 + N[(y * N[(b / t), $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 -6.2 \cdot 10^{-71} \lor \neg \left(t \leq 1.4 \cdot 10^{-39}\right):\\
\;\;\;\;\frac{x}{a + \left(1 + y \cdot \frac{b}{t}\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{b} + \frac{x \cdot t}{y \cdot b}\\
\end{array}
\end{array}
if t < -6.20000000000000004e-71 or 1.4000000000000001e-39 < t Initial program 86.4%
*-commutative86.4%
associate-*l/94.8%
associate-+l+94.8%
associate-*r/96.2%
*-commutative96.2%
Simplified96.2%
Taylor expanded in x around inf 69.4%
if -6.20000000000000004e-71 < t < 1.4000000000000001e-39Initial program 66.2%
*-commutative66.2%
associate-*l/57.5%
associate-+l+57.5%
associate-*r/52.1%
*-commutative52.1%
Simplified52.1%
Taylor expanded in t around 0 55.4%
Taylor expanded in x around inf 71.8%
Final simplification70.4%
(FPCore (x y z t a b) :precision binary64 (if (or (<= t -4e-71) (not (<= t 2.4e-102))) (/ (+ x (* z (/ y t))) (+ a 1.0)) (/ (+ z (/ (* x t) y)) b)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -4e-71) || !(t <= 2.4e-102)) {
tmp = (x + (z * (y / t))) / (a + 1.0);
} else {
tmp = (z + ((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 <= (-4d-71)) .or. (.not. (t <= 2.4d-102))) then
tmp = (x + (z * (y / t))) / (a + 1.0d0)
else
tmp = (z + ((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 <= -4e-71) || !(t <= 2.4e-102)) {
tmp = (x + (z * (y / t))) / (a + 1.0);
} else {
tmp = (z + ((x * t) / y)) / b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (t <= -4e-71) or not (t <= 2.4e-102): tmp = (x + (z * (y / t))) / (a + 1.0) else: tmp = (z + ((x * t) / y)) / b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((t <= -4e-71) || !(t <= 2.4e-102)) tmp = Float64(Float64(x + Float64(z * Float64(y / t))) / Float64(a + 1.0)); else tmp = Float64(Float64(z + Float64(Float64(x * t) / y)) / b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((t <= -4e-71) || ~((t <= 2.4e-102))) tmp = (x + (z * (y / t))) / (a + 1.0); else tmp = (z + ((x * t) / y)) / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[t, -4e-71], N[Not[LessEqual[t, 2.4e-102]], $MachinePrecision]], N[(N[(x + N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(a + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(z + N[(N[(x * t), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision] / b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4 \cdot 10^{-71} \lor \neg \left(t \leq 2.4 \cdot 10^{-102}\right):\\
\;\;\;\;\frac{x + z \cdot \frac{y}{t}}{a + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{z + \frac{x \cdot t}{y}}{b}\\
\end{array}
\end{array}
if t < -3.9999999999999997e-71 or 2.4e-102 < t Initial program 84.9%
*-commutative84.9%
associate-*l/91.8%
associate-+l+91.8%
associate-*r/92.5%
*-commutative92.5%
Simplified92.5%
Taylor expanded in b around 0 72.1%
associate-*l/77.3%
Applied egg-rr77.3%
if -3.9999999999999997e-71 < t < 2.4e-102Initial program 65.5%
*-commutative65.5%
associate-*l/56.3%
associate-+l+56.3%
associate-*r/51.0%
*-commutative51.0%
Simplified51.0%
Taylor expanded in t around 0 58.5%
Taylor expanded in x around inf 75.5%
*-commutative75.5%
times-frac68.1%
Simplified68.1%
Taylor expanded in b around 0 75.6%
Final simplification76.7%
(FPCore (x y z t a b) :precision binary64 (if (or (<= t -0.37) (not (<= t 5e-38))) (/ x (+ a 1.0)) (/ (+ z (* x (/ t y))) b)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -0.37) || !(t <= 5e-38)) {
tmp = x / (a + 1.0);
} else {
tmp = (z + (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 <= (-0.37d0)) .or. (.not. (t <= 5d-38))) then
tmp = x / (a + 1.0d0)
else
tmp = (z + (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 <= -0.37) || !(t <= 5e-38)) {
tmp = x / (a + 1.0);
} else {
tmp = (z + (x * (t / y))) / b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (t <= -0.37) or not (t <= 5e-38): tmp = x / (a + 1.0) else: tmp = (z + (x * (t / y))) / b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((t <= -0.37) || !(t <= 5e-38)) tmp = Float64(x / Float64(a + 1.0)); else tmp = Float64(Float64(z + Float64(x * Float64(t / y))) / b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((t <= -0.37) || ~((t <= 5e-38))) tmp = x / (a + 1.0); else tmp = (z + (x * (t / y))) / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[t, -0.37], N[Not[LessEqual[t, 5e-38]], $MachinePrecision]], N[(x / N[(a + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(z + N[(x * N[(t / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -0.37 \lor \neg \left(t \leq 5 \cdot 10^{-38}\right):\\
\;\;\;\;\frac{x}{a + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{z + x \cdot \frac{t}{y}}{b}\\
\end{array}
\end{array}
if t < -0.37 or 5.00000000000000033e-38 < t Initial program 85.5%
*-commutative85.5%
associate-*l/94.9%
associate-+l+94.9%
associate-*r/96.4%
*-commutative96.4%
Simplified96.4%
Taylor expanded in t around inf 62.8%
if -0.37 < t < 5.00000000000000033e-38Initial program 69.8%
*-commutative69.8%
associate-*l/62.3%
associate-+l+62.3%
associate-*r/57.5%
*-commutative57.5%
Simplified57.5%
Taylor expanded in t around 0 53.1%
Taylor expanded in x around inf 68.3%
*-commutative68.3%
times-frac61.2%
Simplified61.2%
Taylor expanded in b around 0 66.9%
*-commutative66.9%
associate-*r/65.4%
Simplified65.4%
Final simplification64.0%
(FPCore (x y z t a b) :precision binary64 (if (or (<= t -9.0) (not (<= t 3.4e-38))) (/ x (+ a 1.0)) (/ (+ z (/ (* x t) y)) b)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -9.0) || !(t <= 3.4e-38)) {
tmp = x / (a + 1.0);
} else {
tmp = (z + ((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 <= (-9.0d0)) .or. (.not. (t <= 3.4d-38))) then
tmp = x / (a + 1.0d0)
else
tmp = (z + ((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 <= -9.0) || !(t <= 3.4e-38)) {
tmp = x / (a + 1.0);
} else {
tmp = (z + ((x * t) / y)) / b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (t <= -9.0) or not (t <= 3.4e-38): tmp = x / (a + 1.0) else: tmp = (z + ((x * t) / y)) / b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((t <= -9.0) || !(t <= 3.4e-38)) tmp = Float64(x / Float64(a + 1.0)); else tmp = Float64(Float64(z + Float64(Float64(x * t) / y)) / b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((t <= -9.0) || ~((t <= 3.4e-38))) tmp = x / (a + 1.0); else tmp = (z + ((x * t) / y)) / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[t, -9.0], N[Not[LessEqual[t, 3.4e-38]], $MachinePrecision]], N[(x / N[(a + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(z + N[(N[(x * t), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision] / b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -9 \lor \neg \left(t \leq 3.4 \cdot 10^{-38}\right):\\
\;\;\;\;\frac{x}{a + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{z + \frac{x \cdot t}{y}}{b}\\
\end{array}
\end{array}
if t < -9 or 3.4000000000000002e-38 < t Initial program 85.5%
*-commutative85.5%
associate-*l/94.9%
associate-+l+94.9%
associate-*r/96.4%
*-commutative96.4%
Simplified96.4%
Taylor expanded in t around inf 62.8%
if -9 < t < 3.4000000000000002e-38Initial program 69.8%
*-commutative69.8%
associate-*l/62.3%
associate-+l+62.3%
associate-*r/57.5%
*-commutative57.5%
Simplified57.5%
Taylor expanded in t around 0 53.1%
Taylor expanded in x around inf 68.3%
*-commutative68.3%
times-frac61.2%
Simplified61.2%
Taylor expanded in b around 0 66.9%
Final simplification64.7%
(FPCore (x y z t a b) :precision binary64 (if (<= t -5e+151) (/ x a) (if (<= t -9.8) x (if (<= t 7.5e-38) (/ z b) (/ x a)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -5e+151) {
tmp = x / a;
} else if (t <= -9.8) {
tmp = x;
} else if (t <= 7.5e-38) {
tmp = z / b;
} else {
tmp = x / a;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (t <= (-5d+151)) then
tmp = x / a
else if (t <= (-9.8d0)) then
tmp = x
else if (t <= 7.5d-38) then
tmp = z / b
else
tmp = x / a
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -5e+151) {
tmp = x / a;
} else if (t <= -9.8) {
tmp = x;
} else if (t <= 7.5e-38) {
tmp = z / b;
} else {
tmp = x / a;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if t <= -5e+151: tmp = x / a elif t <= -9.8: tmp = x elif t <= 7.5e-38: tmp = z / b else: tmp = x / a return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (t <= -5e+151) tmp = Float64(x / a); elseif (t <= -9.8) tmp = x; elseif (t <= 7.5e-38) tmp = Float64(z / b); else tmp = Float64(x / a); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (t <= -5e+151) tmp = x / a; elseif (t <= -9.8) tmp = x; elseif (t <= 7.5e-38) tmp = z / b; else tmp = x / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -5e+151], N[(x / a), $MachinePrecision], If[LessEqual[t, -9.8], x, If[LessEqual[t, 7.5e-38], N[(z / b), $MachinePrecision], N[(x / a), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -5 \cdot 10^{+151}:\\
\;\;\;\;\frac{x}{a}\\
\mathbf{elif}\;t \leq -9.8:\\
\;\;\;\;x\\
\mathbf{elif}\;t \leq 7.5 \cdot 10^{-38}:\\
\;\;\;\;\frac{z}{b}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{a}\\
\end{array}
\end{array}
if t < -5.0000000000000002e151 or 7.5e-38 < t Initial program 82.2%
*-commutative82.2%
associate-*l/94.7%
associate-+l+94.7%
associate-*r/97.0%
*-commutative97.0%
Simplified97.0%
Taylor expanded in t around inf 64.4%
Taylor expanded in a around inf 42.9%
if -5.0000000000000002e151 < t < -9.8000000000000007Initial program 92.9%
*-commutative92.9%
associate-*l/95.3%
associate-+l+95.3%
associate-*r/95.3%
*-commutative95.3%
Simplified95.3%
Taylor expanded in t around inf 59.0%
Taylor expanded in a around 0 36.8%
if -9.8000000000000007 < t < 7.5e-38Initial program 69.8%
*-commutative69.8%
associate-*l/62.3%
associate-+l+62.3%
associate-*r/57.5%
*-commutative57.5%
Simplified57.5%
Taylor expanded in t around 0 54.6%
Final simplification47.5%
(FPCore (x y z t a b) :precision binary64 (if (or (<= t -7.4e-34) (not (<= t 2.1e-38))) (/ x (+ a 1.0)) (/ z b)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -7.4e-34) || !(t <= 2.1e-38)) {
tmp = x / (a + 1.0);
} else {
tmp = z / b;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((t <= (-7.4d-34)) .or. (.not. (t <= 2.1d-38))) then
tmp = x / (a + 1.0d0)
else
tmp = z / b
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -7.4e-34) || !(t <= 2.1e-38)) {
tmp = x / (a + 1.0);
} else {
tmp = z / b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (t <= -7.4e-34) or not (t <= 2.1e-38): tmp = x / (a + 1.0) else: tmp = z / b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((t <= -7.4e-34) || !(t <= 2.1e-38)) tmp = Float64(x / Float64(a + 1.0)); else tmp = Float64(z / b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((t <= -7.4e-34) || ~((t <= 2.1e-38))) tmp = x / (a + 1.0); else tmp = z / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[t, -7.4e-34], N[Not[LessEqual[t, 2.1e-38]], $MachinePrecision]], N[(x / N[(a + 1.0), $MachinePrecision]), $MachinePrecision], N[(z / b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -7.4 \cdot 10^{-34} \lor \neg \left(t \leq 2.1 \cdot 10^{-38}\right):\\
\;\;\;\;\frac{x}{a + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{b}\\
\end{array}
\end{array}
if t < -7.39999999999999976e-34 or 2.10000000000000013e-38 < t Initial program 85.9%
*-commutative85.9%
associate-*l/94.5%
associate-+l+94.5%
associate-*r/96.0%
*-commutative96.0%
Simplified96.0%
Taylor expanded in t around inf 60.3%
if -7.39999999999999976e-34 < t < 2.10000000000000013e-38Initial program 68.0%
*-commutative68.0%
associate-*l/59.8%
associate-+l+59.8%
associate-*r/54.6%
*-commutative54.6%
Simplified54.6%
Taylor expanded in t around 0 57.3%
Final simplification59.0%
(FPCore (x y z t a b) :precision binary64 (if (or (<= a -1.0) (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 <= -1.0) || !(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 <= (-1.0d0)) .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 <= -1.0) || !(a <= 1.0)) {
tmp = x / a;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (a <= -1.0) 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 <= -1.0) || !(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 <= -1.0) || ~((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, -1.0], N[Not[LessEqual[a, 1.0]], $MachinePrecision]], N[(x / a), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1 \lor \neg \left(a \leq 1\right):\\
\;\;\;\;\frac{x}{a}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < -1 or 1 < a Initial program 76.7%
*-commutative76.7%
associate-*l/78.9%
associate-+l+78.9%
associate-*r/78.8%
*-commutative78.8%
Simplified78.8%
Taylor expanded in t around inf 46.2%
Taylor expanded in a around inf 45.4%
if -1 < a < 1Initial program 79.4%
*-commutative79.4%
associate-*l/79.6%
associate-+l+79.6%
associate-*r/76.6%
*-commutative76.6%
Simplified76.6%
Taylor expanded in t around inf 34.6%
Taylor expanded in a around 0 33.0%
Final simplification39.4%
(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 78.0%
*-commutative78.0%
associate-*l/79.2%
associate-+l+79.2%
associate-*r/77.7%
*-commutative77.7%
Simplified77.7%
Taylor expanded in t around inf 40.6%
Taylor expanded in a around 0 17.8%
Final simplification17.8%
(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 2023310
(FPCore (x y z t a b)
:name "Diagrams.Solve.Tridiagonal:solveCyclicTriDiagonal from diagrams-solve-0.1, B"
:precision binary64
:herbie-target
(if (< t -1.3659085366310088e-271) (* 1.0 (* (+ x (* (/ y t) z)) (/ 1.0 (+ (+ a 1.0) (* (/ y t) b))))) (if (< t 3.036967103737246e-130) (/ z b) (* 1.0 (* (+ x (* (/ y t) z)) (/ 1.0 (+ (+ a 1.0) (* (/ y t) b)))))))
(/ (+ x (/ (* y z) t)) (+ (+ a 1.0) (/ (* y b) t))))