
(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)) (+ (+ a 1.0) (/ (* y b) t))))
(t_2
(/
1.0
(+ (/ b z) (* (/ t y) (- (/ (+ a 1.0) z) (/ (* x b) (* z z))))))))
(if (<= t_1 (- INFINITY))
t_2
(if (<= t_1 -5e-280)
t_1
(if (<= t_1 0.0)
(/ (+ z (/ t (/ y x))) b)
(if (<= t_1 2e+299) t_1 (if (<= t_1 INFINITY) t_2 (/ 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 = 1.0 / ((b / z) + ((t / y) * (((a + 1.0) / z) - ((x * b) / (z * z)))));
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = t_2;
} else if (t_1 <= -5e-280) {
tmp = t_1;
} else if (t_1 <= 0.0) {
tmp = (z + (t / (y / x))) / b;
} else if (t_1 <= 2e+299) {
tmp = t_1;
} else if (t_1 <= ((double) INFINITY)) {
tmp = t_2;
} 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 = 1.0 / ((b / z) + ((t / y) * (((a + 1.0) / z) - ((x * b) / (z * z)))));
double tmp;
if (t_1 <= -Double.POSITIVE_INFINITY) {
tmp = t_2;
} else if (t_1 <= -5e-280) {
tmp = t_1;
} else if (t_1 <= 0.0) {
tmp = (z + (t / (y / x))) / b;
} else if (t_1 <= 2e+299) {
tmp = t_1;
} else if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = t_2;
} 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 = 1.0 / ((b / z) + ((t / y) * (((a + 1.0) / z) - ((x * b) / (z * z))))) tmp = 0 if t_1 <= -math.inf: tmp = t_2 elif t_1 <= -5e-280: tmp = t_1 elif t_1 <= 0.0: tmp = (z + (t / (y / x))) / b elif t_1 <= 2e+299: tmp = t_1 elif t_1 <= math.inf: tmp = t_2 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(1.0 / Float64(Float64(b / z) + Float64(Float64(t / y) * Float64(Float64(Float64(a + 1.0) / z) - Float64(Float64(x * b) / Float64(z * z)))))) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = t_2; elseif (t_1 <= -5e-280) tmp = t_1; elseif (t_1 <= 0.0) tmp = Float64(Float64(z + Float64(t / Float64(y / x))) / b); elseif (t_1 <= 2e+299) tmp = t_1; elseif (t_1 <= Inf) tmp = t_2; 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 = 1.0 / ((b / z) + ((t / y) * (((a + 1.0) / z) - ((x * b) / (z * z))))); tmp = 0.0; if (t_1 <= -Inf) tmp = t_2; elseif (t_1 <= -5e-280) tmp = t_1; elseif (t_1 <= 0.0) tmp = (z + (t / (y / x))) / b; elseif (t_1 <= 2e+299) tmp = t_1; elseif (t_1 <= Inf) tmp = t_2; 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[(1.0 / N[(N[(b / z), $MachinePrecision] + N[(N[(t / y), $MachinePrecision] * N[(N[(N[(a + 1.0), $MachinePrecision] / z), $MachinePrecision] - N[(N[(x * b), $MachinePrecision] / N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], t$95$2, If[LessEqual[t$95$1, -5e-280], t$95$1, If[LessEqual[t$95$1, 0.0], N[(N[(z + N[(t / N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / b), $MachinePrecision], If[LessEqual[t$95$1, 2e+299], t$95$1, If[LessEqual[t$95$1, Infinity], t$95$2, 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 := \frac{1}{\frac{b}{z} + \frac{t}{y} \cdot \left(\frac{a + 1}{z} - \frac{x \cdot b}{z \cdot z}\right)}\\
\mathbf{if}\;t_1 \leq -\infty:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t_1 \leq -5 \cdot 10^{-280}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t_1 \leq 0:\\
\;\;\;\;\frac{z + \frac{t}{\frac{y}{x}}}{b}\\
\mathbf{elif}\;t_1 \leq 2 \cdot 10^{+299}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t_1 \leq \infty:\\
\;\;\;\;t_2\\
\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.0 or 2.0000000000000001e299 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < +inf.0Initial program 26.7%
+-commutative26.7%
associate-*l/58.4%
fma-def58.4%
associate-+l+58.4%
+-commutative58.4%
associate-*l/50.5%
fma-def50.5%
Simplified50.5%
clear-num50.5%
inv-pow50.5%
fma-udef50.5%
associate-/r/58.4%
div-inv58.4%
clear-num58.4%
fma-udef58.4%
Applied egg-rr58.4%
unpow-158.4%
fma-def58.4%
*-commutative58.4%
associate-*r/26.7%
associate-*l/58.5%
fma-udef58.5%
Simplified58.5%
Taylor expanded in y around inf 55.6%
associate--l+55.6%
times-frac81.1%
times-frac88.5%
distribute-lft-out--95.9%
unpow295.9%
Simplified95.9%
if -inf.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < -5.00000000000000028e-280 or 0.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < 2.0000000000000001e299Initial program 99.2%
if -5.00000000000000028e-280 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < 0.0Initial program 50.1%
+-commutative50.1%
associate-*l/37.9%
fma-def37.9%
associate-+l+37.9%
+-commutative37.9%
associate-*l/57.8%
fma-def57.8%
Simplified57.8%
Taylor expanded in y around inf 53.0%
associate--l+53.0%
associate-/l*53.4%
times-frac53.5%
unpow253.5%
Simplified53.5%
Taylor expanded in a around 0 53.7%
unpow253.7%
associate-*r*53.7%
Simplified53.7%
Taylor expanded in b around inf 59.6%
+-commutative59.6%
associate-/l*75.4%
Simplified75.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%
fma-def0.3%
associate-+l+0.3%
+-commutative0.3%
associate-*l/10.3%
fma-def10.3%
Simplified10.3%
Taylor expanded in y around inf 96.7%
Final simplification94.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))
(/ y (/ (* t (+ a (+ 1.0 (* b (/ y t))))) z))
(if (<= t_1 -5e-280)
t_1
(if (<= t_1 0.0)
(/ (+ z (/ t (/ y x))) b)
(if (<= t_1 2e+299) t_1 (/ z b)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t));
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = y / ((t * (a + (1.0 + (b * (y / t))))) / z);
} else if (t_1 <= -5e-280) {
tmp = t_1;
} else if (t_1 <= 0.0) {
tmp = (z + (t / (y / x))) / b;
} else if (t_1 <= 2e+299) {
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 = y / ((t * (a + (1.0 + (b * (y / t))))) / z);
} else if (t_1 <= -5e-280) {
tmp = t_1;
} else if (t_1 <= 0.0) {
tmp = (z + (t / (y / x))) / b;
} else if (t_1 <= 2e+299) {
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 = y / ((t * (a + (1.0 + (b * (y / t))))) / z) elif t_1 <= -5e-280: tmp = t_1 elif t_1 <= 0.0: tmp = (z + (t / (y / x))) / b elif t_1 <= 2e+299: tmp = t_1 else: tmp = z / b return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(x + Float64(Float64(y * z) / t)) / Float64(Float64(a + 1.0) + Float64(Float64(y * b) / t))) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = Float64(y / Float64(Float64(t * Float64(a + Float64(1.0 + Float64(b * Float64(y / t))))) / z)); elseif (t_1 <= -5e-280) tmp = t_1; elseif (t_1 <= 0.0) tmp = Float64(Float64(z + Float64(t / Float64(y / x))) / b); elseif (t_1 <= 2e+299) 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 = y / ((t * (a + (1.0 + (b * (y / t))))) / z); elseif (t_1 <= -5e-280) tmp = t_1; elseif (t_1 <= 0.0) tmp = (z + (t / (y / x))) / b; elseif (t_1 <= 2e+299) 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[(y / N[(N[(t * N[(a + N[(1.0 + N[(b * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, -5e-280], t$95$1, If[LessEqual[t$95$1, 0.0], N[(N[(z + N[(t / N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / b), $MachinePrecision], If[LessEqual[t$95$1, 2e+299], t$95$1, N[(z / b), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}}\\
\mathbf{if}\;t_1 \leq -\infty:\\
\;\;\;\;\frac{y}{\frac{t \cdot \left(a + \left(1 + b \cdot \frac{y}{t}\right)\right)}{z}}\\
\mathbf{elif}\;t_1 \leq -5 \cdot 10^{-280}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t_1 \leq 0:\\
\;\;\;\;\frac{z + \frac{t}{\frac{y}{x}}}{b}\\
\mathbf{elif}\;t_1 \leq 2 \cdot 10^{+299}:\\
\;\;\;\;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 17.4%
*-commutative17.4%
associate-/l*50.9%
associate-*l/44.2%
Simplified44.2%
associate-/r/44.2%
Applied egg-rr44.2%
Taylor expanded in x around 0 55.5%
associate-/l*88.8%
+-commutative88.8%
associate-/l*88.9%
+-commutative88.9%
associate-+r+88.9%
+-commutative88.9%
associate-/r/71.3%
*-commutative71.3%
Simplified71.3%
if -inf.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < -5.00000000000000028e-280 or 0.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < 2.0000000000000001e299Initial program 99.2%
if -5.00000000000000028e-280 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < 0.0Initial program 50.1%
+-commutative50.1%
associate-*l/37.9%
fma-def37.9%
associate-+l+37.9%
+-commutative37.9%
associate-*l/57.8%
fma-def57.8%
Simplified57.8%
Taylor expanded in y around inf 53.0%
associate--l+53.0%
associate-/l*53.4%
times-frac53.5%
unpow253.5%
Simplified53.5%
Taylor expanded in a around 0 53.7%
unpow253.7%
associate-*r*53.7%
Simplified53.7%
Taylor expanded in b around inf 59.6%
+-commutative59.6%
associate-/l*75.4%
Simplified75.4%
if 2.0000000000000001e299 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) Initial program 10.9%
+-commutative10.9%
associate-*l/18.5%
fma-def18.5%
associate-+l+18.5%
+-commutative18.5%
associate-*l/23.3%
fma-def23.3%
Simplified23.3%
Taylor expanded in y around inf 84.9%
Final simplification91.1%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (+ z (/ t (/ y x))) b))
(t_2 (/ (+ x (* z (/ y t))) a))
(t_3 (+ x (/ (* y z) t))))
(if (<= a -2.1e+19)
t_2
(if (<= a -1.3e-279)
t_1
(if (<= a 9.6e-198)
t_3
(if (<= a 3.55e-44)
t_1
(if (<= a 1e-13) t_3 (if (<= a 5.5e+15) t_1 t_2))))))))
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 + (z * (y / t))) / a;
double t_3 = x + ((y * z) / t);
double tmp;
if (a <= -2.1e+19) {
tmp = t_2;
} else if (a <= -1.3e-279) {
tmp = t_1;
} else if (a <= 9.6e-198) {
tmp = t_3;
} else if (a <= 3.55e-44) {
tmp = t_1;
} else if (a <= 1e-13) {
tmp = t_3;
} else if (a <= 5.5e+15) {
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) :: t_3
real(8) :: tmp
t_1 = (z + (t / (y / x))) / b
t_2 = (x + (z * (y / t))) / a
t_3 = x + ((y * z) / t)
if (a <= (-2.1d+19)) then
tmp = t_2
else if (a <= (-1.3d-279)) then
tmp = t_1
else if (a <= 9.6d-198) then
tmp = t_3
else if (a <= 3.55d-44) then
tmp = t_1
else if (a <= 1d-13) then
tmp = t_3
else if (a <= 5.5d+15) 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 = (z + (t / (y / x))) / b;
double t_2 = (x + (z * (y / t))) / a;
double t_3 = x + ((y * z) / t);
double tmp;
if (a <= -2.1e+19) {
tmp = t_2;
} else if (a <= -1.3e-279) {
tmp = t_1;
} else if (a <= 9.6e-198) {
tmp = t_3;
} else if (a <= 3.55e-44) {
tmp = t_1;
} else if (a <= 1e-13) {
tmp = t_3;
} else if (a <= 5.5e+15) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (z + (t / (y / x))) / b t_2 = (x + (z * (y / t))) / a t_3 = x + ((y * z) / t) tmp = 0 if a <= -2.1e+19: tmp = t_2 elif a <= -1.3e-279: tmp = t_1 elif a <= 9.6e-198: tmp = t_3 elif a <= 3.55e-44: tmp = t_1 elif a <= 1e-13: tmp = t_3 elif a <= 5.5e+15: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(z + Float64(t / Float64(y / x))) / b) t_2 = Float64(Float64(x + Float64(z * Float64(y / t))) / a) t_3 = Float64(x + Float64(Float64(y * z) / t)) tmp = 0.0 if (a <= -2.1e+19) tmp = t_2; elseif (a <= -1.3e-279) tmp = t_1; elseif (a <= 9.6e-198) tmp = t_3; elseif (a <= 3.55e-44) tmp = t_1; elseif (a <= 1e-13) tmp = t_3; elseif (a <= 5.5e+15) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (z + (t / (y / x))) / b; t_2 = (x + (z * (y / t))) / a; t_3 = x + ((y * z) / t); tmp = 0.0; if (a <= -2.1e+19) tmp = t_2; elseif (a <= -1.3e-279) tmp = t_1; elseif (a <= 9.6e-198) tmp = t_3; elseif (a <= 3.55e-44) tmp = t_1; elseif (a <= 1e-13) tmp = t_3; elseif (a <= 5.5e+15) 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[(z + N[(t / N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / b), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x + N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]}, Block[{t$95$3 = N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -2.1e+19], t$95$2, If[LessEqual[a, -1.3e-279], t$95$1, If[LessEqual[a, 9.6e-198], t$95$3, If[LessEqual[a, 3.55e-44], t$95$1, If[LessEqual[a, 1e-13], t$95$3, If[LessEqual[a, 5.5e+15], t$95$1, t$95$2]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{z + \frac{t}{\frac{y}{x}}}{b}\\
t_2 := \frac{x + z \cdot \frac{y}{t}}{a}\\
t_3 := x + \frac{y \cdot z}{t}\\
\mathbf{if}\;a \leq -2.1 \cdot 10^{+19}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;a \leq -1.3 \cdot 10^{-279}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \leq 9.6 \cdot 10^{-198}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;a \leq 3.55 \cdot 10^{-44}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \leq 10^{-13}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;a \leq 5.5 \cdot 10^{+15}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if a < -2.1e19 or 5.5e15 < a Initial program 73.2%
*-commutative73.2%
associate-/l*73.8%
associate-*l/76.2%
Simplified76.2%
div-inv75.3%
clear-num76.0%
Applied egg-rr76.0%
Taylor expanded in a around inf 68.2%
if -2.1e19 < a < -1.3000000000000001e-279 or 9.59999999999999946e-198 < a < 3.54999999999999983e-44 or 1e-13 < a < 5.5e15Initial program 63.1%
+-commutative63.1%
associate-*l/61.1%
fma-def61.1%
associate-+l+61.1%
+-commutative61.1%
associate-*l/67.4%
fma-def67.4%
Simplified67.4%
Taylor expanded in y around inf 48.6%
associate--l+48.6%
associate-/l*50.8%
times-frac48.8%
unpow248.8%
Simplified48.8%
Taylor expanded in a around 0 50.8%
unpow250.8%
associate-*r*54.6%
Simplified54.6%
Taylor expanded in b around inf 59.9%
+-commutative59.9%
associate-/l*64.8%
Simplified64.8%
if -1.3000000000000001e-279 < a < 9.59999999999999946e-198 or 3.54999999999999983e-44 < a < 1e-13Initial program 92.5%
*-commutative92.5%
associate-/l*84.8%
associate-*l/84.7%
Simplified84.7%
associate-/r/86.8%
Applied egg-rr86.8%
Taylor expanded in b around 0 75.7%
+-commutative75.7%
associate-/l*75.3%
Simplified75.3%
Taylor expanded in a around 0 75.4%
Final simplification67.9%
(FPCore (x y z t a b) :precision binary64 (if (or (<= t -6e-166) (not (<= t 2.8e-105))) (/ (+ x (* z (/ y t))) (+ (+ a 1.0) (* b (/ y t)))) (/ (+ z (/ (* x t) y)) b)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -6e-166) || !(t <= 2.8e-105)) {
tmp = (x + (z * (y / t))) / ((a + 1.0) + (b * (y / t)));
} 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 <= (-6d-166)) .or. (.not. (t <= 2.8d-105))) then
tmp = (x + (z * (y / t))) / ((a + 1.0d0) + (b * (y / t)))
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 <= -6e-166) || !(t <= 2.8e-105)) {
tmp = (x + (z * (y / t))) / ((a + 1.0) + (b * (y / t)));
} else {
tmp = (z + ((x * t) / y)) / b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (t <= -6e-166) or not (t <= 2.8e-105): tmp = (x + (z * (y / t))) / ((a + 1.0) + (b * (y / t))) else: tmp = (z + ((x * t) / y)) / b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((t <= -6e-166) || !(t <= 2.8e-105)) tmp = Float64(Float64(x + Float64(z * Float64(y / t))) / Float64(Float64(a + 1.0) + Float64(b * Float64(y / t)))); 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 <= -6e-166) || ~((t <= 2.8e-105))) tmp = (x + (z * (y / t))) / ((a + 1.0) + (b * (y / t))); else tmp = (z + ((x * t) / y)) / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[t, -6e-166], N[Not[LessEqual[t, 2.8e-105]], $MachinePrecision]], N[(N[(x + N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(a + 1.0), $MachinePrecision] + N[(b * N[(y / t), $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 -6 \cdot 10^{-166} \lor \neg \left(t \leq 2.8 \cdot 10^{-105}\right):\\
\;\;\;\;\frac{x + z \cdot \frac{y}{t}}{\left(a + 1\right) + b \cdot \frac{y}{t}}\\
\mathbf{else}:\\
\;\;\;\;\frac{z + \frac{x \cdot t}{y}}{b}\\
\end{array}
\end{array}
if t < -6.0000000000000005e-166 or 2.8e-105 < t Initial program 81.0%
*-commutative81.0%
associate-/l*82.1%
associate-*l/88.6%
Simplified88.6%
div-inv88.0%
clear-num88.7%
Applied egg-rr88.7%
if -6.0000000000000005e-166 < t < 2.8e-105Initial program 52.8%
+-commutative52.8%
associate-*l/45.2%
fma-def45.2%
associate-+l+45.2%
+-commutative45.2%
associate-*l/42.4%
fma-def42.4%
Simplified42.4%
Taylor expanded in y around inf 56.5%
associate--l+56.5%
associate-/l*54.6%
times-frac50.5%
unpow250.5%
Simplified50.5%
Taylor expanded in a around 0 62.0%
unpow262.0%
associate-*r*66.7%
Simplified66.7%
Taylor expanded in b around inf 75.1%
Final simplification84.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ (+ a 1.0) (* b (/ y t)))))
(if (<= t -1.06e-166)
(/ (+ x (* z (/ y t))) t_1)
(if (<= t 2.3e-105)
(/ (+ z (/ (* x t) y)) b)
(/ (+ x (* y (/ z t))) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (a + 1.0) + (b * (y / t));
double tmp;
if (t <= -1.06e-166) {
tmp = (x + (z * (y / t))) / t_1;
} else if (t <= 2.3e-105) {
tmp = (z + ((x * t) / y)) / b;
} else {
tmp = (x + (y * (z / t))) / 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 = (a + 1.0d0) + (b * (y / t))
if (t <= (-1.06d-166)) then
tmp = (x + (z * (y / t))) / t_1
else if (t <= 2.3d-105) then
tmp = (z + ((x * t) / y)) / b
else
tmp = (x + (y * (z / t))) / 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 = (a + 1.0) + (b * (y / t));
double tmp;
if (t <= -1.06e-166) {
tmp = (x + (z * (y / t))) / t_1;
} else if (t <= 2.3e-105) {
tmp = (z + ((x * t) / y)) / b;
} else {
tmp = (x + (y * (z / t))) / t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (a + 1.0) + (b * (y / t)) tmp = 0 if t <= -1.06e-166: tmp = (x + (z * (y / t))) / t_1 elif t <= 2.3e-105: tmp = (z + ((x * t) / y)) / b else: tmp = (x + (y * (z / t))) / t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(a + 1.0) + Float64(b * Float64(y / t))) tmp = 0.0 if (t <= -1.06e-166) tmp = Float64(Float64(x + Float64(z * Float64(y / t))) / t_1); elseif (t <= 2.3e-105) tmp = Float64(Float64(z + Float64(Float64(x * t) / y)) / b); else tmp = Float64(Float64(x + Float64(y * Float64(z / t))) / t_1); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (a + 1.0) + (b * (y / t)); tmp = 0.0; if (t <= -1.06e-166) tmp = (x + (z * (y / t))) / t_1; elseif (t <= 2.3e-105) tmp = (z + ((x * t) / y)) / b; else tmp = (x + (y * (z / t))) / t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(a + 1.0), $MachinePrecision] + N[(b * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -1.06e-166], N[(N[(x + N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision], If[LessEqual[t, 2.3e-105], N[(N[(z + N[(N[(x * t), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision] / b), $MachinePrecision], N[(N[(x + N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(a + 1\right) + b \cdot \frac{y}{t}\\
\mathbf{if}\;t \leq -1.06 \cdot 10^{-166}:\\
\;\;\;\;\frac{x + z \cdot \frac{y}{t}}{t_1}\\
\mathbf{elif}\;t \leq 2.3 \cdot 10^{-105}:\\
\;\;\;\;\frac{z + \frac{x \cdot t}{y}}{b}\\
\mathbf{else}:\\
\;\;\;\;\frac{x + y \cdot \frac{z}{t}}{t_1}\\
\end{array}
\end{array}
if t < -1.06e-166Initial program 82.3%
*-commutative82.3%
associate-/l*83.4%
associate-*l/86.3%
Simplified86.3%
div-inv86.4%
clear-num86.8%
Applied egg-rr86.8%
if -1.06e-166 < t < 2.3000000000000001e-105Initial program 52.8%
+-commutative52.8%
associate-*l/45.2%
fma-def45.2%
associate-+l+45.2%
+-commutative45.2%
associate-*l/42.4%
fma-def42.4%
Simplified42.4%
Taylor expanded in y around inf 56.5%
associate--l+56.5%
associate-/l*54.6%
times-frac50.5%
unpow250.5%
Simplified50.5%
Taylor expanded in a around 0 62.0%
unpow262.0%
associate-*r*66.7%
Simplified66.7%
Taylor expanded in b around inf 75.1%
if 2.3000000000000001e-105 < t Initial program 79.3%
*-commutative79.3%
associate-/l*80.5%
associate-*l/91.3%
Simplified91.3%
associate-/r/96.1%
Applied egg-rr96.1%
Final simplification86.0%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (+ z (/ t (/ y x))) b)))
(if (<= y -1.1e+123)
t_1
(if (<= y -8e+106)
(+ x (/ (* y z) t))
(if (or (<= y -3.3e+78) (not (<= y 4.1e+33)))
t_1
(/ x (+ 1.0 (+ a (/ (* y b) t)))))))))
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 <= -1.1e+123) {
tmp = t_1;
} else if (y <= -8e+106) {
tmp = x + ((y * z) / t);
} else if ((y <= -3.3e+78) || !(y <= 4.1e+33)) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = (z + (t / (y / x))) / b
if (y <= (-1.1d+123)) then
tmp = t_1
else if (y <= (-8d+106)) then
tmp = x + ((y * z) / t)
else if ((y <= (-3.3d+78)) .or. (.not. (y <= 4.1d+33))) then
tmp = t_1
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 t_1 = (z + (t / (y / x))) / b;
double tmp;
if (y <= -1.1e+123) {
tmp = t_1;
} else if (y <= -8e+106) {
tmp = x + ((y * z) / t);
} else if ((y <= -3.3e+78) || !(y <= 4.1e+33)) {
tmp = t_1;
} else {
tmp = x / (1.0 + (a + ((y * b) / t)));
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (z + (t / (y / x))) / b tmp = 0 if y <= -1.1e+123: tmp = t_1 elif y <= -8e+106: tmp = x + ((y * z) / t) elif (y <= -3.3e+78) or not (y <= 4.1e+33): tmp = t_1 else: tmp = x / (1.0 + (a + ((y * b) / t))) 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 <= -1.1e+123) tmp = t_1; elseif (y <= -8e+106) tmp = Float64(x + Float64(Float64(y * z) / t)); elseif ((y <= -3.3e+78) || !(y <= 4.1e+33)) tmp = t_1; 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) t_1 = (z + (t / (y / x))) / b; tmp = 0.0; if (y <= -1.1e+123) tmp = t_1; elseif (y <= -8e+106) tmp = x + ((y * z) / t); elseif ((y <= -3.3e+78) || ~((y <= 4.1e+33))) tmp = t_1; else tmp = x / (1.0 + (a + ((y * b) / t))); 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, -1.1e+123], t$95$1, If[LessEqual[y, -8e+106], N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[y, -3.3e+78], N[Not[LessEqual[y, 4.1e+33]], $MachinePrecision]], t$95$1, N[(x / N[(1.0 + N[(a + N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{z + \frac{t}{\frac{y}{x}}}{b}\\
\mathbf{if}\;y \leq -1.1 \cdot 10^{+123}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq -8 \cdot 10^{+106}:\\
\;\;\;\;x + \frac{y \cdot z}{t}\\
\mathbf{elif}\;y \leq -3.3 \cdot 10^{+78} \lor \neg \left(y \leq 4.1 \cdot 10^{+33}\right):\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{1 + \left(a + \frac{y \cdot b}{t}\right)}\\
\end{array}
\end{array}
if y < -1.09999999999999996e123 or -8.00000000000000073e106 < y < -3.3e78 or 4.09999999999999995e33 < y Initial program 45.1%
+-commutative45.1%
associate-*l/42.9%
fma-def42.9%
associate-+l+42.9%
+-commutative42.9%
associate-*l/50.5%
fma-def50.5%
Simplified50.5%
Taylor expanded in y around inf 47.0%
associate--l+47.0%
associate-/l*49.0%
times-frac46.4%
unpow246.4%
Simplified46.4%
Taylor expanded in a around 0 52.8%
unpow252.8%
associate-*r*56.3%
Simplified56.3%
Taylor expanded in b around inf 60.8%
+-commutative60.8%
associate-/l*70.7%
Simplified70.7%
if -1.09999999999999996e123 < y < -8.00000000000000073e106Initial program 99.5%
*-commutative99.5%
associate-/l*99.8%
associate-*l/99.8%
Simplified99.8%
associate-/r/99.8%
Applied egg-rr99.8%
Taylor expanded in b around 0 99.5%
+-commutative99.5%
associate-/l*100.0%
Simplified100.0%
Taylor expanded in a around 0 75.8%
if -3.3e78 < y < 4.09999999999999995e33Initial program 91.6%
+-commutative91.6%
associate-*l/90.4%
fma-def90.4%
associate-+l+90.4%
+-commutative90.4%
associate-*l/91.1%
fma-def91.1%
Simplified91.1%
Taylor expanded in z around 0 69.4%
Final simplification70.1%
(FPCore (x y z t a b) :precision binary64 (if (or (<= (+ a 1.0) -2e+20) (not (<= (+ a 1.0) 50000000000000.0))) (/ (+ x (* z (/ y t))) a) (/ x (+ 1.0 (/ (* y b) t)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (((a + 1.0) <= -2e+20) || !((a + 1.0) <= 50000000000000.0)) {
tmp = (x + (z * (y / t))) / a;
} else {
tmp = x / (1.0 + ((y * b) / t));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (((a + 1.0d0) <= (-2d+20)) .or. (.not. ((a + 1.0d0) <= 50000000000000.0d0))) then
tmp = (x + (z * (y / t))) / a
else
tmp = x / (1.0d0 + ((y * b) / t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (((a + 1.0) <= -2e+20) || !((a + 1.0) <= 50000000000000.0)) {
tmp = (x + (z * (y / t))) / a;
} else {
tmp = x / (1.0 + ((y * b) / t));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if ((a + 1.0) <= -2e+20) or not ((a + 1.0) <= 50000000000000.0): tmp = (x + (z * (y / t))) / a else: tmp = x / (1.0 + ((y * b) / t)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((Float64(a + 1.0) <= -2e+20) || !(Float64(a + 1.0) <= 50000000000000.0)) tmp = Float64(Float64(x + Float64(z * Float64(y / t))) / a); else tmp = Float64(x / Float64(1.0 + Float64(Float64(y * b) / t))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (((a + 1.0) <= -2e+20) || ~(((a + 1.0) <= 50000000000000.0))) tmp = (x + (z * (y / t))) / a; else tmp = x / (1.0 + ((y * b) / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[N[(a + 1.0), $MachinePrecision], -2e+20], N[Not[LessEqual[N[(a + 1.0), $MachinePrecision], 50000000000000.0]], $MachinePrecision]], N[(N[(x + N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision], N[(x / N[(1.0 + N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a + 1 \leq -2 \cdot 10^{+20} \lor \neg \left(a + 1 \leq 50000000000000\right):\\
\;\;\;\;\frac{x + z \cdot \frac{y}{t}}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{1 + \frac{y \cdot b}{t}}\\
\end{array}
\end{array}
if (+.f64 a 1) < -2e20 or 5e13 < (+.f64 a 1) Initial program 73.2%
*-commutative73.2%
associate-/l*73.8%
associate-*l/76.2%
Simplified76.2%
div-inv75.3%
clear-num76.0%
Applied egg-rr76.0%
Taylor expanded in a around inf 68.2%
if -2e20 < (+.f64 a 1) < 5e13Initial program 71.1%
+-commutative71.1%
associate-*l/67.7%
fma-def67.7%
associate-+l+67.7%
+-commutative67.7%
associate-*l/72.4%
fma-def72.4%
Simplified72.4%
clear-num72.3%
inv-pow72.3%
fma-udef72.3%
associate-/r/71.1%
div-inv71.2%
clear-num71.1%
fma-udef71.1%
Applied egg-rr71.1%
unpow-171.1%
fma-def71.1%
*-commutative71.1%
associate-*r/74.4%
associate-*l/75.0%
fma-udef75.0%
Simplified75.0%
Taylor expanded in z around 0 48.3%
Taylor expanded in a around 0 47.8%
Final simplification57.3%
(FPCore (x y z t a b) :precision binary64 (if (or (<= t -1.35e-113) (not (<= t 2.8e-77))) (/ x (+ a (+ 1.0 (* b (/ y t))))) (/ (+ z (/ (* x t) y)) b)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -1.35e-113) || !(t <= 2.8e-77)) {
tmp = x / (a + (1.0 + (b * (y / t))));
} 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 <= (-1.35d-113)) .or. (.not. (t <= 2.8d-77))) then
tmp = x / (a + (1.0d0 + (b * (y / t))))
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 <= -1.35e-113) || !(t <= 2.8e-77)) {
tmp = x / (a + (1.0 + (b * (y / t))));
} else {
tmp = (z + ((x * t) / y)) / b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (t <= -1.35e-113) or not (t <= 2.8e-77): tmp = x / (a + (1.0 + (b * (y / t)))) else: tmp = (z + ((x * t) / y)) / b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((t <= -1.35e-113) || !(t <= 2.8e-77)) tmp = Float64(x / Float64(a + Float64(1.0 + Float64(b * Float64(y / t))))); 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 <= -1.35e-113) || ~((t <= 2.8e-77))) tmp = x / (a + (1.0 + (b * (y / t)))); else tmp = (z + ((x * t) / y)) / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[t, -1.35e-113], N[Not[LessEqual[t, 2.8e-77]], $MachinePrecision]], N[(x / N[(a + N[(1.0 + N[(b * N[(y / t), $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 -1.35 \cdot 10^{-113} \lor \neg \left(t \leq 2.8 \cdot 10^{-77}\right):\\
\;\;\;\;\frac{x}{a + \left(1 + b \cdot \frac{y}{t}\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{z + \frac{x \cdot t}{y}}{b}\\
\end{array}
\end{array}
if t < -1.34999999999999998e-113 or 2.7999999999999999e-77 < t Initial program 81.2%
*-commutative81.2%
associate-/l*83.1%
associate-*l/90.2%
Simplified90.2%
associate-/r/93.8%
Applied egg-rr93.8%
Taylor expanded in x around inf 61.3%
+-commutative61.3%
associate-/l*66.7%
+-commutative66.7%
associate-+r+66.7%
+-commutative66.7%
associate-/r/66.7%
*-commutative66.7%
Simplified66.7%
if -1.34999999999999998e-113 < t < 2.7999999999999999e-77Initial program 57.0%
+-commutative57.0%
associate-*l/49.7%
fma-def49.7%
associate-+l+49.7%
+-commutative49.7%
associate-*l/47.4%
fma-def47.4%
Simplified47.4%
Taylor expanded in y around inf 54.5%
associate--l+54.5%
associate-/l*52.9%
times-frac49.5%
unpow249.5%
Simplified49.5%
Taylor expanded in a around 0 59.1%
unpow259.1%
associate-*r*64.1%
Simplified64.1%
Taylor expanded in b around inf 71.8%
Final simplification68.7%
(FPCore (x y z t a b)
:precision binary64
(if (<= b -1.3e+70)
(/ (+ z (/ (* x t) y)) b)
(if (<= b 7.8e+92)
(/ (+ x (* y (/ z t))) (+ a 1.0))
(/ (+ z (/ t (/ y x))) b))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= -1.3e+70) {
tmp = (z + ((x * t) / y)) / b;
} else if (b <= 7.8e+92) {
tmp = (x + (y * (z / t))) / (a + 1.0);
} else {
tmp = (z + (t / (y / x))) / 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 (b <= (-1.3d+70)) then
tmp = (z + ((x * t) / y)) / b
else if (b <= 7.8d+92) then
tmp = (x + (y * (z / t))) / (a + 1.0d0)
else
tmp = (z + (t / (y / x))) / 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 (b <= -1.3e+70) {
tmp = (z + ((x * t) / y)) / b;
} else if (b <= 7.8e+92) {
tmp = (x + (y * (z / t))) / (a + 1.0);
} else {
tmp = (z + (t / (y / x))) / b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if b <= -1.3e+70: tmp = (z + ((x * t) / y)) / b elif b <= 7.8e+92: tmp = (x + (y * (z / t))) / (a + 1.0) else: tmp = (z + (t / (y / x))) / b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (b <= -1.3e+70) tmp = Float64(Float64(z + Float64(Float64(x * t) / y)) / b); elseif (b <= 7.8e+92) tmp = Float64(Float64(x + Float64(y * Float64(z / t))) / Float64(a + 1.0)); else tmp = Float64(Float64(z + Float64(t / Float64(y / x))) / b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (b <= -1.3e+70) tmp = (z + ((x * t) / y)) / b; elseif (b <= 7.8e+92) tmp = (x + (y * (z / t))) / (a + 1.0); else tmp = (z + (t / (y / x))) / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[b, -1.3e+70], N[(N[(z + N[(N[(x * t), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision] / b), $MachinePrecision], If[LessEqual[b, 7.8e+92], N[(N[(x + N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(a + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(z + N[(t / N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / b), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -1.3 \cdot 10^{+70}:\\
\;\;\;\;\frac{z + \frac{x \cdot t}{y}}{b}\\
\mathbf{elif}\;b \leq 7.8 \cdot 10^{+92}:\\
\;\;\;\;\frac{x + y \cdot \frac{z}{t}}{a + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{z + \frac{t}{\frac{y}{x}}}{b}\\
\end{array}
\end{array}
if b < -1.3e70Initial program 64.0%
+-commutative64.0%
associate-*l/60.1%
fma-def60.0%
associate-+l+60.0%
+-commutative60.0%
associate-*l/65.7%
fma-def65.7%
Simplified65.7%
Taylor expanded in y around inf 66.4%
associate--l+66.4%
associate-/l*66.5%
times-frac70.1%
unpow270.1%
Simplified70.1%
Taylor expanded in a around 0 66.7%
unpow266.7%
associate-*r*66.7%
Simplified66.7%
Taylor expanded in b around inf 71.8%
if -1.3e70 < b < 7.80000000000000022e92Initial program 79.7%
*-commutative79.7%
associate-/l*80.2%
associate-*l/78.7%
Simplified78.7%
associate-/r/77.6%
Applied egg-rr77.6%
Taylor expanded in y around 0 73.4%
if 7.80000000000000022e92 < b Initial program 55.6%
+-commutative55.6%
associate-*l/48.2%
fma-def48.2%
associate-+l+48.2%
+-commutative48.2%
associate-*l/66.0%
fma-def66.0%
Simplified66.0%
Taylor expanded in y around inf 48.4%
associate--l+48.4%
associate-/l*48.8%
times-frac49.0%
unpow249.0%
Simplified49.0%
Taylor expanded in a around 0 59.3%
unpow259.3%
associate-*r*59.3%
Simplified59.3%
Taylor expanded in b around inf 61.3%
+-commutative61.3%
associate-/l*71.4%
Simplified71.4%
Final simplification72.7%
(FPCore (x y z t a b)
:precision binary64
(if (<= b -8e+69)
(/ (+ z (/ (* x t) y)) b)
(if (<= b 3.05e+91)
(/ (+ x (/ y (/ t z))) (+ a 1.0))
(/ (+ z (/ t (/ y x))) b))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= -8e+69) {
tmp = (z + ((x * t) / y)) / b;
} else if (b <= 3.05e+91) {
tmp = (x + (y / (t / z))) / (a + 1.0);
} else {
tmp = (z + (t / (y / x))) / 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 (b <= (-8d+69)) then
tmp = (z + ((x * t) / y)) / b
else if (b <= 3.05d+91) then
tmp = (x + (y / (t / z))) / (a + 1.0d0)
else
tmp = (z + (t / (y / x))) / 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 (b <= -8e+69) {
tmp = (z + ((x * t) / y)) / b;
} else if (b <= 3.05e+91) {
tmp = (x + (y / (t / z))) / (a + 1.0);
} else {
tmp = (z + (t / (y / x))) / b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if b <= -8e+69: tmp = (z + ((x * t) / y)) / b elif b <= 3.05e+91: tmp = (x + (y / (t / z))) / (a + 1.0) else: tmp = (z + (t / (y / x))) / b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (b <= -8e+69) tmp = Float64(Float64(z + Float64(Float64(x * t) / y)) / b); elseif (b <= 3.05e+91) tmp = Float64(Float64(x + Float64(y / Float64(t / z))) / Float64(a + 1.0)); else tmp = Float64(Float64(z + Float64(t / Float64(y / x))) / b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (b <= -8e+69) tmp = (z + ((x * t) / y)) / b; elseif (b <= 3.05e+91) tmp = (x + (y / (t / z))) / (a + 1.0); else tmp = (z + (t / (y / x))) / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[b, -8e+69], N[(N[(z + N[(N[(x * t), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision] / b), $MachinePrecision], If[LessEqual[b, 3.05e+91], N[(N[(x + N[(y / N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(a + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(z + N[(t / N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / b), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -8 \cdot 10^{+69}:\\
\;\;\;\;\frac{z + \frac{x \cdot t}{y}}{b}\\
\mathbf{elif}\;b \leq 3.05 \cdot 10^{+91}:\\
\;\;\;\;\frac{x + \frac{y}{\frac{t}{z}}}{a + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{z + \frac{t}{\frac{y}{x}}}{b}\\
\end{array}
\end{array}
if b < -8.0000000000000006e69Initial program 64.0%
+-commutative64.0%
associate-*l/60.1%
fma-def60.0%
associate-+l+60.0%
+-commutative60.0%
associate-*l/65.7%
fma-def65.7%
Simplified65.7%
Taylor expanded in y around inf 66.4%
associate--l+66.4%
associate-/l*66.5%
times-frac70.1%
unpow270.1%
Simplified70.1%
Taylor expanded in a around 0 66.7%
unpow266.7%
associate-*r*66.7%
Simplified66.7%
Taylor expanded in b around inf 71.8%
if -8.0000000000000006e69 < b < 3.05e91Initial program 79.7%
*-commutative79.7%
associate-/l*80.2%
associate-*l/78.7%
Simplified78.7%
associate-/r/77.6%
Applied egg-rr77.6%
Taylor expanded in b around 0 70.9%
+-commutative70.9%
associate-/l*73.4%
Simplified73.4%
if 3.05e91 < b Initial program 55.6%
+-commutative55.6%
associate-*l/48.2%
fma-def48.2%
associate-+l+48.2%
+-commutative48.2%
associate-*l/66.0%
fma-def66.0%
Simplified66.0%
Taylor expanded in y around inf 48.4%
associate--l+48.4%
associate-/l*48.8%
times-frac49.0%
unpow249.0%
Simplified49.0%
Taylor expanded in a around 0 59.3%
unpow259.3%
associate-*r*59.3%
Simplified59.3%
Taylor expanded in b around inf 61.3%
+-commutative61.3%
associate-/l*71.4%
Simplified71.4%
Final simplification72.7%
(FPCore (x y z t a b)
:precision binary64
(if (<= y -1.1e+123)
(/ z b)
(if (<= y -8e+106)
(+ x (/ (* y z) t))
(if (<= y -9.6e+80)
(/ z b)
(if (<= y 1.9e+29) (/ x (+ a 1.0)) (/ z b))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -1.1e+123) {
tmp = z / b;
} else if (y <= -8e+106) {
tmp = x + ((y * z) / t);
} else if (y <= -9.6e+80) {
tmp = z / b;
} else if (y <= 1.9e+29) {
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 (y <= (-1.1d+123)) then
tmp = z / b
else if (y <= (-8d+106)) then
tmp = x + ((y * z) / t)
else if (y <= (-9.6d+80)) then
tmp = z / b
else if (y <= 1.9d+29) 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 (y <= -1.1e+123) {
tmp = z / b;
} else if (y <= -8e+106) {
tmp = x + ((y * z) / t);
} else if (y <= -9.6e+80) {
tmp = z / b;
} else if (y <= 1.9e+29) {
tmp = x / (a + 1.0);
} else {
tmp = z / b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -1.1e+123: tmp = z / b elif y <= -8e+106: tmp = x + ((y * z) / t) elif y <= -9.6e+80: tmp = z / b elif y <= 1.9e+29: tmp = x / (a + 1.0) else: tmp = z / b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -1.1e+123) tmp = Float64(z / b); elseif (y <= -8e+106) tmp = Float64(x + Float64(Float64(y * z) / t)); elseif (y <= -9.6e+80) tmp = Float64(z / b); elseif (y <= 1.9e+29) 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 (y <= -1.1e+123) tmp = z / b; elseif (y <= -8e+106) tmp = x + ((y * z) / t); elseif (y <= -9.6e+80) tmp = z / b; elseif (y <= 1.9e+29) tmp = x / (a + 1.0); else tmp = z / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -1.1e+123], N[(z / b), $MachinePrecision], If[LessEqual[y, -8e+106], N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -9.6e+80], N[(z / b), $MachinePrecision], If[LessEqual[y, 1.9e+29], N[(x / N[(a + 1.0), $MachinePrecision]), $MachinePrecision], N[(z / b), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.1 \cdot 10^{+123}:\\
\;\;\;\;\frac{z}{b}\\
\mathbf{elif}\;y \leq -8 \cdot 10^{+106}:\\
\;\;\;\;x + \frac{y \cdot z}{t}\\
\mathbf{elif}\;y \leq -9.6 \cdot 10^{+80}:\\
\;\;\;\;\frac{z}{b}\\
\mathbf{elif}\;y \leq 1.9 \cdot 10^{+29}:\\
\;\;\;\;\frac{x}{a + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{b}\\
\end{array}
\end{array}
if y < -1.09999999999999996e123 or -8.00000000000000073e106 < y < -9.59999999999999916e80 or 1.89999999999999985e29 < y Initial program 46.1%
+-commutative46.1%
associate-*l/44.0%
fma-def43.9%
associate-+l+43.9%
+-commutative43.9%
associate-*l/51.4%
fma-def51.4%
Simplified51.4%
Taylor expanded in y around inf 55.2%
if -1.09999999999999996e123 < y < -8.00000000000000073e106Initial program 99.5%
*-commutative99.5%
associate-/l*99.8%
associate-*l/99.8%
Simplified99.8%
associate-/r/99.8%
Applied egg-rr99.8%
Taylor expanded in b around 0 99.5%
+-commutative99.5%
associate-/l*100.0%
Simplified100.0%
Taylor expanded in a around 0 75.8%
if -9.59999999999999916e80 < y < 1.89999999999999985e29Initial program 91.5%
+-commutative91.5%
associate-*l/90.2%
fma-def90.2%
associate-+l+90.2%
+-commutative90.2%
associate-*l/90.9%
fma-def90.9%
Simplified90.9%
Taylor expanded in y around 0 57.9%
Final simplification57.3%
(FPCore (x y z t a b)
:precision binary64
(if (<= y -1.65e-34)
(/ z b)
(if (<= y -4.8e-166)
(/ x a)
(if (<= y 6e-248)
(/ 1.0 (/ 1.0 x))
(if (<= y 1.15e+18) (/ x a) (/ z b))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -1.65e-34) {
tmp = z / b;
} else if (y <= -4.8e-166) {
tmp = x / a;
} else if (y <= 6e-248) {
tmp = 1.0 / (1.0 / x);
} else if (y <= 1.15e+18) {
tmp = x / a;
} else {
tmp = z / b;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (y <= (-1.65d-34)) then
tmp = z / b
else if (y <= (-4.8d-166)) then
tmp = x / a
else if (y <= 6d-248) then
tmp = 1.0d0 / (1.0d0 / x)
else if (y <= 1.15d+18) then
tmp = x / a
else
tmp = z / b
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -1.65e-34) {
tmp = z / b;
} else if (y <= -4.8e-166) {
tmp = x / a;
} else if (y <= 6e-248) {
tmp = 1.0 / (1.0 / x);
} else if (y <= 1.15e+18) {
tmp = x / a;
} else {
tmp = z / b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -1.65e-34: tmp = z / b elif y <= -4.8e-166: tmp = x / a elif y <= 6e-248: tmp = 1.0 / (1.0 / x) elif y <= 1.15e+18: tmp = x / a else: tmp = z / b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -1.65e-34) tmp = Float64(z / b); elseif (y <= -4.8e-166) tmp = Float64(x / a); elseif (y <= 6e-248) tmp = Float64(1.0 / Float64(1.0 / x)); elseif (y <= 1.15e+18) tmp = Float64(x / a); else tmp = Float64(z / b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= -1.65e-34) tmp = z / b; elseif (y <= -4.8e-166) tmp = x / a; elseif (y <= 6e-248) tmp = 1.0 / (1.0 / x); elseif (y <= 1.15e+18) tmp = x / a; else tmp = z / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -1.65e-34], N[(z / b), $MachinePrecision], If[LessEqual[y, -4.8e-166], N[(x / a), $MachinePrecision], If[LessEqual[y, 6e-248], N[(1.0 / N[(1.0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.15e+18], N[(x / a), $MachinePrecision], N[(z / b), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.65 \cdot 10^{-34}:\\
\;\;\;\;\frac{z}{b}\\
\mathbf{elif}\;y \leq -4.8 \cdot 10^{-166}:\\
\;\;\;\;\frac{x}{a}\\
\mathbf{elif}\;y \leq 6 \cdot 10^{-248}:\\
\;\;\;\;\frac{1}{\frac{1}{x}}\\
\mathbf{elif}\;y \leq 1.15 \cdot 10^{+18}:\\
\;\;\;\;\frac{x}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{b}\\
\end{array}
\end{array}
if y < -1.64999999999999991e-34 or 1.15e18 < y Initial program 54.1%
+-commutative54.1%
associate-*l/52.5%
fma-def52.5%
associate-+l+52.5%
+-commutative52.5%
associate-*l/59.0%
fma-def59.0%
Simplified59.0%
Taylor expanded in y around inf 48.4%
if -1.64999999999999991e-34 < y < -4.7999999999999997e-166 or 6.00000000000000027e-248 < y < 1.15e18Initial program 94.9%
+-commutative94.9%
associate-*l/91.4%
fma-def91.4%
associate-+l+91.4%
+-commutative91.4%
associate-*l/91.4%
fma-def91.4%
Simplified91.4%
clear-num89.5%
inv-pow89.5%
fma-udef89.5%
associate-/r/83.3%
div-inv83.3%
clear-num83.3%
fma-udef83.3%
Applied egg-rr83.3%
unpow-183.3%
fma-def83.3%
*-commutative83.3%
associate-*r/86.8%
associate-*l/83.0%
fma-udef83.0%
Simplified83.0%
Taylor expanded in z around 0 69.2%
Taylor expanded in a around inf 41.4%
if -4.7999999999999997e-166 < y < 6.00000000000000027e-248Initial program 92.4%
+-commutative92.4%
associate-*l/94.9%
fma-def94.9%
associate-+l+94.9%
+-commutative94.9%
associate-*l/94.9%
fma-def94.9%
Simplified94.9%
clear-num94.6%
inv-pow94.6%
fma-udef94.6%
associate-/r/89.7%
div-inv89.7%
clear-num89.6%
fma-udef89.6%
Applied egg-rr89.6%
unpow-189.6%
fma-def89.6%
*-commutative89.6%
associate-*r/89.6%
associate-*l/81.5%
fma-udef81.5%
Simplified81.5%
Taylor expanded in z around 0 75.8%
Taylor expanded in a around 0 50.9%
Taylor expanded in y around 0 47.3%
Final simplification46.1%
(FPCore (x y z t a b) :precision binary64 (if (<= y -1e+79) (/ z b) (if (<= y 5.1e+23) (/ x (+ a 1.0)) (/ z b))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -1e+79) {
tmp = z / b;
} else if (y <= 5.1e+23) {
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 (y <= (-1d+79)) then
tmp = z / b
else if (y <= 5.1d+23) 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 (y <= -1e+79) {
tmp = z / b;
} else if (y <= 5.1e+23) {
tmp = x / (a + 1.0);
} else {
tmp = z / b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -1e+79: tmp = z / b elif y <= 5.1e+23: tmp = x / (a + 1.0) else: tmp = z / b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -1e+79) tmp = Float64(z / b); elseif (y <= 5.1e+23) 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 (y <= -1e+79) tmp = z / b; elseif (y <= 5.1e+23) tmp = x / (a + 1.0); else tmp = z / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -1e+79], N[(z / b), $MachinePrecision], If[LessEqual[y, 5.1e+23], N[(x / N[(a + 1.0), $MachinePrecision]), $MachinePrecision], N[(z / b), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1 \cdot 10^{+79}:\\
\;\;\;\;\frac{z}{b}\\
\mathbf{elif}\;y \leq 5.1 \cdot 10^{+23}:\\
\;\;\;\;\frac{x}{a + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{b}\\
\end{array}
\end{array}
if y < -9.99999999999999967e78 or 5.10000000000000021e23 < y Initial program 49.6%
+-commutative49.6%
associate-*l/47.7%
fma-def47.7%
associate-+l+47.7%
+-commutative47.7%
associate-*l/54.6%
fma-def54.6%
Simplified54.6%
Taylor expanded in y around inf 52.7%
if -9.99999999999999967e78 < y < 5.10000000000000021e23Initial program 91.5%
+-commutative91.5%
associate-*l/90.2%
fma-def90.2%
associate-+l+90.2%
+-commutative90.2%
associate-*l/90.9%
fma-def90.9%
Simplified90.9%
Taylor expanded in y around 0 57.9%
Final simplification55.5%
(FPCore (x y z t a b) :precision binary64 (if (<= y -8.4e-35) (/ z b) (if (<= y 2e+15) (/ x a) (/ z b))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -8.4e-35) {
tmp = z / b;
} else if (y <= 2e+15) {
tmp = x / a;
} else {
tmp = z / b;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (y <= (-8.4d-35)) then
tmp = z / b
else if (y <= 2d+15) then
tmp = x / a
else
tmp = z / b
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -8.4e-35) {
tmp = z / b;
} else if (y <= 2e+15) {
tmp = x / a;
} else {
tmp = z / b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -8.4e-35: tmp = z / b elif y <= 2e+15: tmp = x / a else: tmp = z / b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -8.4e-35) tmp = Float64(z / b); elseif (y <= 2e+15) tmp = Float64(x / a); else tmp = Float64(z / b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= -8.4e-35) tmp = z / b; elseif (y <= 2e+15) tmp = x / a; else tmp = z / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -8.4e-35], N[(z / b), $MachinePrecision], If[LessEqual[y, 2e+15], N[(x / a), $MachinePrecision], N[(z / b), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -8.4 \cdot 10^{-35}:\\
\;\;\;\;\frac{z}{b}\\
\mathbf{elif}\;y \leq 2 \cdot 10^{+15}:\\
\;\;\;\;\frac{x}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{b}\\
\end{array}
\end{array}
if y < -8.3999999999999999e-35 or 2e15 < y Initial program 54.1%
+-commutative54.1%
associate-*l/52.5%
fma-def52.5%
associate-+l+52.5%
+-commutative52.5%
associate-*l/59.0%
fma-def59.0%
Simplified59.0%
Taylor expanded in y around inf 48.4%
if -8.3999999999999999e-35 < y < 2e15Initial program 94.1%
+-commutative94.1%
associate-*l/92.5%
fma-def92.5%
associate-+l+92.5%
+-commutative92.5%
associate-*l/92.6%
fma-def92.6%
Simplified92.6%
clear-num91.2%
inv-pow91.2%
fma-udef91.2%
associate-/r/85.4%
div-inv85.4%
clear-num85.4%
fma-udef85.4%
Applied egg-rr85.4%
unpow-185.4%
fma-def85.4%
*-commutative85.4%
associate-*r/87.7%
associate-*l/82.5%
fma-udef82.5%
Simplified82.5%
Taylor expanded in z around 0 71.4%
Taylor expanded in a around inf 37.4%
Final simplification43.5%
(FPCore (x y z t a b) :precision binary64 (/ x a))
double code(double x, double y, double z, double t, double a, double b) {
return x / a;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = x / a
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return x / a;
}
def code(x, y, z, t, a, b): return x / a
function code(x, y, z, t, a, b) return Float64(x / a) end
function tmp = code(x, y, z, t, a, b) tmp = x / a; end
code[x_, y_, z_, t_, a_, b_] := N[(x / a), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{a}
\end{array}
Initial program 72.0%
+-commutative72.0%
associate-*l/70.5%
fma-def70.5%
associate-+l+70.5%
+-commutative70.5%
associate-*l/74.1%
fma-def74.1%
Simplified74.1%
clear-num73.4%
inv-pow73.4%
fma-udef73.4%
associate-/r/71.7%
div-inv71.7%
clear-num71.7%
fma-udef71.7%
Applied egg-rr71.7%
unpow-171.7%
fma-def71.7%
*-commutative71.7%
associate-*r/72.5%
associate-*l/74.2%
fma-udef74.2%
Simplified74.2%
Taylor expanded in z around 0 49.7%
Taylor expanded in a around inf 23.1%
Final simplification23.1%
(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 2023238
(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))))