
(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 14 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)))
(t_2 (/ t_1 (+ (+ a 1.0) (/ (* y b) t))))
(t_3 (/ y (/ (+ t (+ (* y b) (* t a))) z))))
(if (<= t_2 (- INFINITY))
t_3
(if (<= t_2 -2e-320)
(/ t_1 (+ (+ a 1.0) (* (* y b) (/ 1.0 t))))
(if (<= t_2 0.0)
t_3
(if (<= t_2 5e+290) t_2 (if (<= t_2 INFINITY) t_3 (/ z b))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x + ((y * z) / t);
double t_2 = t_1 / ((a + 1.0) + ((y * b) / t));
double t_3 = y / ((t + ((y * b) + (t * a))) / z);
double tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = t_3;
} else if (t_2 <= -2e-320) {
tmp = t_1 / ((a + 1.0) + ((y * b) * (1.0 / t)));
} else if (t_2 <= 0.0) {
tmp = t_3;
} else if (t_2 <= 5e+290) {
tmp = t_2;
} else if (t_2 <= ((double) INFINITY)) {
tmp = t_3;
} 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);
double t_2 = t_1 / ((a + 1.0) + ((y * b) / t));
double t_3 = y / ((t + ((y * b) + (t * a))) / z);
double tmp;
if (t_2 <= -Double.POSITIVE_INFINITY) {
tmp = t_3;
} else if (t_2 <= -2e-320) {
tmp = t_1 / ((a + 1.0) + ((y * b) * (1.0 / t)));
} else if (t_2 <= 0.0) {
tmp = t_3;
} else if (t_2 <= 5e+290) {
tmp = t_2;
} else if (t_2 <= Double.POSITIVE_INFINITY) {
tmp = t_3;
} else {
tmp = z / b;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x + ((y * z) / t) t_2 = t_1 / ((a + 1.0) + ((y * b) / t)) t_3 = y / ((t + ((y * b) + (t * a))) / z) tmp = 0 if t_2 <= -math.inf: tmp = t_3 elif t_2 <= -2e-320: tmp = t_1 / ((a + 1.0) + ((y * b) * (1.0 / t))) elif t_2 <= 0.0: tmp = t_3 elif t_2 <= 5e+290: tmp = t_2 elif t_2 <= math.inf: tmp = t_3 else: tmp = z / b return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x + Float64(Float64(y * z) / t)) t_2 = Float64(t_1 / Float64(Float64(a + 1.0) + Float64(Float64(y * b) / t))) t_3 = Float64(y / Float64(Float64(t + Float64(Float64(y * b) + Float64(t * a))) / z)) tmp = 0.0 if (t_2 <= Float64(-Inf)) tmp = t_3; elseif (t_2 <= -2e-320) tmp = Float64(t_1 / Float64(Float64(a + 1.0) + Float64(Float64(y * b) * Float64(1.0 / t)))); elseif (t_2 <= 0.0) tmp = t_3; elseif (t_2 <= 5e+290) tmp = t_2; elseif (t_2 <= Inf) tmp = t_3; 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); t_2 = t_1 / ((a + 1.0) + ((y * b) / t)); t_3 = y / ((t + ((y * b) + (t * a))) / z); tmp = 0.0; if (t_2 <= -Inf) tmp = t_3; elseif (t_2 <= -2e-320) tmp = t_1 / ((a + 1.0) + ((y * b) * (1.0 / t))); elseif (t_2 <= 0.0) tmp = t_3; elseif (t_2 <= 5e+290) tmp = t_2; elseif (t_2 <= Inf) tmp = t_3; else tmp = z / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 / N[(N[(a + 1.0), $MachinePrecision] + N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(y / N[(N[(t + N[(N[(y * b), $MachinePrecision] + N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], t$95$3, If[LessEqual[t$95$2, -2e-320], N[(t$95$1 / N[(N[(a + 1.0), $MachinePrecision] + N[(N[(y * b), $MachinePrecision] * N[(1.0 / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 0.0], t$95$3, If[LessEqual[t$95$2, 5e+290], t$95$2, If[LessEqual[t$95$2, Infinity], t$95$3, N[(z / b), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \frac{y \cdot z}{t}\\
t_2 := \frac{t_1}{\left(a + 1\right) + \frac{y \cdot b}{t}}\\
t_3 := \frac{y}{\frac{t + \left(y \cdot b + t \cdot a\right)}{z}}\\
\mathbf{if}\;t_2 \leq -\infty:\\
\;\;\;\;t_3\\
\mathbf{elif}\;t_2 \leq -2 \cdot 10^{-320}:\\
\;\;\;\;\frac{t_1}{\left(a + 1\right) + \left(y \cdot b\right) \cdot \frac{1}{t}}\\
\mathbf{elif}\;t_2 \leq 0:\\
\;\;\;\;t_3\\
\mathbf{elif}\;t_2 \leq 5 \cdot 10^{+290}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t_2 \leq \infty:\\
\;\;\;\;t_3\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{b}\\
\end{array}
\end{array}
if (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < -inf.0 or -1.99998e-320 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < -0.0 or 4.9999999999999998e290 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < +inf.0Initial program 48.8%
*-commutative48.8%
associate-/l*47.7%
associate-*l/44.7%
Simplified44.7%
Taylor expanded in x around 0 59.5%
associate-/l*75.6%
distribute-lft-in75.6%
*-rgt-identity75.6%
associate-*r/74.1%
fma-def74.1%
Simplified74.1%
Taylor expanded in t around 0 83.6%
if -inf.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < -1.99998e-320Initial program 99.7%
associate-/l*94.0%
Simplified94.0%
associate-/l*99.7%
div-inv99.8%
Applied egg-rr99.8%
if -0.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < 4.9999999999999998e290Initial program 99.8%
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.0%
associate-*l/0.2%
Simplified0.2%
Taylor expanded in t around 0 100.0%
Final simplification95.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (+ x (/ (* y z) t)) (+ (+ a 1.0) (/ (* y b) t))))
(t_2 (/ y (/ (+ t (+ (* y b) (* t a))) z))))
(if (<= t_1 (- INFINITY))
t_2
(if (<= t_1 -2e-320)
t_1
(if (<= t_1 0.0)
t_2
(if (<= t_1 5e+290) 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 = y / ((t + ((y * b) + (t * a))) / z);
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = t_2;
} else if (t_1 <= -2e-320) {
tmp = t_1;
} else if (t_1 <= 0.0) {
tmp = t_2;
} else if (t_1 <= 5e+290) {
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 = y / ((t + ((y * b) + (t * a))) / z);
double tmp;
if (t_1 <= -Double.POSITIVE_INFINITY) {
tmp = t_2;
} else if (t_1 <= -2e-320) {
tmp = t_1;
} else if (t_1 <= 0.0) {
tmp = t_2;
} else if (t_1 <= 5e+290) {
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 = y / ((t + ((y * b) + (t * a))) / z) tmp = 0 if t_1 <= -math.inf: tmp = t_2 elif t_1 <= -2e-320: tmp = t_1 elif t_1 <= 0.0: tmp = t_2 elif t_1 <= 5e+290: 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(y / Float64(Float64(t + Float64(Float64(y * b) + Float64(t * a))) / z)) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = t_2; elseif (t_1 <= -2e-320) tmp = t_1; elseif (t_1 <= 0.0) tmp = t_2; elseif (t_1 <= 5e+290) 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 = y / ((t + ((y * b) + (t * a))) / z); tmp = 0.0; if (t_1 <= -Inf) tmp = t_2; elseif (t_1 <= -2e-320) tmp = t_1; elseif (t_1 <= 0.0) tmp = t_2; elseif (t_1 <= 5e+290) 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[(y / N[(N[(t + N[(N[(y * b), $MachinePrecision] + N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], t$95$2, If[LessEqual[t$95$1, -2e-320], t$95$1, If[LessEqual[t$95$1, 0.0], t$95$2, If[LessEqual[t$95$1, 5e+290], 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{y}{\frac{t + \left(y \cdot b + t \cdot a\right)}{z}}\\
\mathbf{if}\;t_1 \leq -\infty:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t_1 \leq -2 \cdot 10^{-320}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t_1 \leq 0:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t_1 \leq 5 \cdot 10^{+290}:\\
\;\;\;\;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 -1.99998e-320 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < -0.0 or 4.9999999999999998e290 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < +inf.0Initial program 48.8%
*-commutative48.8%
associate-/l*47.7%
associate-*l/44.7%
Simplified44.7%
Taylor expanded in x around 0 59.5%
associate-/l*75.6%
distribute-lft-in75.6%
*-rgt-identity75.6%
associate-*r/74.1%
fma-def74.1%
Simplified74.1%
Taylor expanded in t around 0 83.6%
if -inf.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < -1.99998e-320 or -0.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < 4.9999999999999998e290Initial program 99.8%
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.0%
associate-*l/0.2%
Simplified0.2%
Taylor expanded in t around 0 100.0%
Final simplification95.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ (+ a 1.0) (/ (* y b) t)))
(t_2 (/ (+ x (/ (* y z) t)) t_1))
(t_3 (/ y (/ (+ t (+ (* y b) (* t a))) z))))
(if (<= t_2 (- INFINITY))
t_3
(if (<= t_2 -2e-320)
(/ (+ x (* (* y z) (/ 1.0 t))) t_1)
(if (<= t_2 0.0)
t_3
(if (<= t_2 5e+290) t_2 (if (<= t_2 INFINITY) t_3 (/ z b))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (a + 1.0) + ((y * b) / t);
double t_2 = (x + ((y * z) / t)) / t_1;
double t_3 = y / ((t + ((y * b) + (t * a))) / z);
double tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = t_3;
} else if (t_2 <= -2e-320) {
tmp = (x + ((y * z) * (1.0 / t))) / t_1;
} else if (t_2 <= 0.0) {
tmp = t_3;
} else if (t_2 <= 5e+290) {
tmp = t_2;
} else if (t_2 <= ((double) INFINITY)) {
tmp = t_3;
} 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 = (a + 1.0) + ((y * b) / t);
double t_2 = (x + ((y * z) / t)) / t_1;
double t_3 = y / ((t + ((y * b) + (t * a))) / z);
double tmp;
if (t_2 <= -Double.POSITIVE_INFINITY) {
tmp = t_3;
} else if (t_2 <= -2e-320) {
tmp = (x + ((y * z) * (1.0 / t))) / t_1;
} else if (t_2 <= 0.0) {
tmp = t_3;
} else if (t_2 <= 5e+290) {
tmp = t_2;
} else if (t_2 <= Double.POSITIVE_INFINITY) {
tmp = t_3;
} else {
tmp = z / b;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (a + 1.0) + ((y * b) / t) t_2 = (x + ((y * z) / t)) / t_1 t_3 = y / ((t + ((y * b) + (t * a))) / z) tmp = 0 if t_2 <= -math.inf: tmp = t_3 elif t_2 <= -2e-320: tmp = (x + ((y * z) * (1.0 / t))) / t_1 elif t_2 <= 0.0: tmp = t_3 elif t_2 <= 5e+290: tmp = t_2 elif t_2 <= math.inf: tmp = t_3 else: tmp = z / b return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(a + 1.0) + Float64(Float64(y * b) / t)) t_2 = Float64(Float64(x + Float64(Float64(y * z) / t)) / t_1) t_3 = Float64(y / Float64(Float64(t + Float64(Float64(y * b) + Float64(t * a))) / z)) tmp = 0.0 if (t_2 <= Float64(-Inf)) tmp = t_3; elseif (t_2 <= -2e-320) tmp = Float64(Float64(x + Float64(Float64(y * z) * Float64(1.0 / t))) / t_1); elseif (t_2 <= 0.0) tmp = t_3; elseif (t_2 <= 5e+290) tmp = t_2; elseif (t_2 <= Inf) tmp = t_3; else tmp = Float64(z / b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (a + 1.0) + ((y * b) / t); t_2 = (x + ((y * z) / t)) / t_1; t_3 = y / ((t + ((y * b) + (t * a))) / z); tmp = 0.0; if (t_2 <= -Inf) tmp = t_3; elseif (t_2 <= -2e-320) tmp = (x + ((y * z) * (1.0 / t))) / t_1; elseif (t_2 <= 0.0) tmp = t_3; elseif (t_2 <= 5e+290) tmp = t_2; elseif (t_2 <= Inf) tmp = t_3; else tmp = z / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(a + 1.0), $MachinePrecision] + N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[(y / N[(N[(t + N[(N[(y * b), $MachinePrecision] + N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], t$95$3, If[LessEqual[t$95$2, -2e-320], N[(N[(x + N[(N[(y * z), $MachinePrecision] * N[(1.0 / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision], If[LessEqual[t$95$2, 0.0], t$95$3, If[LessEqual[t$95$2, 5e+290], t$95$2, If[LessEqual[t$95$2, Infinity], t$95$3, N[(z / b), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(a + 1\right) + \frac{y \cdot b}{t}\\
t_2 := \frac{x + \frac{y \cdot z}{t}}{t_1}\\
t_3 := \frac{y}{\frac{t + \left(y \cdot b + t \cdot a\right)}{z}}\\
\mathbf{if}\;t_2 \leq -\infty:\\
\;\;\;\;t_3\\
\mathbf{elif}\;t_2 \leq -2 \cdot 10^{-320}:\\
\;\;\;\;\frac{x + \left(y \cdot z\right) \cdot \frac{1}{t}}{t_1}\\
\mathbf{elif}\;t_2 \leq 0:\\
\;\;\;\;t_3\\
\mathbf{elif}\;t_2 \leq 5 \cdot 10^{+290}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t_2 \leq \infty:\\
\;\;\;\;t_3\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{b}\\
\end{array}
\end{array}
if (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < -inf.0 or -1.99998e-320 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < -0.0 or 4.9999999999999998e290 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < +inf.0Initial program 48.8%
*-commutative48.8%
associate-/l*47.7%
associate-*l/44.7%
Simplified44.7%
Taylor expanded in x around 0 59.5%
associate-/l*75.6%
distribute-lft-in75.6%
*-rgt-identity75.6%
associate-*r/74.1%
fma-def74.1%
Simplified74.1%
Taylor expanded in t around 0 83.6%
if -inf.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < -1.99998e-320Initial program 99.7%
div-inv99.8%
*-commutative99.8%
Applied egg-rr99.8%
if -0.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < 4.9999999999999998e290Initial program 99.8%
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.0%
associate-*l/0.2%
Simplified0.2%
Taylor expanded in t around 0 100.0%
Final simplification95.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* b (/ y t))))
(if (<= t -7e-61)
(/ (+ x (/ (* y z) t)) (+ a 1.0))
(if (<= t 2.05e+17)
(/ y (/ (+ t (+ (* y b) (* t a))) z))
(if (<= t 1.75e+87)
(/ x (+ 1.0 (+ a (/ (* y b) t))))
(if (<= t 3.4e+119)
(* (/ y t) (/ z (+ 1.0 (+ a t_1))))
(/ x (+ (+ a 1.0) t_1))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = b * (y / t);
double tmp;
if (t <= -7e-61) {
tmp = (x + ((y * z) / t)) / (a + 1.0);
} else if (t <= 2.05e+17) {
tmp = y / ((t + ((y * b) + (t * a))) / z);
} else if (t <= 1.75e+87) {
tmp = x / (1.0 + (a + ((y * b) / t)));
} else if (t <= 3.4e+119) {
tmp = (y / t) * (z / (1.0 + (a + t_1)));
} else {
tmp = x / ((a + 1.0) + 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 = b * (y / t)
if (t <= (-7d-61)) then
tmp = (x + ((y * z) / t)) / (a + 1.0d0)
else if (t <= 2.05d+17) then
tmp = y / ((t + ((y * b) + (t * a))) / z)
else if (t <= 1.75d+87) then
tmp = x / (1.0d0 + (a + ((y * b) / t)))
else if (t <= 3.4d+119) then
tmp = (y / t) * (z / (1.0d0 + (a + t_1)))
else
tmp = x / ((a + 1.0d0) + 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 = b * (y / t);
double tmp;
if (t <= -7e-61) {
tmp = (x + ((y * z) / t)) / (a + 1.0);
} else if (t <= 2.05e+17) {
tmp = y / ((t + ((y * b) + (t * a))) / z);
} else if (t <= 1.75e+87) {
tmp = x / (1.0 + (a + ((y * b) / t)));
} else if (t <= 3.4e+119) {
tmp = (y / t) * (z / (1.0 + (a + t_1)));
} else {
tmp = x / ((a + 1.0) + t_1);
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = b * (y / t) tmp = 0 if t <= -7e-61: tmp = (x + ((y * z) / t)) / (a + 1.0) elif t <= 2.05e+17: tmp = y / ((t + ((y * b) + (t * a))) / z) elif t <= 1.75e+87: tmp = x / (1.0 + (a + ((y * b) / t))) elif t <= 3.4e+119: tmp = (y / t) * (z / (1.0 + (a + t_1))) else: tmp = x / ((a + 1.0) + t_1) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(b * Float64(y / t)) tmp = 0.0 if (t <= -7e-61) tmp = Float64(Float64(x + Float64(Float64(y * z) / t)) / Float64(a + 1.0)); elseif (t <= 2.05e+17) tmp = Float64(y / Float64(Float64(t + Float64(Float64(y * b) + Float64(t * a))) / z)); elseif (t <= 1.75e+87) tmp = Float64(x / Float64(1.0 + Float64(a + Float64(Float64(y * b) / t)))); elseif (t <= 3.4e+119) tmp = Float64(Float64(y / t) * Float64(z / Float64(1.0 + Float64(a + t_1)))); else tmp = Float64(x / Float64(Float64(a + 1.0) + t_1)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = b * (y / t); tmp = 0.0; if (t <= -7e-61) tmp = (x + ((y * z) / t)) / (a + 1.0); elseif (t <= 2.05e+17) tmp = y / ((t + ((y * b) + (t * a))) / z); elseif (t <= 1.75e+87) tmp = x / (1.0 + (a + ((y * b) / t))); elseif (t <= 3.4e+119) tmp = (y / t) * (z / (1.0 + (a + t_1))); else tmp = x / ((a + 1.0) + t_1); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(b * N[(y / t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -7e-61], N[(N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] / N[(a + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.05e+17], N[(y / N[(N[(t + N[(N[(y * b), $MachinePrecision] + N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.75e+87], N[(x / N[(1.0 + N[(a + N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3.4e+119], N[(N[(y / t), $MachinePrecision] * N[(z / N[(1.0 + N[(a + t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x / N[(N[(a + 1.0), $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := b \cdot \frac{y}{t}\\
\mathbf{if}\;t \leq -7 \cdot 10^{-61}:\\
\;\;\;\;\frac{x + \frac{y \cdot z}{t}}{a + 1}\\
\mathbf{elif}\;t \leq 2.05 \cdot 10^{+17}:\\
\;\;\;\;\frac{y}{\frac{t + \left(y \cdot b + t \cdot a\right)}{z}}\\
\mathbf{elif}\;t \leq 1.75 \cdot 10^{+87}:\\
\;\;\;\;\frac{x}{1 + \left(a + \frac{y \cdot b}{t}\right)}\\
\mathbf{elif}\;t \leq 3.4 \cdot 10^{+119}:\\
\;\;\;\;\frac{y}{t} \cdot \frac{z}{1 + \left(a + t_1\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\left(a + 1\right) + t_1}\\
\end{array}
\end{array}
if t < -7.0000000000000006e-61Initial program 89.5%
*-commutative89.5%
associate-/l*86.9%
associate-*l/88.6%
Simplified88.6%
Taylor expanded in b around 0 85.2%
if -7.0000000000000006e-61 < t < 2.05e17Initial program 61.6%
*-commutative61.6%
associate-/l*53.9%
associate-*l/50.2%
Simplified50.2%
Taylor expanded in x around 0 45.4%
associate-/l*47.9%
distribute-lft-in47.9%
*-rgt-identity47.9%
associate-*r/44.6%
fma-def44.6%
Simplified44.6%
Taylor expanded in t around 0 65.5%
if 2.05e17 < t < 1.74999999999999993e87Initial program 90.4%
*-commutative90.4%
associate-/l*90.4%
associate-*l/90.2%
Simplified90.2%
Taylor expanded in x around inf 85.5%
if 1.74999999999999993e87 < t < 3.40000000000000013e119Initial program 81.1%
add-cube-cbrt79.0%
pow279.0%
associate-/l*60.2%
associate-/l*78.1%
Applied egg-rr78.1%
Taylor expanded in x around 0 81.1%
times-frac93.4%
associate-/l*93.1%
+-commutative93.1%
associate-/r/93.1%
Simplified93.1%
if 3.40000000000000013e119 < t Initial program 91.3%
*-commutative91.3%
associate-/l*92.9%
associate-*l/95.8%
Simplified95.8%
Taylor expanded in x around inf 83.2%
Final simplification75.8%
(FPCore (x y z t a b) :precision binary64 (if (or (<= t -4.8e-165) (not (<= t 4.6e-128))) (/ (+ x (* y (/ z t))) (+ (+ a 1.0) (* b (/ y t)))) (/ z b)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -4.8e-165) || !(t <= 4.6e-128)) {
tmp = (x + (y * (z / t))) / ((a + 1.0) + (b * (y / 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 ((t <= (-4.8d-165)) .or. (.not. (t <= 4.6d-128))) then
tmp = (x + (y * (z / t))) / ((a + 1.0d0) + (b * (y / 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 ((t <= -4.8e-165) || !(t <= 4.6e-128)) {
tmp = (x + (y * (z / t))) / ((a + 1.0) + (b * (y / t)));
} else {
tmp = z / b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (t <= -4.8e-165) or not (t <= 4.6e-128): tmp = (x + (y * (z / t))) / ((a + 1.0) + (b * (y / t))) else: tmp = z / b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((t <= -4.8e-165) || !(t <= 4.6e-128)) tmp = Float64(Float64(x + Float64(y * Float64(z / t))) / Float64(Float64(a + 1.0) + Float64(b * Float64(y / t)))); else tmp = Float64(z / b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((t <= -4.8e-165) || ~((t <= 4.6e-128))) tmp = (x + (y * (z / t))) / ((a + 1.0) + (b * (y / t))); else tmp = z / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[t, -4.8e-165], N[Not[LessEqual[t, 4.6e-128]], $MachinePrecision]], N[(N[(x + N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(a + 1.0), $MachinePrecision] + N[(b * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z / b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4.8 \cdot 10^{-165} \lor \neg \left(t \leq 4.6 \cdot 10^{-128}\right):\\
\;\;\;\;\frac{x + y \cdot \frac{z}{t}}{\left(a + 1\right) + b \cdot \frac{y}{t}}\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{b}\\
\end{array}
\end{array}
if t < -4.8000000000000004e-165 or 4.6000000000000002e-128 < t Initial program 86.0%
*-commutative86.0%
associate-/l*84.3%
associate-*l/85.5%
Simplified85.5%
associate-/r/85.2%
Applied egg-rr85.2%
if -4.8000000000000004e-165 < t < 4.6000000000000002e-128Initial program 51.8%
*-commutative51.8%
associate-/l*42.1%
associate-*l/35.9%
Simplified35.9%
Taylor expanded in t around 0 70.6%
Final simplification81.2%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ (+ a 1.0) (* b (/ y t)))))
(if (<= t -4.6e-167)
(/ (+ x (* y (/ z t))) t_1)
(if (<= t 2.6e-128) (/ z b) (/ (+ x (/ z (/ t y))) 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 <= -4.6e-167) {
tmp = (x + (y * (z / t))) / t_1;
} else if (t <= 2.6e-128) {
tmp = z / b;
} else {
tmp = (x + (z / (t / y))) / 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 <= (-4.6d-167)) then
tmp = (x + (y * (z / t))) / t_1
else if (t <= 2.6d-128) then
tmp = z / b
else
tmp = (x + (z / (t / y))) / 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 <= -4.6e-167) {
tmp = (x + (y * (z / t))) / t_1;
} else if (t <= 2.6e-128) {
tmp = z / b;
} else {
tmp = (x + (z / (t / y))) / t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (a + 1.0) + (b * (y / t)) tmp = 0 if t <= -4.6e-167: tmp = (x + (y * (z / t))) / t_1 elif t <= 2.6e-128: tmp = z / b else: tmp = (x + (z / (t / y))) / 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 <= -4.6e-167) tmp = Float64(Float64(x + Float64(y * Float64(z / t))) / t_1); elseif (t <= 2.6e-128) tmp = Float64(z / b); else tmp = Float64(Float64(x + Float64(z / Float64(t / y))) / 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 <= -4.6e-167) tmp = (x + (y * (z / t))) / t_1; elseif (t <= 2.6e-128) tmp = z / b; else tmp = (x + (z / (t / y))) / 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, -4.6e-167], N[(N[(x + N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision], If[LessEqual[t, 2.6e-128], N[(z / b), $MachinePrecision], N[(N[(x + N[(z / N[(t / y), $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 -4.6 \cdot 10^{-167}:\\
\;\;\;\;\frac{x + y \cdot \frac{z}{t}}{t_1}\\
\mathbf{elif}\;t \leq 2.6 \cdot 10^{-128}:\\
\;\;\;\;\frac{z}{b}\\
\mathbf{else}:\\
\;\;\;\;\frac{x + \frac{z}{\frac{t}{y}}}{t_1}\\
\end{array}
\end{array}
if t < -4.6000000000000003e-167Initial program 87.9%
*-commutative87.9%
associate-/l*83.3%
associate-*l/84.6%
Simplified84.6%
associate-/r/86.2%
Applied egg-rr86.2%
if -4.6000000000000003e-167 < t < 2.59999999999999981e-128Initial program 51.8%
*-commutative51.8%
associate-/l*42.1%
associate-*l/35.9%
Simplified35.9%
Taylor expanded in t around 0 70.6%
if 2.59999999999999981e-128 < t Initial program 83.9%
*-commutative83.9%
associate-/l*85.4%
associate-*l/86.4%
Simplified86.4%
Final simplification82.0%
(FPCore (x y z t a b)
:precision binary64
(if (<= t -2.8e-152)
(/ (+ x (/ (* y z) t)) (+ (+ a 1.0) (/ y (/ t b))))
(if (<= t 1.85e-128)
(/ z b)
(/ (+ x (/ z (/ t y))) (+ (+ a 1.0) (* b (/ y t)))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -2.8e-152) {
tmp = (x + ((y * z) / t)) / ((a + 1.0) + (y / (t / b)));
} else if (t <= 1.85e-128) {
tmp = z / b;
} else {
tmp = (x + (z / (t / y))) / ((a + 1.0) + (b * (y / t)));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (t <= (-2.8d-152)) then
tmp = (x + ((y * z) / t)) / ((a + 1.0d0) + (y / (t / b)))
else if (t <= 1.85d-128) then
tmp = z / b
else
tmp = (x + (z / (t / y))) / ((a + 1.0d0) + (b * (y / t)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -2.8e-152) {
tmp = (x + ((y * z) / t)) / ((a + 1.0) + (y / (t / b)));
} else if (t <= 1.85e-128) {
tmp = z / b;
} else {
tmp = (x + (z / (t / y))) / ((a + 1.0) + (b * (y / t)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if t <= -2.8e-152: tmp = (x + ((y * z) / t)) / ((a + 1.0) + (y / (t / b))) elif t <= 1.85e-128: tmp = z / b else: tmp = (x + (z / (t / y))) / ((a + 1.0) + (b * (y / t))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (t <= -2.8e-152) tmp = Float64(Float64(x + Float64(Float64(y * z) / t)) / Float64(Float64(a + 1.0) + Float64(y / Float64(t / b)))); elseif (t <= 1.85e-128) tmp = Float64(z / b); else tmp = Float64(Float64(x + Float64(z / Float64(t / y))) / Float64(Float64(a + 1.0) + Float64(b * Float64(y / t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (t <= -2.8e-152) tmp = (x + ((y * z) / t)) / ((a + 1.0) + (y / (t / b))); elseif (t <= 1.85e-128) tmp = z / b; else tmp = (x + (z / (t / y))) / ((a + 1.0) + (b * (y / t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -2.8e-152], N[(N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] / N[(N[(a + 1.0), $MachinePrecision] + N[(y / N[(t / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.85e-128], N[(z / b), $MachinePrecision], N[(N[(x + N[(z / N[(t / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(a + 1.0), $MachinePrecision] + N[(b * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.8 \cdot 10^{-152}:\\
\;\;\;\;\frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y}{\frac{t}{b}}}\\
\mathbf{elif}\;t \leq 1.85 \cdot 10^{-128}:\\
\;\;\;\;\frac{z}{b}\\
\mathbf{else}:\\
\;\;\;\;\frac{x + \frac{z}{\frac{t}{y}}}{\left(a + 1\right) + b \cdot \frac{y}{t}}\\
\end{array}
\end{array}
if t < -2.79999999999999984e-152Initial program 88.6%
associate-/l*89.2%
Simplified89.2%
if -2.79999999999999984e-152 < t < 1.85e-128Initial program 52.4%
*-commutative52.4%
associate-/l*43.1%
associate-*l/37.1%
Simplified37.1%
Taylor expanded in t around 0 69.1%
if 1.85e-128 < t Initial program 83.9%
*-commutative83.9%
associate-/l*85.4%
associate-*l/86.4%
Simplified86.4%
Final simplification82.4%
(FPCore (x y z t a b)
:precision binary64
(if (<= y -1.18e+114)
(/ z b)
(if (<= y 1e-17)
(/ x (+ 1.0 (+ a (/ (* y b) t))))
(if (<= y 4e+79)
(/ (* y z) (+ t (* y b)))
(if (<= y 3.1e+137) (+ (* (/ z t) (/ y a)) (/ x a)) (/ z b))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -1.18e+114) {
tmp = z / b;
} else if (y <= 1e-17) {
tmp = x / (1.0 + (a + ((y * b) / t)));
} else if (y <= 4e+79) {
tmp = (y * z) / (t + (y * b));
} else if (y <= 3.1e+137) {
tmp = ((z / t) * (y / a)) + (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.18d+114)) then
tmp = z / b
else if (y <= 1d-17) then
tmp = x / (1.0d0 + (a + ((y * b) / t)))
else if (y <= 4d+79) then
tmp = (y * z) / (t + (y * b))
else if (y <= 3.1d+137) then
tmp = ((z / t) * (y / a)) + (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.18e+114) {
tmp = z / b;
} else if (y <= 1e-17) {
tmp = x / (1.0 + (a + ((y * b) / t)));
} else if (y <= 4e+79) {
tmp = (y * z) / (t + (y * b));
} else if (y <= 3.1e+137) {
tmp = ((z / t) * (y / a)) + (x / a);
} else {
tmp = z / b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -1.18e+114: tmp = z / b elif y <= 1e-17: tmp = x / (1.0 + (a + ((y * b) / t))) elif y <= 4e+79: tmp = (y * z) / (t + (y * b)) elif y <= 3.1e+137: tmp = ((z / t) * (y / a)) + (x / a) else: tmp = z / b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -1.18e+114) tmp = Float64(z / b); elseif (y <= 1e-17) tmp = Float64(x / Float64(1.0 + Float64(a + Float64(Float64(y * b) / t)))); elseif (y <= 4e+79) tmp = Float64(Float64(y * z) / Float64(t + Float64(y * b))); elseif (y <= 3.1e+137) tmp = Float64(Float64(Float64(z / t) * Float64(y / a)) + 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.18e+114) tmp = z / b; elseif (y <= 1e-17) tmp = x / (1.0 + (a + ((y * b) / t))); elseif (y <= 4e+79) tmp = (y * z) / (t + (y * b)); elseif (y <= 3.1e+137) tmp = ((z / t) * (y / a)) + (x / a); else tmp = z / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -1.18e+114], N[(z / b), $MachinePrecision], If[LessEqual[y, 1e-17], N[(x / N[(1.0 + N[(a + N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4e+79], N[(N[(y * z), $MachinePrecision] / N[(t + N[(y * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.1e+137], N[(N[(N[(z / t), $MachinePrecision] * N[(y / a), $MachinePrecision]), $MachinePrecision] + N[(x / a), $MachinePrecision]), $MachinePrecision], N[(z / b), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.18 \cdot 10^{+114}:\\
\;\;\;\;\frac{z}{b}\\
\mathbf{elif}\;y \leq 10^{-17}:\\
\;\;\;\;\frac{x}{1 + \left(a + \frac{y \cdot b}{t}\right)}\\
\mathbf{elif}\;y \leq 4 \cdot 10^{+79}:\\
\;\;\;\;\frac{y \cdot z}{t + y \cdot b}\\
\mathbf{elif}\;y \leq 3.1 \cdot 10^{+137}:\\
\;\;\;\;\frac{z}{t} \cdot \frac{y}{a} + \frac{x}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{b}\\
\end{array}
\end{array}
if y < -1.18000000000000005e114 or 3.0999999999999999e137 < y Initial program 50.8%
*-commutative50.8%
associate-/l*44.8%
associate-*l/42.1%
Simplified42.1%
Taylor expanded in t around 0 66.9%
if -1.18000000000000005e114 < y < 1.00000000000000007e-17Initial program 93.2%
*-commutative93.2%
associate-/l*90.2%
associate-*l/90.2%
Simplified90.2%
Taylor expanded in x around inf 78.0%
if 1.00000000000000007e-17 < y < 3.99999999999999987e79Initial program 63.2%
*-commutative63.2%
associate-/l*58.3%
associate-*l/57.9%
Simplified57.9%
Taylor expanded in x around 0 43.3%
associate-/l*47.5%
distribute-lft-in47.5%
*-rgt-identity47.5%
associate-*r/47.5%
fma-def47.5%
Simplified47.5%
Taylor expanded in a around 0 58.9%
if 3.99999999999999987e79 < y < 3.0999999999999999e137Initial program 67.9%
*-commutative67.9%
associate-/l*67.9%
associate-*l/67.6%
Simplified67.6%
associate-/r/67.6%
Applied egg-rr67.6%
Taylor expanded in a around inf 48.4%
Taylor expanded in x around 0 54.5%
times-frac65.6%
Simplified65.6%
Final simplification72.4%
(FPCore (x y z t a b)
:precision binary64
(if (<= t -8.6e-67)
(/ (+ x (/ (* y z) t)) (+ a 1.0))
(if (<= t 2.5e+15)
(/ y (/ (+ t (+ (* y b) (* t a))) z))
(/ x (+ (+ a 1.0) (* b (/ y t)))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -8.6e-67) {
tmp = (x + ((y * z) / t)) / (a + 1.0);
} else if (t <= 2.5e+15) {
tmp = y / ((t + ((y * b) + (t * a))) / z);
} else {
tmp = x / ((a + 1.0) + (b * (y / t)));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (t <= (-8.6d-67)) then
tmp = (x + ((y * z) / t)) / (a + 1.0d0)
else if (t <= 2.5d+15) then
tmp = y / ((t + ((y * b) + (t * a))) / z)
else
tmp = x / ((a + 1.0d0) + (b * (y / t)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -8.6e-67) {
tmp = (x + ((y * z) / t)) / (a + 1.0);
} else if (t <= 2.5e+15) {
tmp = y / ((t + ((y * b) + (t * a))) / z);
} else {
tmp = x / ((a + 1.0) + (b * (y / t)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if t <= -8.6e-67: tmp = (x + ((y * z) / t)) / (a + 1.0) elif t <= 2.5e+15: tmp = y / ((t + ((y * b) + (t * a))) / z) else: tmp = x / ((a + 1.0) + (b * (y / t))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (t <= -8.6e-67) tmp = Float64(Float64(x + Float64(Float64(y * z) / t)) / Float64(a + 1.0)); elseif (t <= 2.5e+15) tmp = Float64(y / Float64(Float64(t + Float64(Float64(y * b) + Float64(t * a))) / z)); else tmp = Float64(x / Float64(Float64(a + 1.0) + Float64(b * Float64(y / t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (t <= -8.6e-67) tmp = (x + ((y * z) / t)) / (a + 1.0); elseif (t <= 2.5e+15) tmp = y / ((t + ((y * b) + (t * a))) / z); else tmp = x / ((a + 1.0) + (b * (y / t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -8.6e-67], N[(N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] / N[(a + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.5e+15], N[(y / N[(N[(t + N[(N[(y * b), $MachinePrecision] + N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], N[(x / N[(N[(a + 1.0), $MachinePrecision] + N[(b * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -8.6 \cdot 10^{-67}:\\
\;\;\;\;\frac{x + \frac{y \cdot z}{t}}{a + 1}\\
\mathbf{elif}\;t \leq 2.5 \cdot 10^{+15}:\\
\;\;\;\;\frac{y}{\frac{t + \left(y \cdot b + t \cdot a\right)}{z}}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\left(a + 1\right) + b \cdot \frac{y}{t}}\\
\end{array}
\end{array}
if t < -8.60000000000000053e-67Initial program 89.5%
*-commutative89.5%
associate-/l*86.9%
associate-*l/88.6%
Simplified88.6%
Taylor expanded in b around 0 85.2%
if -8.60000000000000053e-67 < t < 2.5e15Initial program 61.6%
*-commutative61.6%
associate-/l*53.9%
associate-*l/50.2%
Simplified50.2%
Taylor expanded in x around 0 45.4%
associate-/l*47.9%
distribute-lft-in47.9%
*-rgt-identity47.9%
associate-*r/44.6%
fma-def44.6%
Simplified44.6%
Taylor expanded in t around 0 65.5%
if 2.5e15 < t Initial program 90.2%
*-commutative90.2%
associate-/l*92.6%
associate-*l/94.2%
Simplified94.2%
Taylor expanded in x around inf 77.2%
Final simplification74.0%
(FPCore (x y z t a b) :precision binary64 (if (<= t -2.2e-129) (/ (+ x (/ (* y z) t)) (+ a 1.0)) (if (<= t 2.4e+21) (/ z b) (/ x (+ (+ a 1.0) (* b (/ y t)))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -2.2e-129) {
tmp = (x + ((y * z) / t)) / (a + 1.0);
} else if (t <= 2.4e+21) {
tmp = z / b;
} else {
tmp = x / ((a + 1.0) + (b * (y / t)));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (t <= (-2.2d-129)) then
tmp = (x + ((y * z) / t)) / (a + 1.0d0)
else if (t <= 2.4d+21) then
tmp = z / b
else
tmp = x / ((a + 1.0d0) + (b * (y / t)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -2.2e-129) {
tmp = (x + ((y * z) / t)) / (a + 1.0);
} else if (t <= 2.4e+21) {
tmp = z / b;
} else {
tmp = x / ((a + 1.0) + (b * (y / t)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if t <= -2.2e-129: tmp = (x + ((y * z) / t)) / (a + 1.0) elif t <= 2.4e+21: tmp = z / b else: tmp = x / ((a + 1.0) + (b * (y / t))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (t <= -2.2e-129) tmp = Float64(Float64(x + Float64(Float64(y * z) / t)) / Float64(a + 1.0)); elseif (t <= 2.4e+21) tmp = Float64(z / b); else tmp = Float64(x / Float64(Float64(a + 1.0) + Float64(b * Float64(y / t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (t <= -2.2e-129) tmp = (x + ((y * z) / t)) / (a + 1.0); elseif (t <= 2.4e+21) tmp = z / b; else tmp = x / ((a + 1.0) + (b * (y / t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -2.2e-129], N[(N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] / N[(a + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.4e+21], N[(z / b), $MachinePrecision], N[(x / N[(N[(a + 1.0), $MachinePrecision] + N[(b * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.2 \cdot 10^{-129}:\\
\;\;\;\;\frac{x + \frac{y \cdot z}{t}}{a + 1}\\
\mathbf{elif}\;t \leq 2.4 \cdot 10^{+21}:\\
\;\;\;\;\frac{z}{b}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\left(a + 1\right) + b \cdot \frac{y}{t}}\\
\end{array}
\end{array}
if t < -2.20000000000000003e-129Initial program 88.6%
*-commutative88.6%
associate-/l*85.2%
associate-*l/86.7%
Simplified86.7%
Taylor expanded in b around 0 81.4%
if -2.20000000000000003e-129 < t < 2.4e21Initial program 59.4%
*-commutative59.4%
associate-/l*51.9%
associate-*l/47.9%
Simplified47.9%
Taylor expanded in t around 0 63.1%
if 2.4e21 < t Initial program 91.5%
*-commutative91.5%
associate-/l*94.1%
associate-*l/95.7%
Simplified95.7%
Taylor expanded in x around inf 79.8%
Final simplification73.1%
(FPCore (x y z t a b)
:precision binary64
(if (<= a -9e+19)
(/ x a)
(if (<= a -8.8e-53)
(/ z b)
(if (<= a -2.6e-224) x (if (<= a 2.9e+44) (/ z b) (/ x a))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -9e+19) {
tmp = x / a;
} else if (a <= -8.8e-53) {
tmp = z / b;
} else if (a <= -2.6e-224) {
tmp = x;
} else if (a <= 2.9e+44) {
tmp = z / b;
} else {
tmp = x / a;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (a <= (-9d+19)) then
tmp = x / a
else if (a <= (-8.8d-53)) then
tmp = z / b
else if (a <= (-2.6d-224)) then
tmp = x
else if (a <= 2.9d+44) then
tmp = z / b
else
tmp = x / a
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -9e+19) {
tmp = x / a;
} else if (a <= -8.8e-53) {
tmp = z / b;
} else if (a <= -2.6e-224) {
tmp = x;
} else if (a <= 2.9e+44) {
tmp = z / b;
} else {
tmp = x / a;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if a <= -9e+19: tmp = x / a elif a <= -8.8e-53: tmp = z / b elif a <= -2.6e-224: tmp = x elif a <= 2.9e+44: tmp = z / b else: tmp = x / a return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (a <= -9e+19) tmp = Float64(x / a); elseif (a <= -8.8e-53) tmp = Float64(z / b); elseif (a <= -2.6e-224) tmp = x; elseif (a <= 2.9e+44) tmp = Float64(z / b); else tmp = Float64(x / a); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (a <= -9e+19) tmp = x / a; elseif (a <= -8.8e-53) tmp = z / b; elseif (a <= -2.6e-224) tmp = x; elseif (a <= 2.9e+44) tmp = z / b; else tmp = x / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, -9e+19], N[(x / a), $MachinePrecision], If[LessEqual[a, -8.8e-53], N[(z / b), $MachinePrecision], If[LessEqual[a, -2.6e-224], x, If[LessEqual[a, 2.9e+44], N[(z / b), $MachinePrecision], N[(x / a), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -9 \cdot 10^{+19}:\\
\;\;\;\;\frac{x}{a}\\
\mathbf{elif}\;a \leq -8.8 \cdot 10^{-53}:\\
\;\;\;\;\frac{z}{b}\\
\mathbf{elif}\;a \leq -2.6 \cdot 10^{-224}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 2.9 \cdot 10^{+44}:\\
\;\;\;\;\frac{z}{b}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{a}\\
\end{array}
\end{array}
if a < -9e19 or 2.9000000000000002e44 < a Initial program 72.4%
*-commutative72.4%
associate-/l*69.8%
associate-*l/70.3%
Simplified70.3%
Taylor expanded in x around inf 57.8%
Taylor expanded in a around inf 54.3%
if -9e19 < a < -8.80000000000000073e-53 or -2.6000000000000002e-224 < a < 2.9000000000000002e44Initial program 74.2%
*-commutative74.2%
associate-/l*69.0%
associate-*l/67.2%
Simplified67.2%
Taylor expanded in t around 0 51.6%
if -8.80000000000000073e-53 < a < -2.6000000000000002e-224Initial program 91.3%
*-commutative91.3%
associate-/l*87.1%
associate-*l/84.8%
Simplified84.8%
Taylor expanded in x around inf 73.2%
Taylor expanded in a around 0 73.2%
Taylor expanded in y around 0 55.2%
Final simplification53.4%
(FPCore (x y z t a b) :precision binary64 (if (or (<= t -1.26e-71) (not (<= t 4.1e+21))) (/ x (+ a 1.0)) (/ z b)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -1.26e-71) || !(t <= 4.1e+21)) {
tmp = x / (a + 1.0);
} else {
tmp = z / b;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((t <= (-1.26d-71)) .or. (.not. (t <= 4.1d+21))) then
tmp = x / (a + 1.0d0)
else
tmp = z / b
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -1.26e-71) || !(t <= 4.1e+21)) {
tmp = x / (a + 1.0);
} else {
tmp = z / b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (t <= -1.26e-71) or not (t <= 4.1e+21): tmp = x / (a + 1.0) else: tmp = z / b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((t <= -1.26e-71) || !(t <= 4.1e+21)) tmp = Float64(x / Float64(a + 1.0)); else tmp = Float64(z / b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((t <= -1.26e-71) || ~((t <= 4.1e+21))) tmp = x / (a + 1.0); else tmp = z / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[t, -1.26e-71], N[Not[LessEqual[t, 4.1e+21]], $MachinePrecision]], N[(x / N[(a + 1.0), $MachinePrecision]), $MachinePrecision], N[(z / b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.26 \cdot 10^{-71} \lor \neg \left(t \leq 4.1 \cdot 10^{+21}\right):\\
\;\;\;\;\frac{x}{a + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{b}\\
\end{array}
\end{array}
if t < -1.2600000000000001e-71 or 4.1e21 < t Initial program 90.4%
*-commutative90.4%
associate-/l*90.1%
associate-*l/91.7%
Simplified91.7%
Taylor expanded in t around inf 69.2%
if -1.2600000000000001e-71 < t < 4.1e21Initial program 61.2%
*-commutative61.2%
associate-/l*53.5%
associate-*l/49.8%
Simplified49.8%
Taylor expanded in t around 0 61.3%
Final simplification65.4%
(FPCore (x y z t a b) :precision binary64 (if (<= a -1.85e-7) (/ 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.85e-7) {
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.85d-7)) 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.85e-7) {
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.85e-7: 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.85e-7) 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.85e-7) 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.85e-7], 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.85 \cdot 10^{-7}:\\
\;\;\;\;\frac{x}{a}\\
\mathbf{elif}\;a \leq 1:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{a}\\
\end{array}
\end{array}
if a < -1.85000000000000002e-7 or 1 < a Initial program 74.9%
*-commutative74.9%
associate-/l*71.8%
associate-*l/71.5%
Simplified71.5%
Taylor expanded in x around inf 57.2%
Taylor expanded in a around inf 49.4%
if -1.85000000000000002e-7 < a < 1Initial program 78.1%
*-commutative78.1%
associate-/l*73.4%
associate-*l/72.0%
Simplified72.0%
Taylor expanded in x around inf 55.0%
Taylor expanded in a around 0 54.1%
Taylor expanded in y around 0 38.1%
Final simplification43.7%
(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 76.5%
*-commutative76.5%
associate-/l*72.6%
associate-*l/71.7%
Simplified71.7%
Taylor expanded in x around inf 56.1%
Taylor expanded in a around 0 34.2%
Taylor expanded in y around 0 21.0%
Final simplification21.0%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1
(* 1.0 (* (+ x (* (/ y t) z)) (/ 1.0 (+ (+ a 1.0) (* (/ y t) b)))))))
(if (< t -1.3659085366310088e-271)
t_1
(if (< t 3.036967103737246e-130) (/ z b) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = 1.0 * ((x + ((y / t) * z)) * (1.0 / ((a + 1.0) + ((y / t) * b))));
double tmp;
if (t < -1.3659085366310088e-271) {
tmp = t_1;
} else if (t < 3.036967103737246e-130) {
tmp = z / b;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = 1.0d0 * ((x + ((y / t) * z)) * (1.0d0 / ((a + 1.0d0) + ((y / t) * b))))
if (t < (-1.3659085366310088d-271)) then
tmp = t_1
else if (t < 3.036967103737246d-130) then
tmp = z / b
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = 1.0 * ((x + ((y / t) * z)) * (1.0 / ((a + 1.0) + ((y / t) * b))));
double tmp;
if (t < -1.3659085366310088e-271) {
tmp = t_1;
} else if (t < 3.036967103737246e-130) {
tmp = z / b;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = 1.0 * ((x + ((y / t) * z)) * (1.0 / ((a + 1.0) + ((y / t) * b)))) tmp = 0 if t < -1.3659085366310088e-271: tmp = t_1 elif t < 3.036967103737246e-130: tmp = z / b else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(1.0 * Float64(Float64(x + Float64(Float64(y / t) * z)) * Float64(1.0 / Float64(Float64(a + 1.0) + Float64(Float64(y / t) * b))))) tmp = 0.0 if (t < -1.3659085366310088e-271) tmp = t_1; elseif (t < 3.036967103737246e-130) tmp = Float64(z / b); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = 1.0 * ((x + ((y / t) * z)) * (1.0 / ((a + 1.0) + ((y / t) * b)))); tmp = 0.0; if (t < -1.3659085366310088e-271) tmp = t_1; elseif (t < 3.036967103737246e-130) tmp = z / b; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(1.0 * N[(N[(x + N[(N[(y / t), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[(N[(a + 1.0), $MachinePrecision] + N[(N[(y / t), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Less[t, -1.3659085366310088e-271], t$95$1, If[Less[t, 3.036967103737246e-130], N[(z / b), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 1 \cdot \left(\left(x + \frac{y}{t} \cdot z\right) \cdot \frac{1}{\left(a + 1\right) + \frac{y}{t} \cdot b}\right)\\
\mathbf{if}\;t < -1.3659085366310088 \cdot 10^{-271}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t < 3.036967103737246 \cdot 10^{-130}:\\
\;\;\;\;\frac{z}{b}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
herbie shell --seed 2023178
(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))))