
(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 13 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 (/ (* y b) t))
(t_2 (+ t_1 (+ a 1.0)))
(t_3 (/ (+ x (/ (* y z) t)) t_2))
(t_4 (+ 1.0 (+ a t_1)))
(t_5 (* z (+ (/ x (* z t_4)) (/ y (* t t_4))))))
(if (<= t_3 (- INFINITY))
t_5
(if (<= t_3 -2e-309)
(/ (+ x (/ z (/ t y))) t_2)
(if (<= t_3 0.0)
(-
(/ z b)
(/ (fma -1.0 (* t (/ x b)) (/ (* (* z t) (+ a 1.0)) (pow b 2.0))) y))
(if (<= t_3 5e+304) t_3 (if (<= t_3 INFINITY) t_5 (/ z b))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (y * b) / t;
double t_2 = t_1 + (a + 1.0);
double t_3 = (x + ((y * z) / t)) / t_2;
double t_4 = 1.0 + (a + t_1);
double t_5 = z * ((x / (z * t_4)) + (y / (t * t_4)));
double tmp;
if (t_3 <= -((double) INFINITY)) {
tmp = t_5;
} else if (t_3 <= -2e-309) {
tmp = (x + (z / (t / y))) / t_2;
} else if (t_3 <= 0.0) {
tmp = (z / b) - (fma(-1.0, (t * (x / b)), (((z * t) * (a + 1.0)) / pow(b, 2.0))) / y);
} else if (t_3 <= 5e+304) {
tmp = t_3;
} else if (t_3 <= ((double) INFINITY)) {
tmp = t_5;
} else {
tmp = z / b;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(y * b) / t) t_2 = Float64(t_1 + Float64(a + 1.0)) t_3 = Float64(Float64(x + Float64(Float64(y * z) / t)) / t_2) t_4 = Float64(1.0 + Float64(a + t_1)) t_5 = Float64(z * Float64(Float64(x / Float64(z * t_4)) + Float64(y / Float64(t * t_4)))) tmp = 0.0 if (t_3 <= Float64(-Inf)) tmp = t_5; elseif (t_3 <= -2e-309) tmp = Float64(Float64(x + Float64(z / Float64(t / y))) / t_2); elseif (t_3 <= 0.0) tmp = Float64(Float64(z / b) - Float64(fma(-1.0, Float64(t * Float64(x / b)), Float64(Float64(Float64(z * t) * Float64(a + 1.0)) / (b ^ 2.0))) / y)); elseif (t_3 <= 5e+304) tmp = t_3; elseif (t_3 <= Inf) tmp = t_5; else tmp = Float64(z / b); end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 + N[(a + 1.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] / t$95$2), $MachinePrecision]}, Block[{t$95$4 = N[(1.0 + N[(a + t$95$1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(z * N[(N[(x / N[(z * t$95$4), $MachinePrecision]), $MachinePrecision] + N[(y / N[(t * t$95$4), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$3, (-Infinity)], t$95$5, If[LessEqual[t$95$3, -2e-309], N[(N[(x + N[(z / N[(t / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$2), $MachinePrecision], If[LessEqual[t$95$3, 0.0], N[(N[(z / b), $MachinePrecision] - N[(N[(-1.0 * N[(t * N[(x / b), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(z * t), $MachinePrecision] * N[(a + 1.0), $MachinePrecision]), $MachinePrecision] / N[Power[b, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$3, 5e+304], t$95$3, If[LessEqual[t$95$3, Infinity], t$95$5, N[(z / b), $MachinePrecision]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y \cdot b}{t}\\
t_2 := t\_1 + \left(a + 1\right)\\
t_3 := \frac{x + \frac{y \cdot z}{t}}{t\_2}\\
t_4 := 1 + \left(a + t\_1\right)\\
t_5 := z \cdot \left(\frac{x}{z \cdot t\_4} + \frac{y}{t \cdot t\_4}\right)\\
\mathbf{if}\;t\_3 \leq -\infty:\\
\;\;\;\;t\_5\\
\mathbf{elif}\;t\_3 \leq -2 \cdot 10^{-309}:\\
\;\;\;\;\frac{x + \frac{z}{\frac{t}{y}}}{t\_2}\\
\mathbf{elif}\;t\_3 \leq 0:\\
\;\;\;\;\frac{z}{b} - \frac{\mathsf{fma}\left(-1, t \cdot \frac{x}{b}, \frac{\left(z \cdot t\right) \cdot \left(a + 1\right)}{{b}^{2}}\right)}{y}\\
\mathbf{elif}\;t\_3 \leq 5 \cdot 10^{+304}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;t\_3 \leq \infty:\\
\;\;\;\;t\_5\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{b}\\
\end{array}
\end{array}
if (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < -inf.0 or 4.9999999999999997e304 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < +inf.0Initial program 33.5%
associate-/l*62.1%
associate-/l*62.0%
Simplified62.0%
Taylor expanded in z around inf 96.5%
if -inf.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < -1.9999999999999988e-309Initial program 97.7%
*-commutative97.7%
associate-/l*98.7%
Applied egg-rr98.7%
clear-num98.6%
un-div-inv98.9%
Applied egg-rr98.9%
if -1.9999999999999988e-309 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < -0.0Initial program 47.1%
associate-/l*46.9%
associate-/l*57.8%
Simplified57.8%
Taylor expanded in y around -inf 69.4%
+-commutative69.4%
mul-1-neg69.4%
unsub-neg69.4%
fma-neg69.4%
associate-/l*80.3%
mul-1-neg80.3%
remove-double-neg80.3%
associate-*r*80.4%
Simplified80.4%
if -0.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < 4.9999999999999997e304Initial program 99.7%
if +inf.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) Initial program 0.0%
associate-/l*0.3%
associate-/l*8.2%
Simplified8.2%
Taylor expanded in y around inf 96.3%
Final simplification96.0%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (* y b) t))
(t_2 (+ t_1 (+ a 1.0)))
(t_3 (/ (+ x (/ (* y z) t)) t_2))
(t_4 (+ 1.0 (+ a t_1)))
(t_5 (* z (+ (/ x (* z t_4)) (/ y (* t t_4))))))
(if (<= t_3 (- INFINITY))
t_5
(if (<= t_3 -2e-309)
(/ (+ x (/ z (/ t y))) t_2)
(if (<= t_3 0.0)
(-
(+ (/ z b) (* t (/ (/ x b) y)))
(* t (* z (/ (+ a 1.0) (* y (pow b 2.0))))))
(if (<= t_3 5e+304) t_3 (if (<= t_3 INFINITY) t_5 (/ z b))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (y * b) / t;
double t_2 = t_1 + (a + 1.0);
double t_3 = (x + ((y * z) / t)) / t_2;
double t_4 = 1.0 + (a + t_1);
double t_5 = z * ((x / (z * t_4)) + (y / (t * t_4)));
double tmp;
if (t_3 <= -((double) INFINITY)) {
tmp = t_5;
} else if (t_3 <= -2e-309) {
tmp = (x + (z / (t / y))) / t_2;
} else if (t_3 <= 0.0) {
tmp = ((z / b) + (t * ((x / b) / y))) - (t * (z * ((a + 1.0) / (y * pow(b, 2.0)))));
} else if (t_3 <= 5e+304) {
tmp = t_3;
} else if (t_3 <= ((double) INFINITY)) {
tmp = t_5;
} 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 = (y * b) / t;
double t_2 = t_1 + (a + 1.0);
double t_3 = (x + ((y * z) / t)) / t_2;
double t_4 = 1.0 + (a + t_1);
double t_5 = z * ((x / (z * t_4)) + (y / (t * t_4)));
double tmp;
if (t_3 <= -Double.POSITIVE_INFINITY) {
tmp = t_5;
} else if (t_3 <= -2e-309) {
tmp = (x + (z / (t / y))) / t_2;
} else if (t_3 <= 0.0) {
tmp = ((z / b) + (t * ((x / b) / y))) - (t * (z * ((a + 1.0) / (y * Math.pow(b, 2.0)))));
} else if (t_3 <= 5e+304) {
tmp = t_3;
} else if (t_3 <= Double.POSITIVE_INFINITY) {
tmp = t_5;
} else {
tmp = z / b;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (y * b) / t t_2 = t_1 + (a + 1.0) t_3 = (x + ((y * z) / t)) / t_2 t_4 = 1.0 + (a + t_1) t_5 = z * ((x / (z * t_4)) + (y / (t * t_4))) tmp = 0 if t_3 <= -math.inf: tmp = t_5 elif t_3 <= -2e-309: tmp = (x + (z / (t / y))) / t_2 elif t_3 <= 0.0: tmp = ((z / b) + (t * ((x / b) / y))) - (t * (z * ((a + 1.0) / (y * math.pow(b, 2.0))))) elif t_3 <= 5e+304: tmp = t_3 elif t_3 <= math.inf: tmp = t_5 else: tmp = z / b return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(y * b) / t) t_2 = Float64(t_1 + Float64(a + 1.0)) t_3 = Float64(Float64(x + Float64(Float64(y * z) / t)) / t_2) t_4 = Float64(1.0 + Float64(a + t_1)) t_5 = Float64(z * Float64(Float64(x / Float64(z * t_4)) + Float64(y / Float64(t * t_4)))) tmp = 0.0 if (t_3 <= Float64(-Inf)) tmp = t_5; elseif (t_3 <= -2e-309) tmp = Float64(Float64(x + Float64(z / Float64(t / y))) / t_2); elseif (t_3 <= 0.0) tmp = Float64(Float64(Float64(z / b) + Float64(t * Float64(Float64(x / b) / y))) - Float64(t * Float64(z * Float64(Float64(a + 1.0) / Float64(y * (b ^ 2.0)))))); elseif (t_3 <= 5e+304) tmp = t_3; elseif (t_3 <= Inf) tmp = t_5; else tmp = Float64(z / b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (y * b) / t; t_2 = t_1 + (a + 1.0); t_3 = (x + ((y * z) / t)) / t_2; t_4 = 1.0 + (a + t_1); t_5 = z * ((x / (z * t_4)) + (y / (t * t_4))); tmp = 0.0; if (t_3 <= -Inf) tmp = t_5; elseif (t_3 <= -2e-309) tmp = (x + (z / (t / y))) / t_2; elseif (t_3 <= 0.0) tmp = ((z / b) + (t * ((x / b) / y))) - (t * (z * ((a + 1.0) / (y * (b ^ 2.0))))); elseif (t_3 <= 5e+304) tmp = t_3; elseif (t_3 <= Inf) tmp = t_5; else tmp = z / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 + N[(a + 1.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] / t$95$2), $MachinePrecision]}, Block[{t$95$4 = N[(1.0 + N[(a + t$95$1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(z * N[(N[(x / N[(z * t$95$4), $MachinePrecision]), $MachinePrecision] + N[(y / N[(t * t$95$4), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$3, (-Infinity)], t$95$5, If[LessEqual[t$95$3, -2e-309], N[(N[(x + N[(z / N[(t / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$2), $MachinePrecision], If[LessEqual[t$95$3, 0.0], N[(N[(N[(z / b), $MachinePrecision] + N[(t * N[(N[(x / b), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(t * N[(z * N[(N[(a + 1.0), $MachinePrecision] / N[(y * N[Power[b, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$3, 5e+304], t$95$3, If[LessEqual[t$95$3, Infinity], t$95$5, N[(z / b), $MachinePrecision]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y \cdot b}{t}\\
t_2 := t\_1 + \left(a + 1\right)\\
t_3 := \frac{x + \frac{y \cdot z}{t}}{t\_2}\\
t_4 := 1 + \left(a + t\_1\right)\\
t_5 := z \cdot \left(\frac{x}{z \cdot t\_4} + \frac{y}{t \cdot t\_4}\right)\\
\mathbf{if}\;t\_3 \leq -\infty:\\
\;\;\;\;t\_5\\
\mathbf{elif}\;t\_3 \leq -2 \cdot 10^{-309}:\\
\;\;\;\;\frac{x + \frac{z}{\frac{t}{y}}}{t\_2}\\
\mathbf{elif}\;t\_3 \leq 0:\\
\;\;\;\;\left(\frac{z}{b} + t \cdot \frac{\frac{x}{b}}{y}\right) - t \cdot \left(z \cdot \frac{a + 1}{y \cdot {b}^{2}}\right)\\
\mathbf{elif}\;t\_3 \leq 5 \cdot 10^{+304}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;t\_3 \leq \infty:\\
\;\;\;\;t\_5\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{b}\\
\end{array}
\end{array}
if (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < -inf.0 or 4.9999999999999997e304 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < +inf.0Initial program 33.5%
associate-/l*62.1%
associate-/l*62.0%
Simplified62.0%
Taylor expanded in z around inf 96.5%
if -inf.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < -1.9999999999999988e-309Initial program 97.7%
*-commutative97.7%
associate-/l*98.7%
Applied egg-rr98.7%
clear-num98.6%
un-div-inv98.9%
Applied egg-rr98.9%
if -1.9999999999999988e-309 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < -0.0Initial program 47.1%
associate-/l*46.9%
associate-/l*57.8%
Simplified57.8%
Taylor expanded in y around inf 66.3%
associate-/l*69.2%
associate-/r*77.5%
associate-/l*80.3%
associate-/l*80.3%
*-commutative80.3%
Simplified80.3%
if -0.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < 4.9999999999999997e304Initial program 99.7%
if +inf.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) Initial program 0.0%
associate-/l*0.3%
associate-/l*8.2%
Simplified8.2%
Taylor expanded in y around inf 96.3%
Final simplification96.0%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ (/ (* y b) t) (+ a 1.0)))
(t_2 (/ (+ x (/ (* y z) t)) t_1))
(t_3 (* (/ y t) (/ z (+ (+ a 1.0) (* b (/ y t)))))))
(if (<= t_2 (- INFINITY))
t_3
(if (<= t_2 -5e-261)
t_2
(if (<= t_2 -2e-309)
(/ (+ x (/ z (/ t y))) t_1)
(if (<= t_2 0.0)
(/ (+ (/ (* x t) b) (/ (* y z) b)) y)
(if (<= t_2 5e+304) 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 = ((y * b) / t) + (a + 1.0);
double t_2 = (x + ((y * z) / t)) / t_1;
double t_3 = (y / t) * (z / ((a + 1.0) + (b * (y / t))));
double tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = t_3;
} else if (t_2 <= -5e-261) {
tmp = t_2;
} else if (t_2 <= -2e-309) {
tmp = (x + (z / (t / y))) / t_1;
} else if (t_2 <= 0.0) {
tmp = (((x * t) / b) + ((y * z) / b)) / y;
} else if (t_2 <= 5e+304) {
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 = ((y * b) / t) + (a + 1.0);
double t_2 = (x + ((y * z) / t)) / t_1;
double t_3 = (y / t) * (z / ((a + 1.0) + (b * (y / t))));
double tmp;
if (t_2 <= -Double.POSITIVE_INFINITY) {
tmp = t_3;
} else if (t_2 <= -5e-261) {
tmp = t_2;
} else if (t_2 <= -2e-309) {
tmp = (x + (z / (t / y))) / t_1;
} else if (t_2 <= 0.0) {
tmp = (((x * t) / b) + ((y * z) / b)) / y;
} else if (t_2 <= 5e+304) {
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 = ((y * b) / t) + (a + 1.0) t_2 = (x + ((y * z) / t)) / t_1 t_3 = (y / t) * (z / ((a + 1.0) + (b * (y / t)))) tmp = 0 if t_2 <= -math.inf: tmp = t_3 elif t_2 <= -5e-261: tmp = t_2 elif t_2 <= -2e-309: tmp = (x + (z / (t / y))) / t_1 elif t_2 <= 0.0: tmp = (((x * t) / b) + ((y * z) / b)) / y elif t_2 <= 5e+304: 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(Float64(y * b) / t) + Float64(a + 1.0)) t_2 = Float64(Float64(x + Float64(Float64(y * z) / t)) / t_1) t_3 = Float64(Float64(y / t) * Float64(z / Float64(Float64(a + 1.0) + Float64(b * Float64(y / t))))) tmp = 0.0 if (t_2 <= Float64(-Inf)) tmp = t_3; elseif (t_2 <= -5e-261) tmp = t_2; elseif (t_2 <= -2e-309) tmp = Float64(Float64(x + Float64(z / Float64(t / y))) / t_1); elseif (t_2 <= 0.0) tmp = Float64(Float64(Float64(Float64(x * t) / b) + Float64(Float64(y * z) / b)) / y); elseif (t_2 <= 5e+304) 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 = ((y * b) / t) + (a + 1.0); t_2 = (x + ((y * z) / t)) / t_1; t_3 = (y / t) * (z / ((a + 1.0) + (b * (y / t)))); tmp = 0.0; if (t_2 <= -Inf) tmp = t_3; elseif (t_2 <= -5e-261) tmp = t_2; elseif (t_2 <= -2e-309) tmp = (x + (z / (t / y))) / t_1; elseif (t_2 <= 0.0) tmp = (((x * t) / b) + ((y * z) / b)) / y; elseif (t_2 <= 5e+304) 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[(N[(y * b), $MachinePrecision] / t), $MachinePrecision] + N[(a + 1.0), $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[(N[(y / t), $MachinePrecision] * N[(z / N[(N[(a + 1.0), $MachinePrecision] + N[(b * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], t$95$3, If[LessEqual[t$95$2, -5e-261], t$95$2, If[LessEqual[t$95$2, -2e-309], N[(N[(x + N[(z / N[(t / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision], If[LessEqual[t$95$2, 0.0], N[(N[(N[(N[(x * t), $MachinePrecision] / b), $MachinePrecision] + N[(N[(y * z), $MachinePrecision] / b), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision], If[LessEqual[t$95$2, 5e+304], t$95$2, If[LessEqual[t$95$2, Infinity], t$95$3, N[(z / b), $MachinePrecision]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y \cdot b}{t} + \left(a + 1\right)\\
t_2 := \frac{x + \frac{y \cdot z}{t}}{t\_1}\\
t_3 := \frac{y}{t} \cdot \frac{z}{\left(a + 1\right) + b \cdot \frac{y}{t}}\\
\mathbf{if}\;t\_2 \leq -\infty:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;t\_2 \leq -5 \cdot 10^{-261}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_2 \leq -2 \cdot 10^{-309}:\\
\;\;\;\;\frac{x + \frac{z}{\frac{t}{y}}}{t\_1}\\
\mathbf{elif}\;t\_2 \leq 0:\\
\;\;\;\;\frac{\frac{x \cdot t}{b} + \frac{y \cdot z}{b}}{y}\\
\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+304}:\\
\;\;\;\;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 #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < -inf.0 or 4.9999999999999997e304 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < +inf.0Initial program 33.5%
associate-/l*62.1%
associate-/l*62.0%
Simplified62.0%
clear-num62.1%
un-div-inv62.1%
Applied egg-rr62.1%
Taylor expanded in x around 0 55.4%
times-frac93.3%
associate-+r+93.3%
associate-/l*86.5%
Simplified86.5%
if -inf.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < -4.99999999999999981e-261 or -0.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < 4.9999999999999997e304Initial program 99.7%
if -4.99999999999999981e-261 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < -1.9999999999999988e-309Initial program 72.5%
*-commutative72.5%
associate-/l*99.4%
Applied egg-rr99.4%
clear-num99.4%
un-div-inv99.6%
Applied egg-rr99.6%
if -1.9999999999999988e-309 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < -0.0Initial program 47.1%
associate-/l*46.9%
associate-/l*57.8%
Simplified57.8%
Taylor expanded in b around inf 57.0%
Taylor expanded in y around 0 69.4%
if +inf.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) Initial program 0.0%
associate-/l*0.3%
associate-/l*8.2%
Simplified8.2%
Taylor expanded in y around inf 96.3%
Final simplification93.7%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (* y b) t))
(t_2 (+ t_1 (+ a 1.0)))
(t_3 (/ (+ x (/ (* y z) t)) t_2))
(t_4 (+ 1.0 (+ a t_1)))
(t_5 (* z (+ (/ x (* z t_4)) (/ y (* t t_4))))))
(if (<= t_3 (- INFINITY))
t_5
(if (<= t_3 -2e-309)
(/ (+ x (/ z (/ t y))) t_2)
(if (<= t_3 0.0)
(/ (+ (/ (* x t) b) (/ (* y z) b)) y)
(if (<= t_3 5e+304) t_3 (if (<= t_3 INFINITY) t_5 (/ z b))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (y * b) / t;
double t_2 = t_1 + (a + 1.0);
double t_3 = (x + ((y * z) / t)) / t_2;
double t_4 = 1.0 + (a + t_1);
double t_5 = z * ((x / (z * t_4)) + (y / (t * t_4)));
double tmp;
if (t_3 <= -((double) INFINITY)) {
tmp = t_5;
} else if (t_3 <= -2e-309) {
tmp = (x + (z / (t / y))) / t_2;
} else if (t_3 <= 0.0) {
tmp = (((x * t) / b) + ((y * z) / b)) / y;
} else if (t_3 <= 5e+304) {
tmp = t_3;
} else if (t_3 <= ((double) INFINITY)) {
tmp = t_5;
} 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 = (y * b) / t;
double t_2 = t_1 + (a + 1.0);
double t_3 = (x + ((y * z) / t)) / t_2;
double t_4 = 1.0 + (a + t_1);
double t_5 = z * ((x / (z * t_4)) + (y / (t * t_4)));
double tmp;
if (t_3 <= -Double.POSITIVE_INFINITY) {
tmp = t_5;
} else if (t_3 <= -2e-309) {
tmp = (x + (z / (t / y))) / t_2;
} else if (t_3 <= 0.0) {
tmp = (((x * t) / b) + ((y * z) / b)) / y;
} else if (t_3 <= 5e+304) {
tmp = t_3;
} else if (t_3 <= Double.POSITIVE_INFINITY) {
tmp = t_5;
} else {
tmp = z / b;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (y * b) / t t_2 = t_1 + (a + 1.0) t_3 = (x + ((y * z) / t)) / t_2 t_4 = 1.0 + (a + t_1) t_5 = z * ((x / (z * t_4)) + (y / (t * t_4))) tmp = 0 if t_3 <= -math.inf: tmp = t_5 elif t_3 <= -2e-309: tmp = (x + (z / (t / y))) / t_2 elif t_3 <= 0.0: tmp = (((x * t) / b) + ((y * z) / b)) / y elif t_3 <= 5e+304: tmp = t_3 elif t_3 <= math.inf: tmp = t_5 else: tmp = z / b return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(y * b) / t) t_2 = Float64(t_1 + Float64(a + 1.0)) t_3 = Float64(Float64(x + Float64(Float64(y * z) / t)) / t_2) t_4 = Float64(1.0 + Float64(a + t_1)) t_5 = Float64(z * Float64(Float64(x / Float64(z * t_4)) + Float64(y / Float64(t * t_4)))) tmp = 0.0 if (t_3 <= Float64(-Inf)) tmp = t_5; elseif (t_3 <= -2e-309) tmp = Float64(Float64(x + Float64(z / Float64(t / y))) / t_2); elseif (t_3 <= 0.0) tmp = Float64(Float64(Float64(Float64(x * t) / b) + Float64(Float64(y * z) / b)) / y); elseif (t_3 <= 5e+304) tmp = t_3; elseif (t_3 <= Inf) tmp = t_5; else tmp = Float64(z / b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (y * b) / t; t_2 = t_1 + (a + 1.0); t_3 = (x + ((y * z) / t)) / t_2; t_4 = 1.0 + (a + t_1); t_5 = z * ((x / (z * t_4)) + (y / (t * t_4))); tmp = 0.0; if (t_3 <= -Inf) tmp = t_5; elseif (t_3 <= -2e-309) tmp = (x + (z / (t / y))) / t_2; elseif (t_3 <= 0.0) tmp = (((x * t) / b) + ((y * z) / b)) / y; elseif (t_3 <= 5e+304) tmp = t_3; elseif (t_3 <= Inf) tmp = t_5; else tmp = z / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 + N[(a + 1.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] / t$95$2), $MachinePrecision]}, Block[{t$95$4 = N[(1.0 + N[(a + t$95$1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(z * N[(N[(x / N[(z * t$95$4), $MachinePrecision]), $MachinePrecision] + N[(y / N[(t * t$95$4), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$3, (-Infinity)], t$95$5, If[LessEqual[t$95$3, -2e-309], N[(N[(x + N[(z / N[(t / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$2), $MachinePrecision], If[LessEqual[t$95$3, 0.0], N[(N[(N[(N[(x * t), $MachinePrecision] / b), $MachinePrecision] + N[(N[(y * z), $MachinePrecision] / b), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision], If[LessEqual[t$95$3, 5e+304], t$95$3, If[LessEqual[t$95$3, Infinity], t$95$5, N[(z / b), $MachinePrecision]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y \cdot b}{t}\\
t_2 := t\_1 + \left(a + 1\right)\\
t_3 := \frac{x + \frac{y \cdot z}{t}}{t\_2}\\
t_4 := 1 + \left(a + t\_1\right)\\
t_5 := z \cdot \left(\frac{x}{z \cdot t\_4} + \frac{y}{t \cdot t\_4}\right)\\
\mathbf{if}\;t\_3 \leq -\infty:\\
\;\;\;\;t\_5\\
\mathbf{elif}\;t\_3 \leq -2 \cdot 10^{-309}:\\
\;\;\;\;\frac{x + \frac{z}{\frac{t}{y}}}{t\_2}\\
\mathbf{elif}\;t\_3 \leq 0:\\
\;\;\;\;\frac{\frac{x \cdot t}{b} + \frac{y \cdot z}{b}}{y}\\
\mathbf{elif}\;t\_3 \leq 5 \cdot 10^{+304}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;t\_3 \leq \infty:\\
\;\;\;\;t\_5\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{b}\\
\end{array}
\end{array}
if (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < -inf.0 or 4.9999999999999997e304 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < +inf.0Initial program 33.5%
associate-/l*62.1%
associate-/l*62.0%
Simplified62.0%
Taylor expanded in z around inf 96.5%
if -inf.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < -1.9999999999999988e-309Initial program 97.7%
*-commutative97.7%
associate-/l*98.7%
Applied egg-rr98.7%
clear-num98.6%
un-div-inv98.9%
Applied egg-rr98.9%
if -1.9999999999999988e-309 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < -0.0Initial program 47.1%
associate-/l*46.9%
associate-/l*57.8%
Simplified57.8%
Taylor expanded in b around inf 57.0%
Taylor expanded in y around 0 69.4%
if -0.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < 4.9999999999999997e304Initial program 99.7%
if +inf.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) Initial program 0.0%
associate-/l*0.3%
associate-/l*8.2%
Simplified8.2%
Taylor expanded in y around inf 96.3%
Final simplification94.5%
(FPCore (x y z t a b)
:precision binary64
(if (<= y -3.6e+155)
(/ z b)
(if (<= y -3.6e+90)
(* y (/ z (* t (+ a 1.0))))
(if (<= y -2e+66)
(/ x (+ (+ a 1.0) (* y (/ b t))))
(if (<= y 4.2e+69) (/ x (+ 1.0 (+ a (/ (* y b) t)))) (/ z b))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -3.6e+155) {
tmp = z / b;
} else if (y <= -3.6e+90) {
tmp = y * (z / (t * (a + 1.0)));
} else if (y <= -2e+66) {
tmp = x / ((a + 1.0) + (y * (b / t)));
} else if (y <= 4.2e+69) {
tmp = x / (1.0 + (a + ((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 <= (-3.6d+155)) then
tmp = z / b
else if (y <= (-3.6d+90)) then
tmp = y * (z / (t * (a + 1.0d0)))
else if (y <= (-2d+66)) then
tmp = x / ((a + 1.0d0) + (y * (b / t)))
else if (y <= 4.2d+69) then
tmp = x / (1.0d0 + (a + ((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 <= -3.6e+155) {
tmp = z / b;
} else if (y <= -3.6e+90) {
tmp = y * (z / (t * (a + 1.0)));
} else if (y <= -2e+66) {
tmp = x / ((a + 1.0) + (y * (b / t)));
} else if (y <= 4.2e+69) {
tmp = x / (1.0 + (a + ((y * b) / t)));
} else {
tmp = z / b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -3.6e+155: tmp = z / b elif y <= -3.6e+90: tmp = y * (z / (t * (a + 1.0))) elif y <= -2e+66: tmp = x / ((a + 1.0) + (y * (b / t))) elif y <= 4.2e+69: tmp = x / (1.0 + (a + ((y * b) / t))) else: tmp = z / b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -3.6e+155) tmp = Float64(z / b); elseif (y <= -3.6e+90) tmp = Float64(y * Float64(z / Float64(t * Float64(a + 1.0)))); elseif (y <= -2e+66) tmp = Float64(x / Float64(Float64(a + 1.0) + Float64(y * Float64(b / t)))); elseif (y <= 4.2e+69) tmp = Float64(x / Float64(1.0 + Float64(a + Float64(Float64(y * 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 <= -3.6e+155) tmp = z / b; elseif (y <= -3.6e+90) tmp = y * (z / (t * (a + 1.0))); elseif (y <= -2e+66) tmp = x / ((a + 1.0) + (y * (b / t))); elseif (y <= 4.2e+69) tmp = x / (1.0 + (a + ((y * b) / t))); else tmp = z / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -3.6e+155], N[(z / b), $MachinePrecision], If[LessEqual[y, -3.6e+90], N[(y * N[(z / N[(t * N[(a + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -2e+66], N[(x / N[(N[(a + 1.0), $MachinePrecision] + N[(y * N[(b / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4.2e+69], N[(x / N[(1.0 + N[(a + N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z / b), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.6 \cdot 10^{+155}:\\
\;\;\;\;\frac{z}{b}\\
\mathbf{elif}\;y \leq -3.6 \cdot 10^{+90}:\\
\;\;\;\;y \cdot \frac{z}{t \cdot \left(a + 1\right)}\\
\mathbf{elif}\;y \leq -2 \cdot 10^{+66}:\\
\;\;\;\;\frac{x}{\left(a + 1\right) + y \cdot \frac{b}{t}}\\
\mathbf{elif}\;y \leq 4.2 \cdot 10^{+69}:\\
\;\;\;\;\frac{x}{1 + \left(a + \frac{y \cdot b}{t}\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{b}\\
\end{array}
\end{array}
if y < -3.60000000000000007e155 or 4.2000000000000003e69 < y Initial program 39.6%
associate-/l*45.7%
associate-/l*51.8%
Simplified51.8%
Taylor expanded in y around inf 69.7%
if -3.60000000000000007e155 < y < -3.6e90Initial program 92.3%
associate-/l*92.5%
associate-/l*92.5%
Simplified92.5%
Taylor expanded in b around 0 91.0%
Taylor expanded in x around 0 68.6%
associate-/l*68.8%
Simplified68.8%
if -3.6e90 < y < -1.99999999999999989e66Initial program 61.0%
associate-/l*61.6%
associate-/l*80.3%
Simplified80.3%
Taylor expanded in x around inf 61.2%
if -1.99999999999999989e66 < y < 4.2000000000000003e69Initial program 90.8%
associate-/l*85.9%
associate-/l*81.4%
Simplified81.4%
Taylor expanded in x around inf 63.1%
Final simplification65.4%
(FPCore (x y z t a b)
:precision binary64
(if (<= y -4.8e+156)
(/ z b)
(if (<= y -1.9e+88)
(* y (/ z (* t (+ a 1.0))))
(if (<= y -5.9e+66)
(/ x (+ 1.0 (* b (/ y t))))
(if (<= y 7.8e+68) (/ x (+ 1.0 (+ a (/ (* y b) t)))) (/ z b))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -4.8e+156) {
tmp = z / b;
} else if (y <= -1.9e+88) {
tmp = y * (z / (t * (a + 1.0)));
} else if (y <= -5.9e+66) {
tmp = x / (1.0 + (b * (y / t)));
} else if (y <= 7.8e+68) {
tmp = x / (1.0 + (a + ((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 <= (-4.8d+156)) then
tmp = z / b
else if (y <= (-1.9d+88)) then
tmp = y * (z / (t * (a + 1.0d0)))
else if (y <= (-5.9d+66)) then
tmp = x / (1.0d0 + (b * (y / t)))
else if (y <= 7.8d+68) then
tmp = x / (1.0d0 + (a + ((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 <= -4.8e+156) {
tmp = z / b;
} else if (y <= -1.9e+88) {
tmp = y * (z / (t * (a + 1.0)));
} else if (y <= -5.9e+66) {
tmp = x / (1.0 + (b * (y / t)));
} else if (y <= 7.8e+68) {
tmp = x / (1.0 + (a + ((y * b) / t)));
} else {
tmp = z / b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -4.8e+156: tmp = z / b elif y <= -1.9e+88: tmp = y * (z / (t * (a + 1.0))) elif y <= -5.9e+66: tmp = x / (1.0 + (b * (y / t))) elif y <= 7.8e+68: tmp = x / (1.0 + (a + ((y * b) / t))) else: tmp = z / b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -4.8e+156) tmp = Float64(z / b); elseif (y <= -1.9e+88) tmp = Float64(y * Float64(z / Float64(t * Float64(a + 1.0)))); elseif (y <= -5.9e+66) tmp = Float64(x / Float64(1.0 + Float64(b * Float64(y / t)))); elseif (y <= 7.8e+68) tmp = Float64(x / Float64(1.0 + Float64(a + Float64(Float64(y * 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 <= -4.8e+156) tmp = z / b; elseif (y <= -1.9e+88) tmp = y * (z / (t * (a + 1.0))); elseif (y <= -5.9e+66) tmp = x / (1.0 + (b * (y / t))); elseif (y <= 7.8e+68) tmp = x / (1.0 + (a + ((y * b) / t))); else tmp = z / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -4.8e+156], N[(z / b), $MachinePrecision], If[LessEqual[y, -1.9e+88], N[(y * N[(z / N[(t * N[(a + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -5.9e+66], N[(x / N[(1.0 + N[(b * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 7.8e+68], N[(x / N[(1.0 + N[(a + N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z / b), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.8 \cdot 10^{+156}:\\
\;\;\;\;\frac{z}{b}\\
\mathbf{elif}\;y \leq -1.9 \cdot 10^{+88}:\\
\;\;\;\;y \cdot \frac{z}{t \cdot \left(a + 1\right)}\\
\mathbf{elif}\;y \leq -5.9 \cdot 10^{+66}:\\
\;\;\;\;\frac{x}{1 + b \cdot \frac{y}{t}}\\
\mathbf{elif}\;y \leq 7.8 \cdot 10^{+68}:\\
\;\;\;\;\frac{x}{1 + \left(a + \frac{y \cdot b}{t}\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{b}\\
\end{array}
\end{array}
if y < -4.8000000000000002e156 or 7.80000000000000037e68 < y Initial program 39.6%
associate-/l*45.7%
associate-/l*51.8%
Simplified51.8%
Taylor expanded in y around inf 69.7%
if -4.8000000000000002e156 < y < -1.8999999999999998e88Initial program 92.3%
associate-/l*92.5%
associate-/l*92.5%
Simplified92.5%
Taylor expanded in b around 0 91.0%
Taylor expanded in x around 0 68.6%
associate-/l*68.8%
Simplified68.8%
if -1.8999999999999998e88 < y < -5.89999999999999988e66Initial program 61.0%
associate-/l*61.6%
associate-/l*80.3%
Simplified80.3%
Taylor expanded in x around inf 42.1%
associate-+r+42.1%
associate-*r/61.2%
*-commutative61.2%
associate-/r/61.2%
+-commutative61.2%
associate-/r/61.2%
*-commutative61.2%
associate-*r/42.1%
associate-*l/61.2%
*-commutative61.2%
fma-define61.5%
Simplified61.5%
Taylor expanded in a around 0 42.1%
associate-/l*52.3%
Applied egg-rr52.3%
if -5.89999999999999988e66 < y < 7.80000000000000037e68Initial program 90.8%
associate-/l*85.9%
associate-/l*81.4%
Simplified81.4%
Taylor expanded in x around inf 63.1%
Final simplification65.3%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -1.15e+148) (not (<= y 5.4e+51))) (/ z b) (/ (+ x (* z (/ y t))) (+ (/ (* y b) t) (+ a 1.0)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -1.15e+148) || !(y <= 5.4e+51)) {
tmp = z / b;
} else {
tmp = (x + (z * (y / t))) / (((y * b) / 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 <= (-1.15d+148)) .or. (.not. (y <= 5.4d+51))) then
tmp = z / b
else
tmp = (x + (z * (y / t))) / (((y * b) / 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 <= -1.15e+148) || !(y <= 5.4e+51)) {
tmp = z / b;
} else {
tmp = (x + (z * (y / t))) / (((y * b) / t) + (a + 1.0));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -1.15e+148) or not (y <= 5.4e+51): tmp = z / b else: tmp = (x + (z * (y / t))) / (((y * b) / t) + (a + 1.0)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -1.15e+148) || !(y <= 5.4e+51)) tmp = Float64(z / b); else tmp = Float64(Float64(x + Float64(z * Float64(y / t))) / Float64(Float64(Float64(y * b) / t) + Float64(a + 1.0))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -1.15e+148) || ~((y <= 5.4e+51))) tmp = z / b; else tmp = (x + (z * (y / t))) / (((y * b) / t) + (a + 1.0)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -1.15e+148], N[Not[LessEqual[y, 5.4e+51]], $MachinePrecision]], N[(z / b), $MachinePrecision], N[(N[(x + N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision] + N[(a + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.15 \cdot 10^{+148} \lor \neg \left(y \leq 5.4 \cdot 10^{+51}\right):\\
\;\;\;\;\frac{z}{b}\\
\mathbf{else}:\\
\;\;\;\;\frac{x + z \cdot \frac{y}{t}}{\frac{y \cdot b}{t} + \left(a + 1\right)}\\
\end{array}
\end{array}
if y < -1.15e148 or 5.39999999999999983e51 < y Initial program 41.6%
associate-/l*47.3%
associate-/l*52.9%
Simplified52.9%
Taylor expanded in y around inf 69.6%
if -1.15e148 < y < 5.39999999999999983e51Initial program 90.8%
*-commutative90.8%
associate-/l*92.1%
Applied egg-rr92.1%
Final simplification84.6%
(FPCore (x y z t a b) :precision binary64 (if (or (<= t -4.1e-184) (not (<= t 6.8e-210))) (/ (+ 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 ((t <= -4.1e-184) || !(t <= 6.8e-210)) {
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 ((t <= (-4.1d-184)) .or. (.not. (t <= 6.8d-210))) 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 ((t <= -4.1e-184) || !(t <= 6.8e-210)) {
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 (t <= -4.1e-184) or not (t <= 6.8e-210): 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 ((t <= -4.1e-184) || !(t <= 6.8e-210)) 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 ((t <= -4.1e-184) || ~((t <= 6.8e-210))) 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[Or[LessEqual[t, -4.1e-184], N[Not[LessEqual[t, 6.8e-210]], $MachinePrecision]], 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}\;t \leq -4.1 \cdot 10^{-184} \lor \neg \left(t \leq 6.8 \cdot 10^{-210}\right):\\
\;\;\;\;\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 t < -4.1e-184 or 6.79999999999999949e-210 < t Initial program 78.0%
associate-/l*79.4%
associate-/l*80.7%
Simplified80.7%
if -4.1e-184 < t < 6.79999999999999949e-210Initial program 57.3%
associate-/l*44.7%
associate-/l*36.3%
Simplified36.3%
Taylor expanded in y around inf 69.9%
Final simplification78.7%
(FPCore (x y z t a b)
:precision binary64
(if (<= y -1.12e+148)
(/ z b)
(if (<= y 205.0)
(/ (+ x (* z (/ y t))) (+ a 1.0))
(if (<= y 2.5e+70) (/ x (+ 1.0 (+ a (/ (* y b) t)))) (/ z b)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -1.12e+148) {
tmp = z / b;
} else if (y <= 205.0) {
tmp = (x + (z * (y / t))) / (a + 1.0);
} else if (y <= 2.5e+70) {
tmp = x / (1.0 + (a + ((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.12d+148)) then
tmp = z / b
else if (y <= 205.0d0) then
tmp = (x + (z * (y / t))) / (a + 1.0d0)
else if (y <= 2.5d+70) then
tmp = x / (1.0d0 + (a + ((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.12e+148) {
tmp = z / b;
} else if (y <= 205.0) {
tmp = (x + (z * (y / t))) / (a + 1.0);
} else if (y <= 2.5e+70) {
tmp = x / (1.0 + (a + ((y * b) / t)));
} else {
tmp = z / b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -1.12e+148: tmp = z / b elif y <= 205.0: tmp = (x + (z * (y / t))) / (a + 1.0) elif y <= 2.5e+70: tmp = x / (1.0 + (a + ((y * b) / t))) else: tmp = z / b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -1.12e+148) tmp = Float64(z / b); elseif (y <= 205.0) tmp = Float64(Float64(x + Float64(z * Float64(y / t))) / Float64(a + 1.0)); elseif (y <= 2.5e+70) tmp = Float64(x / Float64(1.0 + Float64(a + Float64(Float64(y * 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.12e+148) tmp = z / b; elseif (y <= 205.0) tmp = (x + (z * (y / t))) / (a + 1.0); elseif (y <= 2.5e+70) tmp = x / (1.0 + (a + ((y * b) / t))); else tmp = z / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -1.12e+148], N[(z / b), $MachinePrecision], If[LessEqual[y, 205.0], N[(N[(x + N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(a + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.5e+70], N[(x / N[(1.0 + N[(a + N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z / b), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.12 \cdot 10^{+148}:\\
\;\;\;\;\frac{z}{b}\\
\mathbf{elif}\;y \leq 205:\\
\;\;\;\;\frac{x + z \cdot \frac{y}{t}}{a + 1}\\
\mathbf{elif}\;y \leq 2.5 \cdot 10^{+70}:\\
\;\;\;\;\frac{x}{1 + \left(a + \frac{y \cdot b}{t}\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{b}\\
\end{array}
\end{array}
if y < -1.12e148 or 2.5000000000000001e70 < y Initial program 40.6%
associate-/l*46.5%
associate-/l*52.4%
Simplified52.4%
Taylor expanded in y around inf 69.7%
if -1.12e148 < y < 205Initial program 90.9%
associate-/l*86.2%
associate-/l*82.4%
Simplified82.4%
Taylor expanded in b around 0 72.6%
*-commutative90.9%
associate-/l*92.3%
Applied egg-rr74.1%
if 205 < y < 2.5000000000000001e70Initial program 82.7%
associate-/l*82.7%
associate-/l*82.6%
Simplified82.6%
Taylor expanded in x around inf 82.5%
Final simplification73.0%
(FPCore (x y z t a b)
:precision binary64
(if (<= y -3.6e+155)
(/ z b)
(if (<= y -8.2e+95)
(* y (/ z (* t (+ a 1.0))))
(if (<= y -7.5e-19)
(/ x (+ 1.0 (* b (/ y t))))
(if (<= y 1.1e-19) (/ x (+ a 1.0)) (/ z b))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -3.6e+155) {
tmp = z / b;
} else if (y <= -8.2e+95) {
tmp = y * (z / (t * (a + 1.0)));
} else if (y <= -7.5e-19) {
tmp = x / (1.0 + (b * (y / t)));
} else if (y <= 1.1e-19) {
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 <= (-3.6d+155)) then
tmp = z / b
else if (y <= (-8.2d+95)) then
tmp = y * (z / (t * (a + 1.0d0)))
else if (y <= (-7.5d-19)) then
tmp = x / (1.0d0 + (b * (y / t)))
else if (y <= 1.1d-19) 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 <= -3.6e+155) {
tmp = z / b;
} else if (y <= -8.2e+95) {
tmp = y * (z / (t * (a + 1.0)));
} else if (y <= -7.5e-19) {
tmp = x / (1.0 + (b * (y / t)));
} else if (y <= 1.1e-19) {
tmp = x / (a + 1.0);
} else {
tmp = z / b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -3.6e+155: tmp = z / b elif y <= -8.2e+95: tmp = y * (z / (t * (a + 1.0))) elif y <= -7.5e-19: tmp = x / (1.0 + (b * (y / t))) elif y <= 1.1e-19: tmp = x / (a + 1.0) else: tmp = z / b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -3.6e+155) tmp = Float64(z / b); elseif (y <= -8.2e+95) tmp = Float64(y * Float64(z / Float64(t * Float64(a + 1.0)))); elseif (y <= -7.5e-19) tmp = Float64(x / Float64(1.0 + Float64(b * Float64(y / t)))); elseif (y <= 1.1e-19) 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 <= -3.6e+155) tmp = z / b; elseif (y <= -8.2e+95) tmp = y * (z / (t * (a + 1.0))); elseif (y <= -7.5e-19) tmp = x / (1.0 + (b * (y / t))); elseif (y <= 1.1e-19) tmp = x / (a + 1.0); else tmp = z / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -3.6e+155], N[(z / b), $MachinePrecision], If[LessEqual[y, -8.2e+95], N[(y * N[(z / N[(t * N[(a + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -7.5e-19], N[(x / N[(1.0 + N[(b * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.1e-19], N[(x / N[(a + 1.0), $MachinePrecision]), $MachinePrecision], N[(z / b), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.6 \cdot 10^{+155}:\\
\;\;\;\;\frac{z}{b}\\
\mathbf{elif}\;y \leq -8.2 \cdot 10^{+95}:\\
\;\;\;\;y \cdot \frac{z}{t \cdot \left(a + 1\right)}\\
\mathbf{elif}\;y \leq -7.5 \cdot 10^{-19}:\\
\;\;\;\;\frac{x}{1 + b \cdot \frac{y}{t}}\\
\mathbf{elif}\;y \leq 1.1 \cdot 10^{-19}:\\
\;\;\;\;\frac{x}{a + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{b}\\
\end{array}
\end{array}
if y < -3.60000000000000007e155 or 1.0999999999999999e-19 < y Initial program 46.8%
associate-/l*51.8%
associate-/l*56.7%
Simplified56.7%
Taylor expanded in y around inf 63.4%
if -3.60000000000000007e155 < y < -8.19999999999999972e95Initial program 92.3%
associate-/l*92.5%
associate-/l*92.5%
Simplified92.5%
Taylor expanded in b around 0 91.0%
Taylor expanded in x around 0 68.6%
associate-/l*68.8%
Simplified68.8%
if -8.19999999999999972e95 < y < -7.49999999999999957e-19Initial program 79.8%
associate-/l*84.0%
associate-/l*88.0%
Simplified88.0%
Taylor expanded in x around inf 51.2%
associate-+r+51.2%
associate-*r/55.3%
*-commutative55.3%
associate-/r/55.3%
+-commutative55.3%
associate-/r/55.3%
*-commutative55.3%
associate-*r/51.2%
associate-*l/55.3%
*-commutative55.3%
fma-define55.3%
Simplified55.3%
Taylor expanded in a around 0 47.4%
associate-/l*49.6%
Applied egg-rr49.6%
if -7.49999999999999957e-19 < y < 1.0999999999999999e-19Initial program 93.5%
associate-/l*86.3%
associate-/l*80.5%
Simplified80.5%
Taylor expanded in y around 0 57.0%
Final simplification59.4%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -1.15e+148) (not (<= y 2.1e-19))) (/ z b) (/ x (+ a 1.0))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -1.15e+148) || !(y <= 2.1e-19)) {
tmp = z / b;
} else {
tmp = x / (a + 1.0);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((y <= (-1.15d+148)) .or. (.not. (y <= 2.1d-19))) then
tmp = z / b
else
tmp = x / (a + 1.0d0)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -1.15e+148) || !(y <= 2.1e-19)) {
tmp = z / b;
} else {
tmp = x / (a + 1.0);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -1.15e+148) or not (y <= 2.1e-19): tmp = z / b else: tmp = x / (a + 1.0) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -1.15e+148) || !(y <= 2.1e-19)) tmp = Float64(z / b); else tmp = Float64(x / Float64(a + 1.0)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -1.15e+148) || ~((y <= 2.1e-19))) tmp = z / b; else tmp = x / (a + 1.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -1.15e+148], N[Not[LessEqual[y, 2.1e-19]], $MachinePrecision]], N[(z / b), $MachinePrecision], N[(x / N[(a + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.15 \cdot 10^{+148} \lor \neg \left(y \leq 2.1 \cdot 10^{-19}\right):\\
\;\;\;\;\frac{z}{b}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{a + 1}\\
\end{array}
\end{array}
if y < -1.15e148 or 2.0999999999999999e-19 < y Initial program 47.4%
associate-/l*52.2%
associate-/l*57.0%
Simplified57.0%
Taylor expanded in y around inf 63.6%
if -1.15e148 < y < 2.0999999999999999e-19Initial program 91.8%
associate-/l*86.8%
associate-/l*82.9%
Simplified82.9%
Taylor expanded in y around 0 51.3%
Final simplification56.1%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -6e-23) (not (<= y 9.6e-67))) (/ z b) (/ x a)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -6e-23) || !(y <= 9.6e-67)) {
tmp = z / b;
} else {
tmp = x / a;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((y <= (-6d-23)) .or. (.not. (y <= 9.6d-67))) then
tmp = z / b
else
tmp = x / a
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -6e-23) || !(y <= 9.6e-67)) {
tmp = z / b;
} else {
tmp = x / a;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -6e-23) or not (y <= 9.6e-67): tmp = z / b else: tmp = x / a return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -6e-23) || !(y <= 9.6e-67)) tmp = Float64(z / b); else tmp = Float64(x / a); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -6e-23) || ~((y <= 9.6e-67))) tmp = z / b; else tmp = x / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -6e-23], N[Not[LessEqual[y, 9.6e-67]], $MachinePrecision]], N[(z / b), $MachinePrecision], N[(x / a), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -6 \cdot 10^{-23} \lor \neg \left(y \leq 9.6 \cdot 10^{-67}\right):\\
\;\;\;\;\frac{z}{b}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{a}\\
\end{array}
\end{array}
if y < -6.00000000000000006e-23 or 9.6e-67 < y Initial program 60.2%
associate-/l*64.3%
associate-/l*68.3%
Simplified68.3%
Taylor expanded in y around inf 51.2%
if -6.00000000000000006e-23 < y < 9.6e-67Initial program 92.9%
associate-/l*85.0%
associate-/l*78.6%
Simplified78.6%
Taylor expanded in x around inf 66.5%
associate-+r+66.5%
associate-*r/66.5%
*-commutative66.5%
associate-/r/62.1%
+-commutative62.1%
associate-/r/66.5%
*-commutative66.5%
associate-*r/66.5%
associate-*l/62.0%
*-commutative62.0%
fma-define62.0%
Simplified62.0%
Taylor expanded in a around inf 33.8%
Final simplification43.7%
(FPCore (x y z t a b) :precision binary64 (/ x a))
double code(double x, double y, double z, double t, double a, double b) {
return x / a;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = x / a
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return x / a;
}
def code(x, y, z, t, a, b): return x / a
function code(x, y, z, t, a, b) return Float64(x / a) end
function tmp = code(x, y, z, t, a, b) tmp = x / a; end
code[x_, y_, z_, t_, a_, b_] := N[(x / a), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{a}
\end{array}
Initial program 74.3%
associate-/l*73.2%
associate-/l*72.7%
Simplified72.7%
Taylor expanded in x around inf 46.6%
associate-+r+46.6%
associate-*r/48.2%
*-commutative48.2%
associate-/r/46.3%
+-commutative46.3%
associate-/r/48.2%
*-commutative48.2%
associate-*r/46.6%
associate-*l/46.2%
*-commutative46.2%
fma-define46.2%
Simplified46.2%
Taylor expanded in a around inf 21.2%
(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 2024091
(FPCore (x y z t a b)
:name "Diagrams.Solve.Tridiagonal:solveCyclicTriDiagonal from diagrams-solve-0.1, B"
:precision binary64
:alt
(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))))