
(FPCore (x y z t a b) :precision binary64 (/ (+ x (/ (* y z) t)) (+ (+ a 1.0) (/ (* y b) t))))
double code(double x, double y, double z, double t, double a, double b) {
return (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t));
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = (x + ((y * z) / t)) / ((a + 1.0d0) + ((y * b) / t))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t));
}
def code(x, y, z, t, a, b): return (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t))
function code(x, y, z, t, a, b) return Float64(Float64(x + Float64(Float64(y * z) / t)) / Float64(Float64(a + 1.0) + Float64(Float64(y * b) / t))) end
function tmp = code(x, y, z, t, a, b) tmp = (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t)); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] / N[(N[(a + 1.0), $MachinePrecision] + N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 16 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b) :precision binary64 (/ (+ x (/ (* y z) t)) (+ (+ a 1.0) (/ (* y b) t))))
double code(double x, double y, double z, double t, double a, double b) {
return (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t));
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = (x + ((y * z) / t)) / ((a + 1.0d0) + ((y * b) / t))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t));
}
def code(x, y, z, t, a, b): return (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t))
function code(x, y, z, t, a, b) return Float64(Float64(x + Float64(Float64(y * z) / t)) / Float64(Float64(a + 1.0) + Float64(Float64(y * b) / t))) end
function tmp = code(x, y, z, t, a, b) tmp = (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t)); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] / N[(N[(a + 1.0), $MachinePrecision] + N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}}
\end{array}
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (+ x (/ (* y z) t)) (+ (+ a 1.0) (/ (* y b) t)))))
(if (<= t_1 (- INFINITY))
(* z (/ y (fma y b (+ t (* t a)))))
(if (<= t_1 -2e-290)
t_1
(if (<= t_1 0.0)
(-
(/ z b)
(/ (fma -1.0 (/ t (/ b x)) (/ t (/ (* b b) (+ z (* z a))))) y))
(if (<= t_1 2e+303) 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 = z * (y / fma(y, b, (t + (t * a))));
} else if (t_1 <= -2e-290) {
tmp = t_1;
} else if (t_1 <= 0.0) {
tmp = (z / b) - (fma(-1.0, (t / (b / x)), (t / ((b * b) / (z + (z * a))))) / y);
} else if (t_1 <= 2e+303) {
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(z * Float64(y / fma(y, b, Float64(t + Float64(t * a))))); elseif (t_1 <= -2e-290) tmp = t_1; elseif (t_1 <= 0.0) tmp = Float64(Float64(z / b) - Float64(fma(-1.0, Float64(t / Float64(b / x)), Float64(t / Float64(Float64(b * b) / Float64(z + Float64(z * a))))) / y)); elseif (t_1 <= 2e+303) tmp = t_1; else tmp = Float64(z / b); end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] / N[(N[(a + 1.0), $MachinePrecision] + N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(z * N[(y / N[(y * b + N[(t + N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, -2e-290], t$95$1, If[LessEqual[t$95$1, 0.0], N[(N[(z / b), $MachinePrecision] - N[(N[(-1.0 * N[(t / N[(b / x), $MachinePrecision]), $MachinePrecision] + N[(t / N[(N[(b * b), $MachinePrecision] / N[(z + N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2e+303], 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:\\
\;\;\;\;z \cdot \frac{y}{\mathsf{fma}\left(y, b, t + t \cdot a\right)}\\
\mathbf{elif}\;t_1 \leq -2 \cdot 10^{-290}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t_1 \leq 0:\\
\;\;\;\;\frac{z}{b} - \frac{\mathsf{fma}\left(-1, \frac{t}{\frac{b}{x}}, \frac{t}{\frac{b \cdot b}{z + z \cdot a}}\right)}{y}\\
\mathbf{elif}\;t_1 \leq 2 \cdot 10^{+303}:\\
\;\;\;\;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 32.2%
*-commutative32.2%
associate-*l/39.2%
*-commutative39.2%
associate-*l/39.0%
Simplified39.0%
Taylor expanded in x around 0 79.0%
Taylor expanded in t around 0 79.0%
expm1-log1p-u0.0%
expm1-udef0.0%
associate-/l*0.0%
*-commutative0.0%
fma-def0.0%
distribute-rgt-in0.0%
*-un-lft-identity0.0%
Applied egg-rr0.0%
expm1-def0.0%
expm1-log1p92.4%
associate-/r/92.4%
*-commutative92.4%
Simplified92.4%
if -inf.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < -2.0000000000000001e-290 or -0.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < 2e303Initial program 99.7%
if -2.0000000000000001e-290 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < -0.0Initial program 54.1%
*-commutative54.1%
associate-*l/54.1%
*-commutative54.1%
associate-*l/70.9%
Simplified70.9%
Taylor expanded in y around -inf 74.7%
+-commutative74.7%
mul-1-neg74.7%
unsub-neg74.7%
Simplified78.4%
if 2e303 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) Initial program 6.7%
*-commutative6.7%
associate-*l/14.7%
*-commutative14.7%
associate-*l/20.1%
Simplified20.1%
Taylor expanded in t around 0 92.5%
Final simplification95.0%
(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))
(* z (/ y (fma y b (+ t (* t a)))))
(if (<= t_1 -1e-202)
t_1
(if (<= t_1 5e-210)
(/ (+ x (* y (/ z t))) (+ (+ a 1.0) (* y (/ b t))))
(if (<= t_1 2e+303) 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 = z * (y / fma(y, b, (t + (t * a))));
} else if (t_1 <= -1e-202) {
tmp = t_1;
} else if (t_1 <= 5e-210) {
tmp = (x + (y * (z / t))) / ((a + 1.0) + (y * (b / t)));
} else if (t_1 <= 2e+303) {
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(z * Float64(y / fma(y, b, Float64(t + Float64(t * a))))); elseif (t_1 <= -1e-202) tmp = t_1; elseif (t_1 <= 5e-210) tmp = Float64(Float64(x + Float64(y * Float64(z / t))) / Float64(Float64(a + 1.0) + Float64(y * Float64(b / t)))); elseif (t_1 <= 2e+303) tmp = t_1; else tmp = Float64(z / b); end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] / N[(N[(a + 1.0), $MachinePrecision] + N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(z * N[(y / N[(y * b + N[(t + N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, -1e-202], t$95$1, If[LessEqual[t$95$1, 5e-210], 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+303], 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:\\
\;\;\;\;z \cdot \frac{y}{\mathsf{fma}\left(y, b, t + t \cdot a\right)}\\
\mathbf{elif}\;t_1 \leq -1 \cdot 10^{-202}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t_1 \leq 5 \cdot 10^{-210}:\\
\;\;\;\;\frac{x + y \cdot \frac{z}{t}}{\left(a + 1\right) + y \cdot \frac{b}{t}}\\
\mathbf{elif}\;t_1 \leq 2 \cdot 10^{+303}:\\
\;\;\;\;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 32.2%
*-commutative32.2%
associate-*l/39.2%
*-commutative39.2%
associate-*l/39.0%
Simplified39.0%
Taylor expanded in x around 0 79.0%
Taylor expanded in t around 0 79.0%
expm1-log1p-u0.0%
expm1-udef0.0%
associate-/l*0.0%
*-commutative0.0%
fma-def0.0%
distribute-rgt-in0.0%
*-un-lft-identity0.0%
Applied egg-rr0.0%
expm1-def0.0%
expm1-log1p92.4%
associate-/r/92.4%
*-commutative92.4%
Simplified92.4%
if -inf.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < -1e-202 or 5.0000000000000002e-210 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < 2e303Initial program 99.7%
if -1e-202 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < 5.0000000000000002e-210Initial program 73.2%
*-commutative73.2%
associate-*l/73.2%
*-commutative73.2%
associate-*l/83.0%
Simplified83.0%
if 2e303 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) Initial program 6.7%
*-commutative6.7%
associate-*l/14.7%
*-commutative14.7%
associate-*l/20.1%
Simplified20.1%
Taylor expanded in t around 0 92.5%
Final simplification93.9%
(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 z) (+ (* y b) (* t (+ a 1.0))))
(if (<= t_1 -1e-202)
t_1
(if (<= t_1 5e-210)
(/ (+ x (* y (/ z t))) (+ (+ a 1.0) (* y (/ b t))))
(if (<= t_1 2e+303) 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 * z) / ((y * b) + (t * (a + 1.0)));
} else if (t_1 <= -1e-202) {
tmp = t_1;
} else if (t_1 <= 5e-210) {
tmp = (x + (y * (z / t))) / ((a + 1.0) + (y * (b / t)));
} else if (t_1 <= 2e+303) {
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 * z) / ((y * b) + (t * (a + 1.0)));
} else if (t_1 <= -1e-202) {
tmp = t_1;
} else if (t_1 <= 5e-210) {
tmp = (x + (y * (z / t))) / ((a + 1.0) + (y * (b / t)));
} else if (t_1 <= 2e+303) {
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 * z) / ((y * b) + (t * (a + 1.0))) elif t_1 <= -1e-202: tmp = t_1 elif t_1 <= 5e-210: tmp = (x + (y * (z / t))) / ((a + 1.0) + (y * (b / t))) elif t_1 <= 2e+303: 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(y * z) / Float64(Float64(y * b) + Float64(t * Float64(a + 1.0)))); elseif (t_1 <= -1e-202) tmp = t_1; elseif (t_1 <= 5e-210) tmp = Float64(Float64(x + Float64(y * Float64(z / t))) / Float64(Float64(a + 1.0) + Float64(y * Float64(b / t)))); elseif (t_1 <= 2e+303) 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 * z) / ((y * b) + (t * (a + 1.0))); elseif (t_1 <= -1e-202) tmp = t_1; elseif (t_1 <= 5e-210) tmp = (x + (y * (z / t))) / ((a + 1.0) + (y * (b / t))); elseif (t_1 <= 2e+303) 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[(y * z), $MachinePrecision] / N[(N[(y * b), $MachinePrecision] + N[(t * N[(a + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, -1e-202], t$95$1, If[LessEqual[t$95$1, 5e-210], 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+303], 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 \cdot z}{y \cdot b + t \cdot \left(a + 1\right)}\\
\mathbf{elif}\;t_1 \leq -1 \cdot 10^{-202}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t_1 \leq 5 \cdot 10^{-210}:\\
\;\;\;\;\frac{x + y \cdot \frac{z}{t}}{\left(a + 1\right) + y \cdot \frac{b}{t}}\\
\mathbf{elif}\;t_1 \leq 2 \cdot 10^{+303}:\\
\;\;\;\;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 32.2%
*-commutative32.2%
associate-*l/39.2%
*-commutative39.2%
associate-*l/39.0%
Simplified39.0%
Taylor expanded in x around 0 79.0%
Taylor expanded in t around 0 79.0%
if -inf.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < -1e-202 or 5.0000000000000002e-210 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < 2e303Initial program 99.7%
if -1e-202 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < 5.0000000000000002e-210Initial program 73.2%
*-commutative73.2%
associate-*l/73.2%
*-commutative73.2%
associate-*l/83.0%
Simplified83.0%
if 2e303 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) Initial program 6.7%
*-commutative6.7%
associate-*l/14.7%
*-commutative14.7%
associate-*l/20.1%
Simplified20.1%
Taylor expanded in t around 0 92.5%
Final simplification93.1%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -1.62e+115) (not (<= y 4e+139))) (/ z b) (/ (+ x (* z (/ y t))) (+ a (+ 1.0 (/ y (/ t b)))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -1.62e+115) || !(y <= 4e+139)) {
tmp = z / b;
} else {
tmp = (x + (z * (y / t))) / (a + (1.0 + (y / (t / 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.62d+115)) .or. (.not. (y <= 4d+139))) then
tmp = z / b
else
tmp = (x + (z * (y / t))) / (a + (1.0d0 + (y / (t / 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.62e+115) || !(y <= 4e+139)) {
tmp = z / b;
} else {
tmp = (x + (z * (y / t))) / (a + (1.0 + (y / (t / b))));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -1.62e+115) or not (y <= 4e+139): tmp = z / b else: tmp = (x + (z * (y / t))) / (a + (1.0 + (y / (t / b)))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -1.62e+115) || !(y <= 4e+139)) tmp = Float64(z / b); else tmp = Float64(Float64(x + Float64(z * Float64(y / t))) / Float64(a + Float64(1.0 + Float64(y / Float64(t / b))))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -1.62e+115) || ~((y <= 4e+139))) tmp = z / b; else tmp = (x + (z * (y / t))) / (a + (1.0 + (y / (t / b)))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -1.62e+115], N[Not[LessEqual[y, 4e+139]], $MachinePrecision]], N[(z / b), $MachinePrecision], 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]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.62 \cdot 10^{+115} \lor \neg \left(y \leq 4 \cdot 10^{+139}\right):\\
\;\;\;\;\frac{z}{b}\\
\mathbf{else}:\\
\;\;\;\;\frac{x + z \cdot \frac{y}{t}}{a + \left(1 + \frac{y}{\frac{t}{b}}\right)}\\
\end{array}
\end{array}
if y < -1.62e115 or 4.00000000000000013e139 < y Initial program 38.3%
*-commutative38.3%
associate-*l/40.9%
*-commutative40.9%
associate-*l/49.4%
Simplified49.4%
Taylor expanded in t around 0 72.3%
if -1.62e115 < y < 4.00000000000000013e139Initial program 92.2%
*-commutative92.2%
associate-/l*91.1%
associate-*l/92.1%
*-commutative92.1%
cancel-sign-sub92.1%
*-commutative92.1%
associate-*l/91.1%
associate-+r-91.1%
associate-*l/92.1%
*-commutative92.1%
cancel-sign-sub92.1%
*-commutative92.1%
associate-/r/87.8%
Simplified87.8%
div-inv87.8%
clear-num87.8%
Applied egg-rr87.8%
Final simplification83.0%
(FPCore (x y z t a b)
:precision binary64
(if (<= y -1.6e+115)
(/ z b)
(if (<= y 2.6e+182)
(/ (+ x (* y (/ z t))) (+ (+ a 1.0) (* y (/ b t))))
(/ z b))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -1.6e+115) {
tmp = z / b;
} else if (y <= 2.6e+182) {
tmp = (x + (y * (z / t))) / ((a + 1.0) + (y * (b / t)));
} else {
tmp = z / b;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (y <= (-1.6d+115)) then
tmp = z / b
else if (y <= 2.6d+182) then
tmp = (x + (y * (z / t))) / ((a + 1.0d0) + (y * (b / t)))
else
tmp = z / b
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -1.6e+115) {
tmp = z / b;
} else if (y <= 2.6e+182) {
tmp = (x + (y * (z / t))) / ((a + 1.0) + (y * (b / t)));
} else {
tmp = z / b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -1.6e+115: tmp = z / b elif y <= 2.6e+182: tmp = (x + (y * (z / t))) / ((a + 1.0) + (y * (b / t))) else: tmp = z / b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -1.6e+115) tmp = Float64(z / b); elseif (y <= 2.6e+182) tmp = Float64(Float64(x + Float64(y * Float64(z / t))) / Float64(Float64(a + 1.0) + Float64(y * Float64(b / t)))); else tmp = Float64(z / b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= -1.6e+115) tmp = z / b; elseif (y <= 2.6e+182) tmp = (x + (y * (z / t))) / ((a + 1.0) + (y * (b / t))); else tmp = z / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -1.6e+115], N[(z / b), $MachinePrecision], If[LessEqual[y, 2.6e+182], N[(N[(x + N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(a + 1.0), $MachinePrecision] + N[(y * N[(b / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z / b), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.6 \cdot 10^{+115}:\\
\;\;\;\;\frac{z}{b}\\
\mathbf{elif}\;y \leq 2.6 \cdot 10^{+182}:\\
\;\;\;\;\frac{x + y \cdot \frac{z}{t}}{\left(a + 1\right) + y \cdot \frac{b}{t}}\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{b}\\
\end{array}
\end{array}
if y < -1.6e115 or 2.6e182 < y Initial program 36.2%
*-commutative36.2%
associate-*l/37.8%
*-commutative37.8%
associate-*l/46.3%
Simplified46.3%
Taylor expanded in t around 0 74.5%
if -1.6e115 < y < 2.6e182Initial program 89.6%
*-commutative89.6%
associate-*l/86.6%
*-commutative86.6%
associate-*l/86.1%
Simplified86.1%
Final simplification83.0%
(FPCore (x y z t a b)
:precision binary64
(if (<= y -1350000.0)
(/ z b)
(if (<= y 2.5e-129)
(/ x (+ a 1.0))
(if (<= y 1.65e-59)
(* (/ y t) (/ z (+ a 1.0)))
(if (<= y 2600000000.0) (/ x (+ 1.0 (* y (/ b t)))) (/ z b))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -1350000.0) {
tmp = z / b;
} else if (y <= 2.5e-129) {
tmp = x / (a + 1.0);
} else if (y <= 1.65e-59) {
tmp = (y / t) * (z / (a + 1.0));
} else if (y <= 2600000000.0) {
tmp = x / (1.0 + (y * (b / t)));
} else {
tmp = z / b;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (y <= (-1350000.0d0)) then
tmp = z / b
else if (y <= 2.5d-129) then
tmp = x / (a + 1.0d0)
else if (y <= 1.65d-59) then
tmp = (y / t) * (z / (a + 1.0d0))
else if (y <= 2600000000.0d0) then
tmp = x / (1.0d0 + (y * (b / t)))
else
tmp = z / b
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -1350000.0) {
tmp = z / b;
} else if (y <= 2.5e-129) {
tmp = x / (a + 1.0);
} else if (y <= 1.65e-59) {
tmp = (y / t) * (z / (a + 1.0));
} else if (y <= 2600000000.0) {
tmp = x / (1.0 + (y * (b / t)));
} else {
tmp = z / b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -1350000.0: tmp = z / b elif y <= 2.5e-129: tmp = x / (a + 1.0) elif y <= 1.65e-59: tmp = (y / t) * (z / (a + 1.0)) elif y <= 2600000000.0: tmp = x / (1.0 + (y * (b / t))) else: tmp = z / b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -1350000.0) tmp = Float64(z / b); elseif (y <= 2.5e-129) tmp = Float64(x / Float64(a + 1.0)); elseif (y <= 1.65e-59) tmp = Float64(Float64(y / t) * Float64(z / Float64(a + 1.0))); elseif (y <= 2600000000.0) tmp = Float64(x / Float64(1.0 + Float64(y * Float64(b / t)))); else tmp = Float64(z / b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= -1350000.0) tmp = z / b; elseif (y <= 2.5e-129) tmp = x / (a + 1.0); elseif (y <= 1.65e-59) tmp = (y / t) * (z / (a + 1.0)); elseif (y <= 2600000000.0) tmp = x / (1.0 + (y * (b / t))); else tmp = z / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -1350000.0], N[(z / b), $MachinePrecision], If[LessEqual[y, 2.5e-129], N[(x / N[(a + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.65e-59], N[(N[(y / t), $MachinePrecision] * N[(z / N[(a + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2600000000.0], N[(x / N[(1.0 + N[(y * N[(b / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z / b), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1350000:\\
\;\;\;\;\frac{z}{b}\\
\mathbf{elif}\;y \leq 2.5 \cdot 10^{-129}:\\
\;\;\;\;\frac{x}{a + 1}\\
\mathbf{elif}\;y \leq 1.65 \cdot 10^{-59}:\\
\;\;\;\;\frac{y}{t} \cdot \frac{z}{a + 1}\\
\mathbf{elif}\;y \leq 2600000000:\\
\;\;\;\;\frac{x}{1 + y \cdot \frac{b}{t}}\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{b}\\
\end{array}
\end{array}
if y < -1.35e6 or 2.6e9 < y Initial program 51.5%
*-commutative51.5%
associate-*l/54.0%
*-commutative54.0%
associate-*l/61.1%
Simplified61.1%
Taylor expanded in t around 0 62.0%
if -1.35e6 < y < 2.50000000000000014e-129Initial program 97.9%
*-commutative97.9%
associate-*l/90.7%
*-commutative90.7%
associate-*l/86.9%
Simplified86.9%
Taylor expanded in t around inf 71.8%
if 2.50000000000000014e-129 < y < 1.64999999999999991e-59Initial program 99.6%
*-commutative99.6%
associate-*l/99.8%
*-commutative99.8%
associate-*l/99.8%
Simplified99.8%
Taylor expanded in x around 0 73.1%
times-frac70.3%
+-commutative70.3%
associate-*l/70.3%
*-commutative70.3%
associate-+r+70.3%
fma-udef70.3%
Simplified70.3%
Taylor expanded in y around 0 63.5%
if 1.64999999999999991e-59 < y < 2.6e9Initial program 89.1%
*-commutative89.1%
associate-*l/89.1%
*-commutative89.1%
associate-*l/89.4%
Simplified89.4%
Taylor expanded in x around inf 73.3%
clear-num73.2%
inv-pow73.2%
associate-/l*73.3%
Applied egg-rr73.3%
unpow-173.3%
Simplified73.3%
Taylor expanded in a around 0 61.2%
associate-*l/61.3%
*-commutative61.3%
Simplified61.3%
Final simplification66.0%
(FPCore (x y z t a b)
:precision binary64
(if (<= y -7600.0)
(/ z b)
(if (<= y 2.5e-129)
(/ x (+ a 1.0))
(if (<= y 1.65e-59)
(/ y (/ (+ t (* t a)) z))
(if (<= y 520000000000.0) (/ x (+ 1.0 (* y (/ b t)))) (/ z b))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -7600.0) {
tmp = z / b;
} else if (y <= 2.5e-129) {
tmp = x / (a + 1.0);
} else if (y <= 1.65e-59) {
tmp = y / ((t + (t * a)) / z);
} else if (y <= 520000000000.0) {
tmp = x / (1.0 + (y * (b / t)));
} else {
tmp = z / b;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (y <= (-7600.0d0)) then
tmp = z / b
else if (y <= 2.5d-129) then
tmp = x / (a + 1.0d0)
else if (y <= 1.65d-59) then
tmp = y / ((t + (t * a)) / z)
else if (y <= 520000000000.0d0) then
tmp = x / (1.0d0 + (y * (b / t)))
else
tmp = z / b
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -7600.0) {
tmp = z / b;
} else if (y <= 2.5e-129) {
tmp = x / (a + 1.0);
} else if (y <= 1.65e-59) {
tmp = y / ((t + (t * a)) / z);
} else if (y <= 520000000000.0) {
tmp = x / (1.0 + (y * (b / t)));
} else {
tmp = z / b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -7600.0: tmp = z / b elif y <= 2.5e-129: tmp = x / (a + 1.0) elif y <= 1.65e-59: tmp = y / ((t + (t * a)) / z) elif y <= 520000000000.0: tmp = x / (1.0 + (y * (b / t))) else: tmp = z / b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -7600.0) tmp = Float64(z / b); elseif (y <= 2.5e-129) tmp = Float64(x / Float64(a + 1.0)); elseif (y <= 1.65e-59) tmp = Float64(y / Float64(Float64(t + Float64(t * a)) / z)); elseif (y <= 520000000000.0) tmp = Float64(x / Float64(1.0 + Float64(y * Float64(b / t)))); else tmp = Float64(z / b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= -7600.0) tmp = z / b; elseif (y <= 2.5e-129) tmp = x / (a + 1.0); elseif (y <= 1.65e-59) tmp = y / ((t + (t * a)) / z); elseif (y <= 520000000000.0) tmp = x / (1.0 + (y * (b / t))); else tmp = z / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -7600.0], N[(z / b), $MachinePrecision], If[LessEqual[y, 2.5e-129], N[(x / N[(a + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.65e-59], N[(y / N[(N[(t + N[(t * a), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 520000000000.0], N[(x / N[(1.0 + N[(y * N[(b / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z / b), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -7600:\\
\;\;\;\;\frac{z}{b}\\
\mathbf{elif}\;y \leq 2.5 \cdot 10^{-129}:\\
\;\;\;\;\frac{x}{a + 1}\\
\mathbf{elif}\;y \leq 1.65 \cdot 10^{-59}:\\
\;\;\;\;\frac{y}{\frac{t + t \cdot a}{z}}\\
\mathbf{elif}\;y \leq 520000000000:\\
\;\;\;\;\frac{x}{1 + y \cdot \frac{b}{t}}\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{b}\\
\end{array}
\end{array}
if y < -7600 or 5.2e11 < y Initial program 51.5%
*-commutative51.5%
associate-*l/54.0%
*-commutative54.0%
associate-*l/61.1%
Simplified61.1%
Taylor expanded in t around 0 62.0%
if -7600 < y < 2.50000000000000014e-129Initial program 97.9%
*-commutative97.9%
associate-*l/90.7%
*-commutative90.7%
associate-*l/86.9%
Simplified86.9%
Taylor expanded in t around inf 71.8%
if 2.50000000000000014e-129 < y < 1.64999999999999991e-59Initial program 99.6%
*-commutative99.6%
associate-*l/99.8%
*-commutative99.8%
associate-*l/99.8%
Simplified99.8%
Taylor expanded in x around 0 73.1%
Taylor expanded in t around 0 73.1%
Taylor expanded in y around 0 66.3%
associate-/l*66.3%
distribute-lft-in66.3%
*-rgt-identity66.3%
Simplified66.3%
if 1.64999999999999991e-59 < y < 5.2e11Initial program 89.1%
*-commutative89.1%
associate-*l/89.1%
*-commutative89.1%
associate-*l/89.4%
Simplified89.4%
Taylor expanded in x around inf 73.3%
clear-num73.2%
inv-pow73.2%
associate-/l*73.3%
Applied egg-rr73.3%
unpow-173.3%
Simplified73.3%
Taylor expanded in a around 0 61.2%
associate-*l/61.3%
*-commutative61.3%
Simplified61.3%
Final simplification66.2%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (+ x (* y (/ z t))) (+ a 1.0))))
(if (<= t -9e-56)
t_1
(if (<= t 1.4e-136)
(/ (* y z) (+ (* y b) (* t (+ a 1.0))))
(if (<= t 1.65e-49) (/ z b) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x + (y * (z / t))) / (a + 1.0);
double tmp;
if (t <= -9e-56) {
tmp = t_1;
} else if (t <= 1.4e-136) {
tmp = (y * z) / ((y * b) + (t * (a + 1.0)));
} else if (t <= 1.65e-49) {
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 = (x + (y * (z / t))) / (a + 1.0d0)
if (t <= (-9d-56)) then
tmp = t_1
else if (t <= 1.4d-136) then
tmp = (y * z) / ((y * b) + (t * (a + 1.0d0)))
else if (t <= 1.65d-49) 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 = (x + (y * (z / t))) / (a + 1.0);
double tmp;
if (t <= -9e-56) {
tmp = t_1;
} else if (t <= 1.4e-136) {
tmp = (y * z) / ((y * b) + (t * (a + 1.0)));
} else if (t <= 1.65e-49) {
tmp = z / b;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (x + (y * (z / t))) / (a + 1.0) tmp = 0 if t <= -9e-56: tmp = t_1 elif t <= 1.4e-136: tmp = (y * z) / ((y * b) + (t * (a + 1.0))) elif t <= 1.65e-49: tmp = z / b else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(x + Float64(y * Float64(z / t))) / Float64(a + 1.0)) tmp = 0.0 if (t <= -9e-56) tmp = t_1; elseif (t <= 1.4e-136) tmp = Float64(Float64(y * z) / Float64(Float64(y * b) + Float64(t * Float64(a + 1.0)))); elseif (t <= 1.65e-49) tmp = Float64(z / b); 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 + 1.0); tmp = 0.0; if (t <= -9e-56) tmp = t_1; elseif (t <= 1.4e-136) tmp = (y * z) / ((y * b) + (t * (a + 1.0))); elseif (t <= 1.65e-49) tmp = z / b; 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] / N[(a + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -9e-56], t$95$1, If[LessEqual[t, 1.4e-136], N[(N[(y * z), $MachinePrecision] / N[(N[(y * b), $MachinePrecision] + N[(t * N[(a + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.65e-49], N[(z / b), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x + y \cdot \frac{z}{t}}{a + 1}\\
\mathbf{if}\;t \leq -9 \cdot 10^{-56}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 1.4 \cdot 10^{-136}:\\
\;\;\;\;\frac{y \cdot z}{y \cdot b + t \cdot \left(a + 1\right)}\\
\mathbf{elif}\;t \leq 1.65 \cdot 10^{-49}:\\
\;\;\;\;\frac{z}{b}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if t < -9.0000000000000001e-56 or 1.65e-49 < t Initial program 82.2%
*-commutative82.2%
associate-*l/84.2%
*-commutative84.2%
associate-*l/90.1%
Simplified90.1%
Taylor expanded in b around 0 74.0%
if -9.0000000000000001e-56 < t < 1.4e-136Initial program 68.5%
*-commutative68.5%
associate-*l/61.4%
*-commutative61.4%
associate-*l/57.2%
Simplified57.2%
Taylor expanded in x around 0 60.0%
Taylor expanded in t around 0 69.3%
if 1.4e-136 < t < 1.65e-49Initial program 56.6%
*-commutative56.6%
associate-*l/50.6%
*-commutative50.6%
associate-*l/50.6%
Simplified50.6%
Taylor expanded in t around 0 81.9%
Final simplification72.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ x (+ a 1.0))))
(if (<= y -280.0)
(/ z b)
(if (<= y 1.65e-130)
t_1
(if (<= y 1.65e-59)
(* (/ y t) (/ z (+ a 1.0)))
(if (<= y 4.1e+14) t_1 (/ z b)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x / (a + 1.0);
double tmp;
if (y <= -280.0) {
tmp = z / b;
} else if (y <= 1.65e-130) {
tmp = t_1;
} else if (y <= 1.65e-59) {
tmp = (y / t) * (z / (a + 1.0));
} else if (y <= 4.1e+14) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = x / (a + 1.0d0)
if (y <= (-280.0d0)) then
tmp = z / b
else if (y <= 1.65d-130) then
tmp = t_1
else if (y <= 1.65d-59) then
tmp = (y / t) * (z / (a + 1.0d0))
else if (y <= 4.1d+14) then
tmp = t_1
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 t_1 = x / (a + 1.0);
double tmp;
if (y <= -280.0) {
tmp = z / b;
} else if (y <= 1.65e-130) {
tmp = t_1;
} else if (y <= 1.65e-59) {
tmp = (y / t) * (z / (a + 1.0));
} else if (y <= 4.1e+14) {
tmp = t_1;
} else {
tmp = z / b;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x / (a + 1.0) tmp = 0 if y <= -280.0: tmp = z / b elif y <= 1.65e-130: tmp = t_1 elif y <= 1.65e-59: tmp = (y / t) * (z / (a + 1.0)) elif y <= 4.1e+14: tmp = t_1 else: tmp = z / b return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x / Float64(a + 1.0)) tmp = 0.0 if (y <= -280.0) tmp = Float64(z / b); elseif (y <= 1.65e-130) tmp = t_1; elseif (y <= 1.65e-59) tmp = Float64(Float64(y / t) * Float64(z / Float64(a + 1.0))); elseif (y <= 4.1e+14) 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 / (a + 1.0); tmp = 0.0; if (y <= -280.0) tmp = z / b; elseif (y <= 1.65e-130) tmp = t_1; elseif (y <= 1.65e-59) tmp = (y / t) * (z / (a + 1.0)); elseif (y <= 4.1e+14) tmp = t_1; else tmp = z / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x / N[(a + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -280.0], N[(z / b), $MachinePrecision], If[LessEqual[y, 1.65e-130], t$95$1, If[LessEqual[y, 1.65e-59], N[(N[(y / t), $MachinePrecision] * N[(z / N[(a + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4.1e+14], t$95$1, N[(z / b), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{a + 1}\\
\mathbf{if}\;y \leq -280:\\
\;\;\;\;\frac{z}{b}\\
\mathbf{elif}\;y \leq 1.65 \cdot 10^{-130}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 1.65 \cdot 10^{-59}:\\
\;\;\;\;\frac{y}{t} \cdot \frac{z}{a + 1}\\
\mathbf{elif}\;y \leq 4.1 \cdot 10^{+14}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{b}\\
\end{array}
\end{array}
if y < -280 or 4.1e14 < y Initial program 51.0%
*-commutative51.0%
associate-*l/53.6%
*-commutative53.6%
associate-*l/60.8%
Simplified60.8%
Taylor expanded in t around 0 62.5%
if -280 < y < 1.6499999999999999e-130 or 1.64999999999999991e-59 < y < 4.1e14Initial program 96.7%
*-commutative96.7%
associate-*l/90.5%
*-commutative90.5%
associate-*l/87.4%
Simplified87.4%
Taylor expanded in t around inf 69.0%
if 1.6499999999999999e-130 < y < 1.64999999999999991e-59Initial program 99.6%
*-commutative99.6%
associate-*l/99.8%
*-commutative99.8%
associate-*l/99.8%
Simplified99.8%
Taylor expanded in x around 0 73.1%
times-frac70.3%
+-commutative70.3%
associate-*l/70.3%
*-commutative70.3%
associate-+r+70.3%
fma-udef70.3%
Simplified70.3%
Taylor expanded in y around 0 63.5%
Final simplification65.7%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -1.7e+24) (not (<= y 3.6e+40))) (/ z b) (/ x (+ 1.0 (+ a (/ b (/ t y)))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -1.7e+24) || !(y <= 3.6e+40)) {
tmp = z / b;
} else {
tmp = x / (1.0 + (a + (b / (t / y))));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((y <= (-1.7d+24)) .or. (.not. (y <= 3.6d+40))) then
tmp = z / b
else
tmp = x / (1.0d0 + (a + (b / (t / y))))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -1.7e+24) || !(y <= 3.6e+40)) {
tmp = z / b;
} else {
tmp = x / (1.0 + (a + (b / (t / y))));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -1.7e+24) or not (y <= 3.6e+40): tmp = z / b else: tmp = x / (1.0 + (a + (b / (t / y)))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -1.7e+24) || !(y <= 3.6e+40)) tmp = Float64(z / b); else tmp = Float64(x / Float64(1.0 + Float64(a + Float64(b / Float64(t / y))))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -1.7e+24) || ~((y <= 3.6e+40))) tmp = z / b; else tmp = x / (1.0 + (a + (b / (t / y)))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -1.7e+24], N[Not[LessEqual[y, 3.6e+40]], $MachinePrecision]], N[(z / b), $MachinePrecision], N[(x / N[(1.0 + N[(a + N[(b / N[(t / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.7 \cdot 10^{+24} \lor \neg \left(y \leq 3.6 \cdot 10^{+40}\right):\\
\;\;\;\;\frac{z}{b}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{1 + \left(a + \frac{b}{\frac{t}{y}}\right)}\\
\end{array}
\end{array}
if y < -1.7e24 or 3.59999999999999996e40 < y Initial program 48.9%
*-commutative48.9%
associate-*l/51.6%
*-commutative51.6%
associate-*l/59.1%
Simplified59.1%
Taylor expanded in t around 0 63.4%
if -1.7e24 < y < 3.59999999999999996e40Initial program 97.0%
*-commutative97.0%
associate-/l*95.7%
associate-*l/95.8%
*-commutative95.8%
cancel-sign-sub95.8%
*-commutative95.8%
associate-*l/95.7%
associate-+r-95.7%
associate-*l/95.8%
*-commutative95.8%
cancel-sign-sub95.8%
*-commutative95.8%
associate-/r/90.3%
Simplified90.3%
*-un-lft-identity90.3%
div-inv90.3%
times-frac91.6%
Applied egg-rr91.6%
Taylor expanded in x around inf 74.5%
associate-/l*74.5%
Simplified74.5%
Final simplification69.6%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -2.8e+71) (not (<= y 7e+15))) (/ z b) (/ (+ x (* y (/ z t))) (+ a 1.0))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -2.8e+71) || !(y <= 7e+15)) {
tmp = z / b;
} else {
tmp = (x + (y * (z / t))) / (a + 1.0);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((y <= (-2.8d+71)) .or. (.not. (y <= 7d+15))) then
tmp = z / b
else
tmp = (x + (y * (z / t))) / (a + 1.0d0)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -2.8e+71) || !(y <= 7e+15)) {
tmp = z / b;
} else {
tmp = (x + (y * (z / t))) / (a + 1.0);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -2.8e+71) or not (y <= 7e+15): tmp = z / b else: tmp = (x + (y * (z / t))) / (a + 1.0) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -2.8e+71) || !(y <= 7e+15)) tmp = Float64(z / b); else tmp = Float64(Float64(x + Float64(y * Float64(z / t))) / Float64(a + 1.0)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -2.8e+71) || ~((y <= 7e+15))) tmp = z / b; else tmp = (x + (y * (z / t))) / (a + 1.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -2.8e+71], N[Not[LessEqual[y, 7e+15]], $MachinePrecision]], N[(z / b), $MachinePrecision], N[(N[(x + N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(a + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.8 \cdot 10^{+71} \lor \neg \left(y \leq 7 \cdot 10^{+15}\right):\\
\;\;\;\;\frac{z}{b}\\
\mathbf{else}:\\
\;\;\;\;\frac{x + y \cdot \frac{z}{t}}{a + 1}\\
\end{array}
\end{array}
if y < -2.80000000000000002e71 or 7e15 < y Initial program 45.2%
*-commutative45.2%
associate-*l/47.2%
*-commutative47.2%
associate-*l/55.7%
Simplified55.7%
Taylor expanded in t around 0 65.3%
if -2.80000000000000002e71 < y < 7e15Initial program 95.4%
*-commutative95.4%
associate-*l/91.2%
*-commutative91.2%
associate-*l/88.6%
Simplified88.6%
Taylor expanded in b around 0 76.6%
Final simplification72.1%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -5e+70) (not (<= y 4.5e+16))) (/ z b) (/ (+ x (/ z (/ t y))) (+ a 1.0))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -5e+70) || !(y <= 4.5e+16)) {
tmp = z / b;
} else {
tmp = (x + (z / (t / y))) / (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 <= (-5d+70)) .or. (.not. (y <= 4.5d+16))) then
tmp = z / b
else
tmp = (x + (z / (t / y))) / (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 <= -5e+70) || !(y <= 4.5e+16)) {
tmp = z / b;
} else {
tmp = (x + (z / (t / y))) / (a + 1.0);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -5e+70) or not (y <= 4.5e+16): tmp = z / b else: tmp = (x + (z / (t / y))) / (a + 1.0) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -5e+70) || !(y <= 4.5e+16)) tmp = Float64(z / b); else tmp = Float64(Float64(x + Float64(z / Float64(t / y))) / Float64(a + 1.0)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -5e+70) || ~((y <= 4.5e+16))) tmp = z / b; else tmp = (x + (z / (t / y))) / (a + 1.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -5e+70], N[Not[LessEqual[y, 4.5e+16]], $MachinePrecision]], N[(z / b), $MachinePrecision], N[(N[(x + N[(z / N[(t / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(a + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -5 \cdot 10^{+70} \lor \neg \left(y \leq 4.5 \cdot 10^{+16}\right):\\
\;\;\;\;\frac{z}{b}\\
\mathbf{else}:\\
\;\;\;\;\frac{x + \frac{z}{\frac{t}{y}}}{a + 1}\\
\end{array}
\end{array}
if y < -5.0000000000000002e70 or 4.5e16 < y Initial program 45.2%
*-commutative45.2%
associate-*l/47.2%
*-commutative47.2%
associate-*l/55.7%
Simplified55.7%
Taylor expanded in t around 0 65.3%
if -5.0000000000000002e70 < y < 4.5e16Initial program 95.4%
*-commutative95.4%
associate-/l*94.2%
associate-*l/94.2%
*-commutative94.2%
cancel-sign-sub94.2%
*-commutative94.2%
associate-*l/94.2%
associate-+r-94.2%
associate-*l/94.2%
*-commutative94.2%
cancel-sign-sub94.2%
*-commutative94.2%
associate-/r/89.3%
Simplified89.3%
Taylor expanded in y around 0 77.8%
Final simplification72.9%
(FPCore (x y z t a b) :precision binary64 (if (<= y -650.0) (/ z b) (if (<= y -6.5e-244) x (if (<= y 4.2e-66) (/ x a) (/ z b)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -650.0) {
tmp = z / b;
} else if (y <= -6.5e-244) {
tmp = x;
} else if (y <= 4.2e-66) {
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 <= (-650.0d0)) then
tmp = z / b
else if (y <= (-6.5d-244)) then
tmp = x
else if (y <= 4.2d-66) 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 <= -650.0) {
tmp = z / b;
} else if (y <= -6.5e-244) {
tmp = x;
} else if (y <= 4.2e-66) {
tmp = x / a;
} else {
tmp = z / b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -650.0: tmp = z / b elif y <= -6.5e-244: tmp = x elif y <= 4.2e-66: tmp = x / a else: tmp = z / b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -650.0) tmp = Float64(z / b); elseif (y <= -6.5e-244) tmp = x; elseif (y <= 4.2e-66) 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 <= -650.0) tmp = z / b; elseif (y <= -6.5e-244) tmp = x; elseif (y <= 4.2e-66) tmp = x / a; else tmp = z / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -650.0], N[(z / b), $MachinePrecision], If[LessEqual[y, -6.5e-244], x, If[LessEqual[y, 4.2e-66], N[(x / a), $MachinePrecision], N[(z / b), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -650:\\
\;\;\;\;\frac{z}{b}\\
\mathbf{elif}\;y \leq -6.5 \cdot 10^{-244}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 4.2 \cdot 10^{-66}:\\
\;\;\;\;\frac{x}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{b}\\
\end{array}
\end{array}
if y < -650 or 4.2000000000000001e-66 < y Initial program 57.3%
*-commutative57.3%
associate-*l/59.4%
*-commutative59.4%
associate-*l/65.5%
Simplified65.5%
Taylor expanded in t around 0 55.6%
if -650 < y < -6.4999999999999994e-244Initial program 97.7%
*-commutative97.7%
associate-*l/93.5%
*-commutative93.5%
associate-*l/93.3%
Simplified93.3%
Taylor expanded in t around inf 70.8%
Taylor expanded in a around 0 41.0%
if -6.4999999999999994e-244 < y < 4.2000000000000001e-66Initial program 98.3%
*-commutative98.3%
associate-*l/90.2%
*-commutative90.2%
associate-*l/84.7%
Simplified84.7%
Taylor expanded in x around inf 74.3%
Taylor expanded in a around inf 43.0%
Final simplification49.6%
(FPCore (x y z t a b) :precision binary64 (if (<= y -1750000.0) (/ z b) (if (<= y 8.5e+14) (/ x (+ a 1.0)) (/ z b))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -1750000.0) {
tmp = z / b;
} else if (y <= 8.5e+14) {
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 <= (-1750000.0d0)) then
tmp = z / b
else if (y <= 8.5d+14) 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 <= -1750000.0) {
tmp = z / b;
} else if (y <= 8.5e+14) {
tmp = x / (a + 1.0);
} else {
tmp = z / b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -1750000.0: tmp = z / b elif y <= 8.5e+14: tmp = x / (a + 1.0) else: tmp = z / b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -1750000.0) tmp = Float64(z / b); elseif (y <= 8.5e+14) 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 <= -1750000.0) tmp = z / b; elseif (y <= 8.5e+14) tmp = x / (a + 1.0); else tmp = z / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -1750000.0], N[(z / b), $MachinePrecision], If[LessEqual[y, 8.5e+14], N[(x / N[(a + 1.0), $MachinePrecision]), $MachinePrecision], N[(z / b), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1750000:\\
\;\;\;\;\frac{z}{b}\\
\mathbf{elif}\;y \leq 8.5 \cdot 10^{+14}:\\
\;\;\;\;\frac{x}{a + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{b}\\
\end{array}
\end{array}
if y < -1.75e6 or 8.5e14 < y Initial program 51.0%
*-commutative51.0%
associate-*l/53.6%
*-commutative53.6%
associate-*l/60.8%
Simplified60.8%
Taylor expanded in t around 0 62.5%
if -1.75e6 < y < 8.5e14Initial program 96.9%
*-commutative96.9%
associate-*l/91.4%
*-commutative91.4%
associate-*l/88.6%
Simplified88.6%
Taylor expanded in t around inf 65.5%
Final simplification64.1%
(FPCore (x y z t a b) :precision binary64 (if (<= a -1.95e-13) (/ x a) (if (<= a 1.0) x (/ x a))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -1.95e-13) {
tmp = x / a;
} else if (a <= 1.0) {
tmp = x;
} 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 <= (-1.95d-13)) then
tmp = x / a
else if (a <= 1.0d0) then
tmp = x
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 <= -1.95e-13) {
tmp = x / a;
} else if (a <= 1.0) {
tmp = x;
} else {
tmp = x / a;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if a <= -1.95e-13: tmp = x / a elif a <= 1.0: tmp = x else: tmp = x / a return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (a <= -1.95e-13) tmp = Float64(x / a); elseif (a <= 1.0) tmp = x; else tmp = Float64(x / a); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (a <= -1.95e-13) tmp = x / a; elseif (a <= 1.0) tmp = x; else tmp = x / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, -1.95e-13], N[(x / a), $MachinePrecision], If[LessEqual[a, 1.0], x, N[(x / a), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.95 \cdot 10^{-13}:\\
\;\;\;\;\frac{x}{a}\\
\mathbf{elif}\;a \leq 1:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{a}\\
\end{array}
\end{array}
if a < -1.95000000000000002e-13 or 1 < a Initial program 75.5%
*-commutative75.5%
associate-*l/72.6%
*-commutative72.6%
associate-*l/74.0%
Simplified74.0%
Taylor expanded in x around inf 48.8%
Taylor expanded in a around inf 44.4%
if -1.95000000000000002e-13 < a < 1Initial program 75.7%
*-commutative75.7%
associate-*l/75.1%
*-commutative75.1%
associate-*l/77.3%
Simplified77.3%
Taylor expanded in t around inf 37.8%
Taylor expanded in a around 0 37.2%
Final simplification40.8%
(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 75.6%
*-commutative75.6%
associate-*l/73.8%
*-commutative73.8%
associate-*l/75.6%
Simplified75.6%
Taylor expanded in t around inf 41.4%
Taylor expanded in a around 0 20.7%
Final simplification20.7%
(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 2023287
(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))))