
(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 (fma b (/ y t) (+ a 1.0)))
(t_2 (/ (+ x (/ (* y z) t)) (+ (+ a 1.0) (/ (* y b) t))))
(t_3 (fma (/ y t) (/ z t_1) (/ x t_1))))
(if (<= t_2 -4e-216)
t_3
(if (<= t_2 2.5e+66)
(/ (+ x (* (/ 1.0 t) (/ y (/ 1.0 z)))) (+ a (+ 1.0 (/ y (/ t b)))))
(if (<= t_2 INFINITY) t_3 (/ z b))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = fma(b, (y / t), (a + 1.0));
double t_2 = (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t));
double t_3 = fma((y / t), (z / t_1), (x / t_1));
double tmp;
if (t_2 <= -4e-216) {
tmp = t_3;
} else if (t_2 <= 2.5e+66) {
tmp = (x + ((1.0 / t) * (y / (1.0 / z)))) / (a + (1.0 + (y / (t / b))));
} else if (t_2 <= ((double) INFINITY)) {
tmp = t_3;
} else {
tmp = z / b;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = fma(b, Float64(y / t), Float64(a + 1.0)) t_2 = Float64(Float64(x + Float64(Float64(y * z) / t)) / Float64(Float64(a + 1.0) + Float64(Float64(y * b) / t))) t_3 = fma(Float64(y / t), Float64(z / t_1), Float64(x / t_1)) tmp = 0.0 if (t_2 <= -4e-216) tmp = t_3; elseif (t_2 <= 2.5e+66) tmp = Float64(Float64(x + Float64(Float64(1.0 / t) * Float64(y / Float64(1.0 / z)))) / Float64(a + Float64(1.0 + Float64(y / Float64(t / b))))); elseif (t_2 <= Inf) tmp = t_3; else tmp = Float64(z / b); end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(b * N[(y / t), $MachinePrecision] + N[(a + 1.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = 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]}, Block[{t$95$3 = N[(N[(y / t), $MachinePrecision] * N[(z / t$95$1), $MachinePrecision] + N[(x / t$95$1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -4e-216], t$95$3, If[LessEqual[t$95$2, 2.5e+66], N[(N[(x + N[(N[(1.0 / t), $MachinePrecision] * N[(y / N[(1.0 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(a + N[(1.0 + N[(y / N[(t / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, Infinity], t$95$3, N[(z / b), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(b, \frac{y}{t}, a + 1\right)\\
t_2 := \frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}}\\
t_3 := \mathsf{fma}\left(\frac{y}{t}, \frac{z}{t_1}, \frac{x}{t_1}\right)\\
\mathbf{if}\;t_2 \leq -4 \cdot 10^{-216}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;t_2 \leq 2.5 \cdot 10^{+66}:\\
\;\;\;\;\frac{x + \frac{1}{t} \cdot \frac{y}{\frac{1}{z}}}{a + \left(1 + \frac{y}{\frac{t}{b}}\right)}\\
\mathbf{elif}\;t_2 \leq \infty:\\
\;\;\;\;t_3\\
\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))) < -4.0000000000000002e-216 or 2.49999999999999996e66 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < +inf.0Initial program 85.9%
*-commutative85.9%
associate-*l/85.8%
*-commutative85.8%
associate-*l/81.4%
Simplified81.4%
Taylor expanded in x around 0 89.3%
+-commutative89.3%
times-frac96.3%
fma-def96.3%
associate-+r+96.3%
associate-/l*96.1%
+-commutative96.1%
associate-/l*96.3%
associate-*r/96.1%
fma-def96.1%
associate-+r+96.1%
associate-/l*96.1%
+-commutative96.1%
associate-/l*96.1%
associate-*r/96.1%
fma-def96.1%
Simplified96.1%
if -4.0000000000000002e-216 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < 2.49999999999999996e66Initial program 84.3%
associate-/l*82.4%
associate-+l+82.4%
associate-/l*84.5%
Simplified84.5%
*-un-lft-identity84.5%
div-inv84.5%
times-frac87.4%
Applied egg-rr87.4%
if +inf.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) Initial program 0.0%
*-commutative0.0%
associate-*l/0.3%
*-commutative0.3%
associate-*l/9.3%
Simplified9.3%
Taylor expanded in t around 0 100.0%
Final simplification93.2%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (+ x (/ (* y z) t)) (+ (+ a 1.0) (/ (* y b) t)))))
(if (<= t_1 (- INFINITY))
(/ (+ x (* y (/ z t))) (+ (+ a 1.0) (* y (/ b t))))
(if (<= t_1 -1e-185)
t_1
(if (<= t_1 4e-308)
(/ (+ x (* z (/ y t))) (+ a (+ 1.0 (/ y (/ t b)))))
(if (<= t_1 2e+300) t_1 (/ z b)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t));
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = (x + (y * (z / t))) / ((a + 1.0) + (y * (b / t)));
} else if (t_1 <= -1e-185) {
tmp = t_1;
} else if (t_1 <= 4e-308) {
tmp = (x + (z * (y / t))) / (a + (1.0 + (y / (t / b))));
} else if (t_1 <= 2e+300) {
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)) / ((a + 1.0) + ((y * b) / t));
double tmp;
if (t_1 <= -Double.POSITIVE_INFINITY) {
tmp = (x + (y * (z / t))) / ((a + 1.0) + (y * (b / t)));
} else if (t_1 <= -1e-185) {
tmp = t_1;
} else if (t_1 <= 4e-308) {
tmp = (x + (z * (y / t))) / (a + (1.0 + (y / (t / b))));
} else if (t_1 <= 2e+300) {
tmp = t_1;
} else {
tmp = z / b;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t)) tmp = 0 if t_1 <= -math.inf: tmp = (x + (y * (z / t))) / ((a + 1.0) + (y * (b / t))) elif t_1 <= -1e-185: tmp = t_1 elif t_1 <= 4e-308: tmp = (x + (z * (y / t))) / (a + (1.0 + (y / (t / b)))) elif t_1 <= 2e+300: tmp = t_1 else: tmp = z / b return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(x + Float64(Float64(y * z) / t)) / Float64(Float64(a + 1.0) + Float64(Float64(y * b) / t))) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = Float64(Float64(x + Float64(y * Float64(z / t))) / Float64(Float64(a + 1.0) + Float64(y * Float64(b / t)))); elseif (t_1 <= -1e-185) tmp = t_1; elseif (t_1 <= 4e-308) tmp = Float64(Float64(x + Float64(z * Float64(y / t))) / Float64(a + Float64(1.0 + Float64(y / Float64(t / b))))); elseif (t_1 <= 2e+300) tmp = t_1; else tmp = Float64(z / b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t)); tmp = 0.0; if (t_1 <= -Inf) tmp = (x + (y * (z / t))) / ((a + 1.0) + (y * (b / t))); elseif (t_1 <= -1e-185) tmp = t_1; elseif (t_1 <= 4e-308) tmp = (x + (z * (y / t))) / (a + (1.0 + (y / (t / b)))); elseif (t_1 <= 2e+300) tmp = t_1; else tmp = z / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] / N[(N[(a + 1.0), $MachinePrecision] + N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(N[(x + N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(a + 1.0), $MachinePrecision] + N[(y * N[(b / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, -1e-185], t$95$1, If[LessEqual[t$95$1, 4e-308], N[(N[(x + N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(a + N[(1.0 + N[(y / N[(t / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2e+300], t$95$1, N[(z / b), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}}\\
\mathbf{if}\;t_1 \leq -\infty:\\
\;\;\;\;\frac{x + y \cdot \frac{z}{t}}{\left(a + 1\right) + y \cdot \frac{b}{t}}\\
\mathbf{elif}\;t_1 \leq -1 \cdot 10^{-185}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t_1 \leq 4 \cdot 10^{-308}:\\
\;\;\;\;\frac{x + z \cdot \frac{y}{t}}{a + \left(1 + \frac{y}{\frac{t}{b}}\right)}\\
\mathbf{elif}\;t_1 \leq 2 \cdot 10^{+300}:\\
\;\;\;\;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 34.0%
*-commutative34.0%
associate-*l/85.2%
*-commutative85.2%
associate-*l/85.2%
Simplified85.2%
if -inf.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < -9.9999999999999999e-186 or 4.00000000000000013e-308 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < 2.0000000000000001e300Initial program 99.3%
if -9.9999999999999999e-186 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < 4.00000000000000013e-308Initial program 66.9%
associate-/l*66.9%
associate-+l+66.9%
associate-/l*75.4%
Simplified75.4%
associate-/r/76.5%
Applied egg-rr76.5%
if 2.0000000000000001e300 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) Initial program 4.4%
*-commutative4.4%
associate-*l/15.8%
*-commutative15.8%
associate-*l/21.8%
Simplified21.8%
Taylor expanded in t around 0 83.2%
Final simplification92.3%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (+ x (/ (* y z) t)) (+ (+ a 1.0) (/ (* y b) t))))
(t_2 (+ (+ a 1.0) (* y (/ b t)))))
(if (<= t_1 (- INFINITY))
(/ (+ x (* y (/ z t))) t_2)
(if (<= t_1 -2e-253)
t_1
(if (<= t_1 0.0)
(/ (+ x (/ 1.0 (/ t (* y z)))) t_2)
(if (<= t_1 2e+300) t_1 (/ z b)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t));
double t_2 = (a + 1.0) + (y * (b / t));
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = (x + (y * (z / t))) / t_2;
} else if (t_1 <= -2e-253) {
tmp = t_1;
} else if (t_1 <= 0.0) {
tmp = (x + (1.0 / (t / (y * z)))) / t_2;
} else if (t_1 <= 2e+300) {
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)) / ((a + 1.0) + ((y * b) / t));
double t_2 = (a + 1.0) + (y * (b / t));
double tmp;
if (t_1 <= -Double.POSITIVE_INFINITY) {
tmp = (x + (y * (z / t))) / t_2;
} else if (t_1 <= -2e-253) {
tmp = t_1;
} else if (t_1 <= 0.0) {
tmp = (x + (1.0 / (t / (y * z)))) / t_2;
} else if (t_1 <= 2e+300) {
tmp = t_1;
} else {
tmp = z / b;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t)) t_2 = (a + 1.0) + (y * (b / t)) tmp = 0 if t_1 <= -math.inf: tmp = (x + (y * (z / t))) / t_2 elif t_1 <= -2e-253: tmp = t_1 elif t_1 <= 0.0: tmp = (x + (1.0 / (t / (y * z)))) / t_2 elif t_1 <= 2e+300: tmp = t_1 else: tmp = z / b return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(x + Float64(Float64(y * z) / t)) / Float64(Float64(a + 1.0) + Float64(Float64(y * b) / t))) t_2 = Float64(Float64(a + 1.0) + Float64(y * Float64(b / t))) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = Float64(Float64(x + Float64(y * Float64(z / t))) / t_2); elseif (t_1 <= -2e-253) tmp = t_1; elseif (t_1 <= 0.0) tmp = Float64(Float64(x + Float64(1.0 / Float64(t / Float64(y * z)))) / t_2); elseif (t_1 <= 2e+300) tmp = t_1; else tmp = Float64(z / b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t)); t_2 = (a + 1.0) + (y * (b / t)); tmp = 0.0; if (t_1 <= -Inf) tmp = (x + (y * (z / t))) / t_2; elseif (t_1 <= -2e-253) tmp = t_1; elseif (t_1 <= 0.0) tmp = (x + (1.0 / (t / (y * z)))) / t_2; elseif (t_1 <= 2e+300) tmp = t_1; else tmp = z / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] / N[(N[(a + 1.0), $MachinePrecision] + N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(a + 1.0), $MachinePrecision] + N[(y * N[(b / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(N[(x + N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$2), $MachinePrecision], If[LessEqual[t$95$1, -2e-253], t$95$1, If[LessEqual[t$95$1, 0.0], N[(N[(x + N[(1.0 / N[(t / N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$2), $MachinePrecision], If[LessEqual[t$95$1, 2e+300], t$95$1, N[(z / b), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}}\\
t_2 := \left(a + 1\right) + y \cdot \frac{b}{t}\\
\mathbf{if}\;t_1 \leq -\infty:\\
\;\;\;\;\frac{x + y \cdot \frac{z}{t}}{t_2}\\
\mathbf{elif}\;t_1 \leq -2 \cdot 10^{-253}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t_1 \leq 0:\\
\;\;\;\;\frac{x + \frac{1}{\frac{t}{y \cdot z}}}{t_2}\\
\mathbf{elif}\;t_1 \leq 2 \cdot 10^{+300}:\\
\;\;\;\;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 34.0%
*-commutative34.0%
associate-*l/85.2%
*-commutative85.2%
associate-*l/85.2%
Simplified85.2%
if -inf.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < -2.0000000000000001e-253 or 0.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < 2.0000000000000001e300Initial program 98.8%
if -2.0000000000000001e-253 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < 0.0Initial program 62.5%
*-commutative62.5%
associate-*l/62.5%
*-commutative62.5%
associate-*l/72.6%
Simplified72.6%
associate-*l/75.1%
*-commutative75.1%
clear-num75.0%
*-commutative75.0%
Applied egg-rr75.0%
if 2.0000000000000001e300 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) Initial program 4.4%
*-commutative4.4%
associate-*l/15.8%
*-commutative15.8%
associate-*l/21.8%
Simplified21.8%
Taylor expanded in t around 0 83.2%
Final simplification92.5%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (+ x (/ (* y z) t)) (+ (+ a 1.0) (/ (* y b) t)))))
(if (<= t_1 (- INFINITY))
(/ (+ x (* y (/ z t))) (+ (+ a 1.0) (* y (/ b t))))
(if (<= t_1 -2e-253)
t_1
(if (<= t_1 4e-308)
(/ (+ x (* (/ 1.0 t) (/ y (/ 1.0 z)))) (+ a (+ 1.0 (/ y (/ t b)))))
(if (<= t_1 2e+300) t_1 (/ z b)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t));
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = (x + (y * (z / t))) / ((a + 1.0) + (y * (b / t)));
} else if (t_1 <= -2e-253) {
tmp = t_1;
} else if (t_1 <= 4e-308) {
tmp = (x + ((1.0 / t) * (y / (1.0 / z)))) / (a + (1.0 + (y / (t / b))));
} else if (t_1 <= 2e+300) {
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)) / ((a + 1.0) + ((y * b) / t));
double tmp;
if (t_1 <= -Double.POSITIVE_INFINITY) {
tmp = (x + (y * (z / t))) / ((a + 1.0) + (y * (b / t)));
} else if (t_1 <= -2e-253) {
tmp = t_1;
} else if (t_1 <= 4e-308) {
tmp = (x + ((1.0 / t) * (y / (1.0 / z)))) / (a + (1.0 + (y / (t / b))));
} else if (t_1 <= 2e+300) {
tmp = t_1;
} else {
tmp = z / b;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t)) tmp = 0 if t_1 <= -math.inf: tmp = (x + (y * (z / t))) / ((a + 1.0) + (y * (b / t))) elif t_1 <= -2e-253: tmp = t_1 elif t_1 <= 4e-308: tmp = (x + ((1.0 / t) * (y / (1.0 / z)))) / (a + (1.0 + (y / (t / b)))) elif t_1 <= 2e+300: tmp = t_1 else: tmp = z / b return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(x + Float64(Float64(y * z) / t)) / Float64(Float64(a + 1.0) + Float64(Float64(y * b) / t))) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = Float64(Float64(x + Float64(y * Float64(z / t))) / Float64(Float64(a + 1.0) + Float64(y * Float64(b / t)))); elseif (t_1 <= -2e-253) tmp = t_1; elseif (t_1 <= 4e-308) tmp = Float64(Float64(x + Float64(Float64(1.0 / t) * Float64(y / Float64(1.0 / z)))) / Float64(a + Float64(1.0 + Float64(y / Float64(t / b))))); elseif (t_1 <= 2e+300) tmp = t_1; else tmp = Float64(z / b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t)); tmp = 0.0; if (t_1 <= -Inf) tmp = (x + (y * (z / t))) / ((a + 1.0) + (y * (b / t))); elseif (t_1 <= -2e-253) tmp = t_1; elseif (t_1 <= 4e-308) tmp = (x + ((1.0 / t) * (y / (1.0 / z)))) / (a + (1.0 + (y / (t / b)))); elseif (t_1 <= 2e+300) tmp = t_1; else tmp = z / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] / N[(N[(a + 1.0), $MachinePrecision] + N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(N[(x + N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(a + 1.0), $MachinePrecision] + N[(y * N[(b / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, -2e-253], t$95$1, If[LessEqual[t$95$1, 4e-308], N[(N[(x + N[(N[(1.0 / t), $MachinePrecision] * N[(y / N[(1.0 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(a + N[(1.0 + N[(y / N[(t / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2e+300], t$95$1, N[(z / b), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}}\\
\mathbf{if}\;t_1 \leq -\infty:\\
\;\;\;\;\frac{x + y \cdot \frac{z}{t}}{\left(a + 1\right) + y \cdot \frac{b}{t}}\\
\mathbf{elif}\;t_1 \leq -2 \cdot 10^{-253}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t_1 \leq 4 \cdot 10^{-308}:\\
\;\;\;\;\frac{x + \frac{1}{t} \cdot \frac{y}{\frac{1}{z}}}{a + \left(1 + \frac{y}{\frac{t}{b}}\right)}\\
\mathbf{elif}\;t_1 \leq 2 \cdot 10^{+300}:\\
\;\;\;\;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 34.0%
*-commutative34.0%
associate-*l/85.2%
*-commutative85.2%
associate-*l/85.2%
Simplified85.2%
if -inf.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < -2.0000000000000001e-253 or 4.00000000000000013e-308 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < 2.0000000000000001e300Initial program 98.8%
if -2.0000000000000001e-253 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < 4.00000000000000013e-308Initial program 64.3%
associate-/l*64.3%
associate-+l+64.3%
associate-/l*74.0%
Simplified74.0%
*-un-lft-identity74.0%
div-inv74.1%
times-frac76.4%
Applied egg-rr76.4%
if 2.0000000000000001e300 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) Initial program 4.4%
*-commutative4.4%
associate-*l/15.8%
*-commutative15.8%
associate-*l/21.8%
Simplified21.8%
Taylor expanded in t around 0 83.2%
Final simplification92.5%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (+ x (* z (/ y t))) (+ a (+ 1.0 (/ y (/ t b))))))
(t_2 (/ (+ z (/ t (/ y x))) b)))
(if (<= y -9.5e+76)
t_2
(if (<= y -2.15e-246)
t_1
(if (<= y 4.7e-297)
(/ x (+ 1.0 (+ a (/ (* y b) t))))
(if (<= y 3.3e+199) t_1 t_2))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x + (z * (y / t))) / (a + (1.0 + (y / (t / b))));
double t_2 = (z + (t / (y / x))) / b;
double tmp;
if (y <= -9.5e+76) {
tmp = t_2;
} else if (y <= -2.15e-246) {
tmp = t_1;
} else if (y <= 4.7e-297) {
tmp = x / (1.0 + (a + ((y * b) / t)));
} else if (y <= 3.3e+199) {
tmp = t_1;
} else {
tmp = 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 + (z * (y / t))) / (a + (1.0d0 + (y / (t / b))))
t_2 = (z + (t / (y / x))) / b
if (y <= (-9.5d+76)) then
tmp = t_2
else if (y <= (-2.15d-246)) then
tmp = t_1
else if (y <= 4.7d-297) then
tmp = x / (1.0d0 + (a + ((y * b) / t)))
else if (y <= 3.3d+199) then
tmp = t_1
else
tmp = 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 + (z * (y / t))) / (a + (1.0 + (y / (t / b))));
double t_2 = (z + (t / (y / x))) / b;
double tmp;
if (y <= -9.5e+76) {
tmp = t_2;
} else if (y <= -2.15e-246) {
tmp = t_1;
} else if (y <= 4.7e-297) {
tmp = x / (1.0 + (a + ((y * b) / t)));
} else if (y <= 3.3e+199) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (x + (z * (y / t))) / (a + (1.0 + (y / (t / b)))) t_2 = (z + (t / (y / x))) / b tmp = 0 if y <= -9.5e+76: tmp = t_2 elif y <= -2.15e-246: tmp = t_1 elif y <= 4.7e-297: tmp = x / (1.0 + (a + ((y * b) / t))) elif y <= 3.3e+199: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(x + Float64(z * Float64(y / t))) / Float64(a + Float64(1.0 + Float64(y / Float64(t / b))))) t_2 = Float64(Float64(z + Float64(t / Float64(y / x))) / b) tmp = 0.0 if (y <= -9.5e+76) tmp = t_2; elseif (y <= -2.15e-246) tmp = t_1; elseif (y <= 4.7e-297) tmp = Float64(x / Float64(1.0 + Float64(a + Float64(Float64(y * b) / t)))); elseif (y <= 3.3e+199) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (x + (z * (y / t))) / (a + (1.0 + (y / (t / b)))); t_2 = (z + (t / (y / x))) / b; tmp = 0.0; if (y <= -9.5e+76) tmp = t_2; elseif (y <= -2.15e-246) tmp = t_1; elseif (y <= 4.7e-297) tmp = x / (1.0 + (a + ((y * b) / t))); elseif (y <= 3.3e+199) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(x + N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(a + N[(1.0 + N[(y / N[(t / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(z + N[(t / N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / b), $MachinePrecision]}, If[LessEqual[y, -9.5e+76], t$95$2, If[LessEqual[y, -2.15e-246], t$95$1, If[LessEqual[y, 4.7e-297], N[(x / N[(1.0 + N[(a + N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.3e+199], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x + z \cdot \frac{y}{t}}{a + \left(1 + \frac{y}{\frac{t}{b}}\right)}\\
t_2 := \frac{z + \frac{t}{\frac{y}{x}}}{b}\\
\mathbf{if}\;y \leq -9.5 \cdot 10^{+76}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq -2.15 \cdot 10^{-246}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 4.7 \cdot 10^{-297}:\\
\;\;\;\;\frac{x}{1 + \left(a + \frac{y \cdot b}{t}\right)}\\
\mathbf{elif}\;y \leq 3.3 \cdot 10^{+199}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if y < -9.5000000000000003e76 or 3.2999999999999998e199 < y Initial program 31.2%
*-commutative31.2%
associate-*l/40.7%
*-commutative40.7%
associate-*l/47.2%
Simplified47.2%
Taylor expanded in x around 0 41.3%
+-commutative41.3%
times-frac36.8%
fma-def36.8%
associate-+r+36.8%
associate-/l*46.0%
+-commutative46.0%
associate-/l*36.8%
associate-*r/46.0%
fma-def46.0%
associate-+r+46.0%
associate-/l*49.2%
+-commutative49.2%
associate-/l*46.0%
associate-*r/49.2%
fma-def49.2%
Simplified49.2%
Taylor expanded in b around inf 70.2%
associate-/l*73.6%
Simplified73.6%
if -9.5000000000000003e76 < y < -2.14999999999999996e-246 or 4.69999999999999986e-297 < y < 3.2999999999999998e199Initial program 91.2%
associate-/l*87.2%
associate-+l+87.2%
associate-/l*87.4%
Simplified87.4%
associate-/r/91.8%
Applied egg-rr91.8%
if -2.14999999999999996e-246 < y < 4.69999999999999986e-297Initial program 99.9%
*-commutative99.9%
associate-*l/99.8%
*-commutative99.8%
associate-*l/69.9%
Simplified69.9%
Taylor expanded in x around inf 94.9%
Final simplification87.7%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ x (/ (* y z) t)))
(t_2 (/ t_1 (+ a 1.0)))
(t_3 (/ (+ z (/ t (/ y x))) b))
(t_4 (/ (* y b) t)))
(if (<= y -1.72e+67)
t_3
(if (<= y -3.6e-101)
(/ x (+ 1.0 (+ a t_4)))
(if (<= y -2e-220)
t_2
(if (<= y -2.5e-265)
(/ t_1 (+ 1.0 t_4))
(if (<= y 3.3e+171) t_2 t_3)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x + ((y * z) / t);
double t_2 = t_1 / (a + 1.0);
double t_3 = (z + (t / (y / x))) / b;
double t_4 = (y * b) / t;
double tmp;
if (y <= -1.72e+67) {
tmp = t_3;
} else if (y <= -3.6e-101) {
tmp = x / (1.0 + (a + t_4));
} else if (y <= -2e-220) {
tmp = t_2;
} else if (y <= -2.5e-265) {
tmp = t_1 / (1.0 + t_4);
} else if (y <= 3.3e+171) {
tmp = t_2;
} else {
tmp = t_3;
}
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) :: t_4
real(8) :: tmp
t_1 = x + ((y * z) / t)
t_2 = t_1 / (a + 1.0d0)
t_3 = (z + (t / (y / x))) / b
t_4 = (y * b) / t
if (y <= (-1.72d+67)) then
tmp = t_3
else if (y <= (-3.6d-101)) then
tmp = x / (1.0d0 + (a + t_4))
else if (y <= (-2d-220)) then
tmp = t_2
else if (y <= (-2.5d-265)) then
tmp = t_1 / (1.0d0 + t_4)
else if (y <= 3.3d+171) then
tmp = t_2
else
tmp = t_3
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x + ((y * z) / t);
double t_2 = t_1 / (a + 1.0);
double t_3 = (z + (t / (y / x))) / b;
double t_4 = (y * b) / t;
double tmp;
if (y <= -1.72e+67) {
tmp = t_3;
} else if (y <= -3.6e-101) {
tmp = x / (1.0 + (a + t_4));
} else if (y <= -2e-220) {
tmp = t_2;
} else if (y <= -2.5e-265) {
tmp = t_1 / (1.0 + t_4);
} else if (y <= 3.3e+171) {
tmp = t_2;
} else {
tmp = t_3;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x + ((y * z) / t) t_2 = t_1 / (a + 1.0) t_3 = (z + (t / (y / x))) / b t_4 = (y * b) / t tmp = 0 if y <= -1.72e+67: tmp = t_3 elif y <= -3.6e-101: tmp = x / (1.0 + (a + t_4)) elif y <= -2e-220: tmp = t_2 elif y <= -2.5e-265: tmp = t_1 / (1.0 + t_4) elif y <= 3.3e+171: tmp = t_2 else: tmp = t_3 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x + Float64(Float64(y * z) / t)) t_2 = Float64(t_1 / Float64(a + 1.0)) t_3 = Float64(Float64(z + Float64(t / Float64(y / x))) / b) t_4 = Float64(Float64(y * b) / t) tmp = 0.0 if (y <= -1.72e+67) tmp = t_3; elseif (y <= -3.6e-101) tmp = Float64(x / Float64(1.0 + Float64(a + t_4))); elseif (y <= -2e-220) tmp = t_2; elseif (y <= -2.5e-265) tmp = Float64(t_1 / Float64(1.0 + t_4)); elseif (y <= 3.3e+171) tmp = t_2; else tmp = t_3; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x + ((y * z) / t); t_2 = t_1 / (a + 1.0); t_3 = (z + (t / (y / x))) / b; t_4 = (y * b) / t; tmp = 0.0; if (y <= -1.72e+67) tmp = t_3; elseif (y <= -3.6e-101) tmp = x / (1.0 + (a + t_4)); elseif (y <= -2e-220) tmp = t_2; elseif (y <= -2.5e-265) tmp = t_1 / (1.0 + t_4); elseif (y <= 3.3e+171) tmp = t_2; else tmp = t_3; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 / N[(a + 1.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(z + N[(t / N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / b), $MachinePrecision]}, Block[{t$95$4 = N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision]}, If[LessEqual[y, -1.72e+67], t$95$3, If[LessEqual[y, -3.6e-101], N[(x / N[(1.0 + N[(a + t$95$4), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -2e-220], t$95$2, If[LessEqual[y, -2.5e-265], N[(t$95$1 / N[(1.0 + t$95$4), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.3e+171], t$95$2, t$95$3]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \frac{y \cdot z}{t}\\
t_2 := \frac{t_1}{a + 1}\\
t_3 := \frac{z + \frac{t}{\frac{y}{x}}}{b}\\
t_4 := \frac{y \cdot b}{t}\\
\mathbf{if}\;y \leq -1.72 \cdot 10^{+67}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;y \leq -3.6 \cdot 10^{-101}:\\
\;\;\;\;\frac{x}{1 + \left(a + t_4\right)}\\
\mathbf{elif}\;y \leq -2 \cdot 10^{-220}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq -2.5 \cdot 10^{-265}:\\
\;\;\;\;\frac{t_1}{1 + t_4}\\
\mathbf{elif}\;y \leq 3.3 \cdot 10^{+171}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;t_3\\
\end{array}
\end{array}
if y < -1.72000000000000011e67 or 3.29999999999999991e171 < y Initial program 35.4%
*-commutative35.4%
associate-*l/45.3%
*-commutative45.3%
associate-*l/51.2%
Simplified51.2%
Taylor expanded in x around 0 44.5%
+-commutative44.5%
times-frac41.9%
fma-def41.9%
associate-+r+41.9%
associate-/l*50.0%
+-commutative50.0%
associate-/l*41.9%
associate-*r/50.0%
fma-def50.0%
associate-+r+50.0%
associate-/l*52.9%
+-commutative52.9%
associate-/l*50.0%
associate-*r/52.9%
fma-def52.9%
Simplified52.9%
Taylor expanded in b around inf 67.6%
associate-/l*70.7%
Simplified70.7%
if -1.72000000000000011e67 < y < -3.6e-101Initial program 82.9%
*-commutative82.9%
associate-*l/89.7%
*-commutative89.7%
associate-*l/89.7%
Simplified89.7%
Taylor expanded in x around inf 76.0%
if -3.6e-101 < y < -1.99999999999999998e-220 or -2.5e-265 < y < 3.29999999999999991e171Initial program 94.0%
*-commutative94.0%
associate-*l/88.5%
*-commutative88.5%
associate-*l/85.8%
Simplified85.8%
Taylor expanded in b around 0 80.4%
if -1.99999999999999998e-220 < y < -2.5e-265Initial program 99.8%
*-commutative99.8%
associate-*l/81.3%
*-commutative81.3%
associate-*l/69.1%
Simplified69.1%
Taylor expanded in a around 0 93.7%
Final simplification78.2%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (+ z (/ t (/ y x))) b))
(t_2 (+ x (* y (/ z t))))
(t_3 (/ t_2 a)))
(if (<= a -1.35e+41)
t_3
(if (<= a -3.1e-12)
t_1
(if (<= a 2.6e-134)
(+ x (* z (/ y t)))
(if (<= a 5.4e-54)
t_1
(if (<= a 2e-11) t_2 (if (<= a 2.8e+158) t_1 t_3))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (z + (t / (y / x))) / b;
double t_2 = x + (y * (z / t));
double t_3 = t_2 / a;
double tmp;
if (a <= -1.35e+41) {
tmp = t_3;
} else if (a <= -3.1e-12) {
tmp = t_1;
} else if (a <= 2.6e-134) {
tmp = x + (z * (y / t));
} else if (a <= 5.4e-54) {
tmp = t_1;
} else if (a <= 2e-11) {
tmp = t_2;
} else if (a <= 2.8e+158) {
tmp = t_1;
} else {
tmp = t_3;
}
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 = (z + (t / (y / x))) / b
t_2 = x + (y * (z / t))
t_3 = t_2 / a
if (a <= (-1.35d+41)) then
tmp = t_3
else if (a <= (-3.1d-12)) then
tmp = t_1
else if (a <= 2.6d-134) then
tmp = x + (z * (y / t))
else if (a <= 5.4d-54) then
tmp = t_1
else if (a <= 2d-11) then
tmp = t_2
else if (a <= 2.8d+158) then
tmp = t_1
else
tmp = t_3
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 = (z + (t / (y / x))) / b;
double t_2 = x + (y * (z / t));
double t_3 = t_2 / a;
double tmp;
if (a <= -1.35e+41) {
tmp = t_3;
} else if (a <= -3.1e-12) {
tmp = t_1;
} else if (a <= 2.6e-134) {
tmp = x + (z * (y / t));
} else if (a <= 5.4e-54) {
tmp = t_1;
} else if (a <= 2e-11) {
tmp = t_2;
} else if (a <= 2.8e+158) {
tmp = t_1;
} else {
tmp = t_3;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (z + (t / (y / x))) / b t_2 = x + (y * (z / t)) t_3 = t_2 / a tmp = 0 if a <= -1.35e+41: tmp = t_3 elif a <= -3.1e-12: tmp = t_1 elif a <= 2.6e-134: tmp = x + (z * (y / t)) elif a <= 5.4e-54: tmp = t_1 elif a <= 2e-11: tmp = t_2 elif a <= 2.8e+158: tmp = t_1 else: tmp = t_3 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(z + Float64(t / Float64(y / x))) / b) t_2 = Float64(x + Float64(y * Float64(z / t))) t_3 = Float64(t_2 / a) tmp = 0.0 if (a <= -1.35e+41) tmp = t_3; elseif (a <= -3.1e-12) tmp = t_1; elseif (a <= 2.6e-134) tmp = Float64(x + Float64(z * Float64(y / t))); elseif (a <= 5.4e-54) tmp = t_1; elseif (a <= 2e-11) tmp = t_2; elseif (a <= 2.8e+158) tmp = t_1; else tmp = t_3; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (z + (t / (y / x))) / b; t_2 = x + (y * (z / t)); t_3 = t_2 / a; tmp = 0.0; if (a <= -1.35e+41) tmp = t_3; elseif (a <= -3.1e-12) tmp = t_1; elseif (a <= 2.6e-134) tmp = x + (z * (y / t)); elseif (a <= 5.4e-54) tmp = t_1; elseif (a <= 2e-11) tmp = t_2; elseif (a <= 2.8e+158) tmp = t_1; else tmp = t_3; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(z + N[(t / N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / b), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(t$95$2 / a), $MachinePrecision]}, If[LessEqual[a, -1.35e+41], t$95$3, If[LessEqual[a, -3.1e-12], t$95$1, If[LessEqual[a, 2.6e-134], N[(x + N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 5.4e-54], t$95$1, If[LessEqual[a, 2e-11], t$95$2, If[LessEqual[a, 2.8e+158], t$95$1, t$95$3]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{z + \frac{t}{\frac{y}{x}}}{b}\\
t_2 := x + y \cdot \frac{z}{t}\\
t_3 := \frac{t_2}{a}\\
\mathbf{if}\;a \leq -1.35 \cdot 10^{+41}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;a \leq -3.1 \cdot 10^{-12}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \leq 2.6 \cdot 10^{-134}:\\
\;\;\;\;x + z \cdot \frac{y}{t}\\
\mathbf{elif}\;a \leq 5.4 \cdot 10^{-54}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \leq 2 \cdot 10^{-11}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;a \leq 2.8 \cdot 10^{+158}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_3\\
\end{array}
\end{array}
if a < -1.35e41 or 2.80000000000000001e158 < a Initial program 79.5%
*-commutative79.5%
associate-*l/82.9%
*-commutative82.9%
associate-*l/81.7%
Simplified81.7%
Taylor expanded in x around 0 80.8%
+-commutative80.8%
times-frac84.1%
fma-def84.1%
associate-+r+84.1%
associate-/l*87.5%
+-commutative87.5%
associate-/l*84.1%
associate-*r/87.5%
fma-def87.5%
associate-+r+87.5%
associate-/l*88.7%
+-commutative88.7%
associate-/l*87.5%
associate-*r/88.7%
fma-def88.7%
Simplified88.7%
Taylor expanded in a around inf 76.0%
associate-*r/79.3%
Simplified79.3%
if -1.35e41 < a < -3.1000000000000001e-12 or 2.60000000000000023e-134 < a < 5.40000000000000051e-54 or 1.99999999999999988e-11 < a < 2.80000000000000001e158Initial program 69.7%
*-commutative69.7%
associate-*l/66.6%
*-commutative66.6%
associate-*l/66.6%
Simplified66.6%
Taylor expanded in x around 0 74.8%
+-commutative74.8%
times-frac68.0%
fma-def68.0%
associate-+r+68.0%
associate-/l*71.2%
+-commutative71.2%
associate-/l*68.0%
associate-*r/71.3%
fma-def71.3%
associate-+r+71.3%
associate-/l*72.9%
+-commutative72.9%
associate-/l*71.3%
associate-*r/72.9%
fma-def72.9%
Simplified72.9%
Taylor expanded in b around inf 64.4%
associate-/l*64.4%
Simplified64.4%
if -3.1000000000000001e-12 < a < 2.60000000000000023e-134Initial program 79.6%
*-commutative79.6%
associate-*l/76.8%
*-commutative76.8%
associate-*l/76.0%
Simplified76.0%
Taylor expanded in a around 0 79.6%
clear-num79.5%
inv-pow79.5%
Applied egg-rr79.5%
unpow-179.5%
Simplified79.5%
Taylor expanded in b around 0 60.6%
associate-/l*61.2%
associate-/r/65.5%
Simplified65.5%
if 5.40000000000000051e-54 < a < 1.99999999999999988e-11Initial program 87.1%
*-commutative87.1%
associate-*l/87.1%
*-commutative87.1%
associate-*l/87.1%
Simplified87.1%
Taylor expanded in a around 0 84.3%
Taylor expanded in b around 0 84.4%
associate-*r/84.4%
Simplified84.4%
Final simplification70.2%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (+ x (* y (/ z t))) a)))
(if (<= a -6800.0)
t_1
(if (<= a 1.1e-133)
(+ x (* z (/ y t)))
(if (<= a 5.6e-109)
(/ z b)
(if (<= a 57000.0) (/ x (+ 1.0 (/ (* y b) t))) t_1))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x + (y * (z / t))) / a;
double tmp;
if (a <= -6800.0) {
tmp = t_1;
} else if (a <= 1.1e-133) {
tmp = x + (z * (y / t));
} else if (a <= 5.6e-109) {
tmp = z / b;
} else if (a <= 57000.0) {
tmp = x / (1.0 + ((y * b) / t));
} 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 = (x + (y * (z / t))) / a
if (a <= (-6800.0d0)) then
tmp = t_1
else if (a <= 1.1d-133) then
tmp = x + (z * (y / t))
else if (a <= 5.6d-109) then
tmp = z / b
else if (a <= 57000.0d0) then
tmp = x / (1.0d0 + ((y * b) / t))
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 = (x + (y * (z / t))) / a;
double tmp;
if (a <= -6800.0) {
tmp = t_1;
} else if (a <= 1.1e-133) {
tmp = x + (z * (y / t));
} else if (a <= 5.6e-109) {
tmp = z / b;
} else if (a <= 57000.0) {
tmp = x / (1.0 + ((y * b) / t));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (x + (y * (z / t))) / a tmp = 0 if a <= -6800.0: tmp = t_1 elif a <= 1.1e-133: tmp = x + (z * (y / t)) elif a <= 5.6e-109: tmp = z / b elif a <= 57000.0: tmp = x / (1.0 + ((y * b) / t)) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(x + Float64(y * Float64(z / t))) / a) tmp = 0.0 if (a <= -6800.0) tmp = t_1; elseif (a <= 1.1e-133) tmp = Float64(x + Float64(z * Float64(y / t))); elseif (a <= 5.6e-109) tmp = Float64(z / b); elseif (a <= 57000.0) tmp = Float64(x / Float64(1.0 + Float64(Float64(y * b) / t))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (x + (y * (z / t))) / a; tmp = 0.0; if (a <= -6800.0) tmp = t_1; elseif (a <= 1.1e-133) tmp = x + (z * (y / t)); elseif (a <= 5.6e-109) tmp = z / b; elseif (a <= 57000.0) tmp = x / (1.0 + ((y * b) / t)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(x + N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]}, If[LessEqual[a, -6800.0], t$95$1, If[LessEqual[a, 1.1e-133], N[(x + N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 5.6e-109], N[(z / b), $MachinePrecision], If[LessEqual[a, 57000.0], N[(x / N[(1.0 + N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x + y \cdot \frac{z}{t}}{a}\\
\mathbf{if}\;a \leq -6800:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \leq 1.1 \cdot 10^{-133}:\\
\;\;\;\;x + z \cdot \frac{y}{t}\\
\mathbf{elif}\;a \leq 5.6 \cdot 10^{-109}:\\
\;\;\;\;\frac{z}{b}\\
\mathbf{elif}\;a \leq 57000:\\
\;\;\;\;\frac{x}{1 + \frac{y \cdot b}{t}}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if a < -6800 or 57000 < a Initial program 76.2%
*-commutative76.2%
associate-*l/77.0%
*-commutative77.0%
associate-*l/76.1%
Simplified76.1%
Taylor expanded in x around 0 79.0%
+-commutative79.0%
times-frac80.5%
fma-def80.5%
associate-+r+80.5%
associate-/l*83.0%
+-commutative83.0%
associate-/l*80.5%
associate-*r/83.0%
fma-def83.0%
associate-+r+83.0%
associate-/l*84.7%
+-commutative84.7%
associate-/l*83.0%
associate-*r/84.7%
fma-def84.7%
Simplified84.7%
Taylor expanded in a around inf 65.7%
associate-*r/66.8%
Simplified66.8%
if -6800 < a < 1.1e-133Initial program 79.1%
*-commutative79.1%
associate-*l/76.4%
*-commutative76.4%
associate-*l/75.6%
Simplified75.6%
Taylor expanded in a around 0 79.1%
clear-num79.0%
inv-pow79.0%
Applied egg-rr79.0%
unpow-179.0%
Simplified79.0%
Taylor expanded in b around 0 59.5%
associate-/l*60.1%
associate-/r/64.4%
Simplified64.4%
if 1.1e-133 < a < 5.59999999999999958e-109Initial program 64.2%
*-commutative64.2%
associate-*l/64.3%
*-commutative64.3%
associate-*l/64.7%
Simplified64.7%
Taylor expanded in t around 0 73.5%
if 5.59999999999999958e-109 < a < 57000Initial program 82.7%
*-commutative82.7%
associate-*l/82.8%
*-commutative82.8%
associate-*l/82.8%
Simplified82.8%
Taylor expanded in a around 0 80.7%
clear-num80.8%
inv-pow80.8%
Applied egg-rr80.8%
unpow-180.8%
Simplified80.8%
Taylor expanded in x around inf 62.6%
Final simplification65.7%
(FPCore (x y z t a b)
:precision binary64
(if (<= a -6800.0)
(/ (+ x (* y (/ z t))) a)
(if (<= a 1.65e-135)
(+ x (* z (/ y t)))
(if (<= a 3.2e-109)
(/ z b)
(if (<= a 155.0)
(/ x (+ 1.0 (/ (* y b) t)))
(/ (+ x (/ (* y z) t)) a))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -6800.0) {
tmp = (x + (y * (z / t))) / a;
} else if (a <= 1.65e-135) {
tmp = x + (z * (y / t));
} else if (a <= 3.2e-109) {
tmp = z / b;
} else if (a <= 155.0) {
tmp = x / (1.0 + ((y * b) / t));
} else {
tmp = (x + ((y * z) / t)) / a;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (a <= (-6800.0d0)) then
tmp = (x + (y * (z / t))) / a
else if (a <= 1.65d-135) then
tmp = x + (z * (y / t))
else if (a <= 3.2d-109) then
tmp = z / b
else if (a <= 155.0d0) then
tmp = x / (1.0d0 + ((y * b) / t))
else
tmp = (x + ((y * z) / t)) / a
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -6800.0) {
tmp = (x + (y * (z / t))) / a;
} else if (a <= 1.65e-135) {
tmp = x + (z * (y / t));
} else if (a <= 3.2e-109) {
tmp = z / b;
} else if (a <= 155.0) {
tmp = x / (1.0 + ((y * b) / t));
} else {
tmp = (x + ((y * z) / t)) / a;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if a <= -6800.0: tmp = (x + (y * (z / t))) / a elif a <= 1.65e-135: tmp = x + (z * (y / t)) elif a <= 3.2e-109: tmp = z / b elif a <= 155.0: tmp = x / (1.0 + ((y * b) / t)) else: tmp = (x + ((y * z) / t)) / a return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (a <= -6800.0) tmp = Float64(Float64(x + Float64(y * Float64(z / t))) / a); elseif (a <= 1.65e-135) tmp = Float64(x + Float64(z * Float64(y / t))); elseif (a <= 3.2e-109) tmp = Float64(z / b); elseif (a <= 155.0) tmp = Float64(x / Float64(1.0 + Float64(Float64(y * b) / t))); else tmp = Float64(Float64(x + Float64(Float64(y * z) / t)) / a); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (a <= -6800.0) tmp = (x + (y * (z / t))) / a; elseif (a <= 1.65e-135) tmp = x + (z * (y / t)); elseif (a <= 3.2e-109) tmp = z / b; elseif (a <= 155.0) tmp = x / (1.0 + ((y * b) / t)); else tmp = (x + ((y * z) / t)) / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, -6800.0], N[(N[(x + N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision], If[LessEqual[a, 1.65e-135], N[(x + N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 3.2e-109], N[(z / b), $MachinePrecision], If[LessEqual[a, 155.0], N[(x / N[(1.0 + N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -6800:\\
\;\;\;\;\frac{x + y \cdot \frac{z}{t}}{a}\\
\mathbf{elif}\;a \leq 1.65 \cdot 10^{-135}:\\
\;\;\;\;x + z \cdot \frac{y}{t}\\
\mathbf{elif}\;a \leq 3.2 \cdot 10^{-109}:\\
\;\;\;\;\frac{z}{b}\\
\mathbf{elif}\;a \leq 155:\\
\;\;\;\;\frac{x}{1 + \frac{y \cdot b}{t}}\\
\mathbf{else}:\\
\;\;\;\;\frac{x + \frac{y \cdot z}{t}}{a}\\
\end{array}
\end{array}
if a < -6800Initial program 80.4%
*-commutative80.4%
associate-*l/83.8%
*-commutative83.8%
associate-*l/83.9%
Simplified83.9%
Taylor expanded in x around 0 82.1%
+-commutative82.1%
times-frac87.3%
fma-def87.3%
associate-+r+87.3%
associate-/l*92.5%
+-commutative92.5%
associate-/l*87.3%
associate-*r/92.5%
fma-def92.5%
associate-+r+92.5%
associate-/l*92.5%
+-commutative92.5%
associate-/l*92.5%
associate-*r/92.5%
fma-def92.5%
Simplified92.5%
Taylor expanded in a around inf 69.7%
associate-*r/72.0%
Simplified72.0%
if -6800 < a < 1.65e-135Initial program 79.1%
*-commutative79.1%
associate-*l/76.4%
*-commutative76.4%
associate-*l/75.6%
Simplified75.6%
Taylor expanded in a around 0 79.1%
clear-num79.0%
inv-pow79.0%
Applied egg-rr79.0%
unpow-179.0%
Simplified79.0%
Taylor expanded in b around 0 59.5%
associate-/l*60.1%
associate-/r/64.4%
Simplified64.4%
if 1.65e-135 < a < 3.2000000000000002e-109Initial program 64.2%
*-commutative64.2%
associate-*l/64.3%
*-commutative64.3%
associate-*l/64.7%
Simplified64.7%
Taylor expanded in t around 0 73.5%
if 3.2000000000000002e-109 < a < 155Initial program 82.7%
*-commutative82.7%
associate-*l/82.8%
*-commutative82.8%
associate-*l/82.8%
Simplified82.8%
Taylor expanded in a around 0 80.7%
clear-num80.8%
inv-pow80.8%
Applied egg-rr80.8%
unpow-180.8%
Simplified80.8%
Taylor expanded in x around inf 62.6%
if 155 < a Initial program 72.2%
*-commutative72.2%
associate-*l/70.5%
*-commutative70.5%
associate-*l/68.7%
Simplified68.7%
Taylor expanded in a around inf 61.8%
Final simplification65.7%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (+ z (/ t (/ y x))) b)))
(if (<= y -3.9e+66)
t_1
(if (<= y -5.2e-100)
(/ x (+ 1.0 (+ a (/ (* y b) t))))
(if (<= y 4.6e+171) (/ (+ x (/ (* y z) t)) (+ a 1.0)) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (z + (t / (y / x))) / b;
double tmp;
if (y <= -3.9e+66) {
tmp = t_1;
} else if (y <= -5.2e-100) {
tmp = x / (1.0 + (a + ((y * b) / t)));
} else if (y <= 4.6e+171) {
tmp = (x + ((y * z) / t)) / (a + 1.0);
} 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 = (z + (t / (y / x))) / b
if (y <= (-3.9d+66)) then
tmp = t_1
else if (y <= (-5.2d-100)) then
tmp = x / (1.0d0 + (a + ((y * b) / t)))
else if (y <= 4.6d+171) then
tmp = (x + ((y * z) / t)) / (a + 1.0d0)
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 = (z + (t / (y / x))) / b;
double tmp;
if (y <= -3.9e+66) {
tmp = t_1;
} else if (y <= -5.2e-100) {
tmp = x / (1.0 + (a + ((y * b) / t)));
} else if (y <= 4.6e+171) {
tmp = (x + ((y * z) / t)) / (a + 1.0);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (z + (t / (y / x))) / b tmp = 0 if y <= -3.9e+66: tmp = t_1 elif y <= -5.2e-100: tmp = x / (1.0 + (a + ((y * b) / t))) elif y <= 4.6e+171: tmp = (x + ((y * z) / t)) / (a + 1.0) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(z + Float64(t / Float64(y / x))) / b) tmp = 0.0 if (y <= -3.9e+66) tmp = t_1; elseif (y <= -5.2e-100) tmp = Float64(x / Float64(1.0 + Float64(a + Float64(Float64(y * b) / t)))); elseif (y <= 4.6e+171) tmp = Float64(Float64(x + Float64(Float64(y * z) / t)) / Float64(a + 1.0)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (z + (t / (y / x))) / b; tmp = 0.0; if (y <= -3.9e+66) tmp = t_1; elseif (y <= -5.2e-100) tmp = x / (1.0 + (a + ((y * b) / t))); elseif (y <= 4.6e+171) tmp = (x + ((y * z) / t)) / (a + 1.0); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(z + N[(t / N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / b), $MachinePrecision]}, If[LessEqual[y, -3.9e+66], t$95$1, If[LessEqual[y, -5.2e-100], N[(x / N[(1.0 + N[(a + N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4.6e+171], N[(N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] / N[(a + 1.0), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{z + \frac{t}{\frac{y}{x}}}{b}\\
\mathbf{if}\;y \leq -3.9 \cdot 10^{+66}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq -5.2 \cdot 10^{-100}:\\
\;\;\;\;\frac{x}{1 + \left(a + \frac{y \cdot b}{t}\right)}\\
\mathbf{elif}\;y \leq 4.6 \cdot 10^{+171}:\\
\;\;\;\;\frac{x + \frac{y \cdot z}{t}}{a + 1}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if y < -3.9000000000000004e66 or 4.60000000000000035e171 < y Initial program 35.4%
*-commutative35.4%
associate-*l/45.3%
*-commutative45.3%
associate-*l/51.2%
Simplified51.2%
Taylor expanded in x around 0 44.5%
+-commutative44.5%
times-frac41.9%
fma-def41.9%
associate-+r+41.9%
associate-/l*50.0%
+-commutative50.0%
associate-/l*41.9%
associate-*r/50.0%
fma-def50.0%
associate-+r+50.0%
associate-/l*52.9%
+-commutative52.9%
associate-/l*50.0%
associate-*r/52.9%
fma-def52.9%
Simplified52.9%
Taylor expanded in b around inf 67.6%
associate-/l*70.7%
Simplified70.7%
if -3.9000000000000004e66 < y < -5.1999999999999997e-100Initial program 82.9%
*-commutative82.9%
associate-*l/89.7%
*-commutative89.7%
associate-*l/89.7%
Simplified89.7%
Taylor expanded in x around inf 76.0%
if -5.1999999999999997e-100 < y < 4.60000000000000035e171Initial program 94.5%
*-commutative94.5%
associate-*l/87.8%
*-commutative87.8%
associate-*l/84.2%
Simplified84.2%
Taylor expanded in b around 0 78.7%
Final simplification76.3%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -2.4e+68) (not (<= y 2.1e+180))) (/ (+ z (/ t (/ y x))) b) (/ x (+ 1.0 (+ a (/ (* y b) t))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -2.4e+68) || !(y <= 2.1e+180)) {
tmp = (z + (t / (y / x))) / b;
} else {
tmp = x / (1.0 + (a + ((y * b) / t)));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((y <= (-2.4d+68)) .or. (.not. (y <= 2.1d+180))) then
tmp = (z + (t / (y / x))) / b
else
tmp = x / (1.0d0 + (a + ((y * b) / t)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -2.4e+68) || !(y <= 2.1e+180)) {
tmp = (z + (t / (y / x))) / b;
} else {
tmp = x / (1.0 + (a + ((y * b) / t)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -2.4e+68) or not (y <= 2.1e+180): tmp = (z + (t / (y / x))) / b else: tmp = x / (1.0 + (a + ((y * b) / t))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -2.4e+68) || !(y <= 2.1e+180)) tmp = Float64(Float64(z + Float64(t / Float64(y / x))) / b); else tmp = Float64(x / Float64(1.0 + Float64(a + Float64(Float64(y * b) / t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -2.4e+68) || ~((y <= 2.1e+180))) tmp = (z + (t / (y / x))) / b; else tmp = x / (1.0 + (a + ((y * b) / t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -2.4e+68], N[Not[LessEqual[y, 2.1e+180]], $MachinePrecision]], N[(N[(z + N[(t / N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / b), $MachinePrecision], N[(x / N[(1.0 + N[(a + N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.4 \cdot 10^{+68} \lor \neg \left(y \leq 2.1 \cdot 10^{+180}\right):\\
\;\;\;\;\frac{z + \frac{t}{\frac{y}{x}}}{b}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{1 + \left(a + \frac{y \cdot b}{t}\right)}\\
\end{array}
\end{array}
if y < -2.40000000000000008e68 or 2.1e180 < y Initial program 33.5%
*-commutative33.5%
associate-*l/43.7%
*-commutative43.7%
associate-*l/49.7%
Simplified49.7%
Taylor expanded in x around 0 44.3%
+-commutative44.3%
times-frac40.1%
fma-def40.1%
associate-+r+40.1%
associate-/l*48.5%
+-commutative48.5%
associate-/l*40.1%
associate-*r/48.5%
fma-def48.5%
associate-+r+48.5%
associate-/l*51.5%
+-commutative51.5%
associate-/l*48.5%
associate-*r/51.5%
fma-def51.5%
Simplified51.5%
Taylor expanded in b around inf 68.1%
associate-/l*71.3%
Simplified71.3%
if -2.40000000000000008e68 < y < 2.1e180Initial program 92.9%
*-commutative92.9%
associate-*l/88.2%
*-commutative88.2%
associate-*l/85.1%
Simplified85.1%
Taylor expanded in x around inf 67.7%
Final simplification68.6%
(FPCore (x y z t a b)
:precision binary64
(if (<= a -8.6e-12)
(/ x a)
(if (<= a 1.3e-134)
x
(if (<= a 2.25e-54)
(/ z b)
(if (<= a 1.05e-9) x (if (<= a 2.4e+67) (/ z b) (/ x a)))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -8.6e-12) {
tmp = x / a;
} else if (a <= 1.3e-134) {
tmp = x;
} else if (a <= 2.25e-54) {
tmp = z / b;
} else if (a <= 1.05e-9) {
tmp = x;
} else if (a <= 2.4e+67) {
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 (a <= (-8.6d-12)) then
tmp = x / a
else if (a <= 1.3d-134) then
tmp = x
else if (a <= 2.25d-54) then
tmp = z / b
else if (a <= 1.05d-9) then
tmp = x
else if (a <= 2.4d+67) 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 (a <= -8.6e-12) {
tmp = x / a;
} else if (a <= 1.3e-134) {
tmp = x;
} else if (a <= 2.25e-54) {
tmp = z / b;
} else if (a <= 1.05e-9) {
tmp = x;
} else if (a <= 2.4e+67) {
tmp = z / b;
} else {
tmp = x / a;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if a <= -8.6e-12: tmp = x / a elif a <= 1.3e-134: tmp = x elif a <= 2.25e-54: tmp = z / b elif a <= 1.05e-9: tmp = x elif a <= 2.4e+67: tmp = z / b else: tmp = x / a return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (a <= -8.6e-12) tmp = Float64(x / a); elseif (a <= 1.3e-134) tmp = x; elseif (a <= 2.25e-54) tmp = Float64(z / b); elseif (a <= 1.05e-9) tmp = x; elseif (a <= 2.4e+67) 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 (a <= -8.6e-12) tmp = x / a; elseif (a <= 1.3e-134) tmp = x; elseif (a <= 2.25e-54) tmp = z / b; elseif (a <= 1.05e-9) tmp = x; elseif (a <= 2.4e+67) tmp = z / b; else tmp = x / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, -8.6e-12], N[(x / a), $MachinePrecision], If[LessEqual[a, 1.3e-134], x, If[LessEqual[a, 2.25e-54], N[(z / b), $MachinePrecision], If[LessEqual[a, 1.05e-9], x, If[LessEqual[a, 2.4e+67], N[(z / b), $MachinePrecision], N[(x / a), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -8.6 \cdot 10^{-12}:\\
\;\;\;\;\frac{x}{a}\\
\mathbf{elif}\;a \leq 1.3 \cdot 10^{-134}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 2.25 \cdot 10^{-54}:\\
\;\;\;\;\frac{z}{b}\\
\mathbf{elif}\;a \leq 1.05 \cdot 10^{-9}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 2.4 \cdot 10^{+67}:\\
\;\;\;\;\frac{z}{b}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{a}\\
\end{array}
\end{array}
if a < -8.59999999999999971e-12 or 2.40000000000000002e67 < a Initial program 76.2%
*-commutative76.2%
associate-*l/77.1%
*-commutative77.1%
associate-*l/76.2%
Simplified76.2%
Taylor expanded in t around inf 51.6%
Taylor expanded in a around inf 51.1%
if -8.59999999999999971e-12 < a < 1.30000000000000011e-134 or 2.2499999999999999e-54 < a < 1.0500000000000001e-9Initial program 80.1%
*-commutative80.1%
associate-*l/77.5%
*-commutative77.5%
associate-*l/76.8%
Simplified76.8%
Taylor expanded in a around 0 79.9%
Taylor expanded in y around 0 46.4%
if 1.30000000000000011e-134 < a < 2.2499999999999999e-54 or 1.0500000000000001e-9 < a < 2.40000000000000002e67Initial program 72.5%
*-commutative72.5%
associate-*l/72.6%
*-commutative72.6%
associate-*l/72.7%
Simplified72.7%
Taylor expanded in t around 0 55.4%
Final simplification49.5%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -9e+52) (not (<= y 7.5e+171))) (/ z b) (/ x (+ a 1.0))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -9e+52) || !(y <= 7.5e+171)) {
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 <= (-9d+52)) .or. (.not. (y <= 7.5d+171))) 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 <= -9e+52) || !(y <= 7.5e+171)) {
tmp = z / b;
} else {
tmp = x / (a + 1.0);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -9e+52) or not (y <= 7.5e+171): tmp = z / b else: tmp = x / (a + 1.0) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -9e+52) || !(y <= 7.5e+171)) 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 <= -9e+52) || ~((y <= 7.5e+171))) 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, -9e+52], N[Not[LessEqual[y, 7.5e+171]], $MachinePrecision]], N[(z / b), $MachinePrecision], N[(x / N[(a + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -9 \cdot 10^{+52} \lor \neg \left(y \leq 7.5 \cdot 10^{+171}\right):\\
\;\;\;\;\frac{z}{b}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{a + 1}\\
\end{array}
\end{array}
if y < -8.9999999999999999e52 or 7.4999999999999998e171 < y Initial program 37.3%
*-commutative37.3%
associate-*l/46.9%
*-commutative46.9%
associate-*l/52.6%
Simplified52.6%
Taylor expanded in t around 0 58.0%
if -8.9999999999999999e52 < y < 7.4999999999999998e171Initial program 92.7%
*-commutative92.7%
associate-*l/87.9%
*-commutative87.9%
associate-*l/84.8%
Simplified84.8%
Taylor expanded in t around inf 57.2%
Final simplification57.4%
(FPCore (x y z t a b) :precision binary64 (if (or (<= a -8.6e-12) (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 <= -8.6e-12) || !(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 <= (-8.6d-12)) .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 <= -8.6e-12) || !(a <= 1.0)) {
tmp = x / a;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (a <= -8.6e-12) 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 <= -8.6e-12) || !(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 <= -8.6e-12) || ~((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, -8.6e-12], N[Not[LessEqual[a, 1.0]], $MachinePrecision]], N[(x / a), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -8.6 \cdot 10^{-12} \lor \neg \left(a \leq 1\right):\\
\;\;\;\;\frac{x}{a}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < -8.59999999999999971e-12 or 1 < a Initial program 76.0%
*-commutative76.0%
associate-*l/76.8%
*-commutative76.8%
associate-*l/75.1%
Simplified75.1%
Taylor expanded in t around inf 50.4%
Taylor expanded in a around inf 49.3%
if -8.59999999999999971e-12 < a < 1Initial program 78.8%
*-commutative78.8%
associate-*l/76.7%
*-commutative76.7%
associate-*l/76.8%
Simplified76.8%
Taylor expanded in a around 0 78.5%
Taylor expanded in y around 0 41.6%
Final simplification45.0%
(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 77.6%
*-commutative77.6%
associate-*l/76.7%
*-commutative76.7%
associate-*l/76.0%
Simplified76.0%
Taylor expanded in a around 0 52.1%
Taylor expanded in y around 0 25.0%
Final simplification25.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 2024011
(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))))