
(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 17 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 (- (/ z b) (/ (fma -1.0 (/ t (/ b x)) (* (/ z b) (/ t b))) y)))
(t_2 (/ (+ x (/ (* y z) t)) (+ (/ (* y b) t) (+ a 1.0))))
(t_3 (* (/ y t) (/ z (+ 1.0 (+ a (* y (/ b t))))))))
(if (<= t_2 (- INFINITY))
t_3
(if (<= t_2 -2e-322)
t_2
(if (<= t_2 0.0)
t_1
(if (<= t_2 5e+302) t_2 (if (<= t_2 INFINITY) t_3 t_1)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (z / b) - (fma(-1.0, (t / (b / x)), ((z / b) * (t / b))) / y);
double t_2 = (x + ((y * z) / t)) / (((y * b) / t) + (a + 1.0));
double t_3 = (y / t) * (z / (1.0 + (a + (y * (b / t)))));
double tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = t_3;
} else if (t_2 <= -2e-322) {
tmp = t_2;
} else if (t_2 <= 0.0) {
tmp = t_1;
} else if (t_2 <= 5e+302) {
tmp = t_2;
} else if (t_2 <= ((double) INFINITY)) {
tmp = t_3;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(z / b) - Float64(fma(-1.0, Float64(t / Float64(b / x)), Float64(Float64(z / b) * Float64(t / b))) / y)) t_2 = Float64(Float64(x + Float64(Float64(y * z) / t)) / Float64(Float64(Float64(y * b) / t) + Float64(a + 1.0))) t_3 = Float64(Float64(y / t) * Float64(z / Float64(1.0 + Float64(a + Float64(y * Float64(b / t)))))) tmp = 0.0 if (t_2 <= Float64(-Inf)) tmp = t_3; elseif (t_2 <= -2e-322) tmp = t_2; elseif (t_2 <= 0.0) tmp = t_1; elseif (t_2 <= 5e+302) tmp = t_2; elseif (t_2 <= Inf) tmp = t_3; else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(z / b), $MachinePrecision] - N[(N[(-1.0 * N[(t / N[(b / x), $MachinePrecision]), $MachinePrecision] + N[(N[(z / b), $MachinePrecision] * N[(t / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] / N[(N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision] + N[(a + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(y / t), $MachinePrecision] * N[(z / N[(1.0 + N[(a + N[(y * N[(b / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], t$95$3, If[LessEqual[t$95$2, -2e-322], t$95$2, If[LessEqual[t$95$2, 0.0], t$95$1, If[LessEqual[t$95$2, 5e+302], t$95$2, If[LessEqual[t$95$2, Infinity], t$95$3, t$95$1]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{z}{b} - \frac{\mathsf{fma}\left(-1, \frac{t}{\frac{b}{x}}, \frac{z}{b} \cdot \frac{t}{b}\right)}{y}\\
t_2 := \frac{x + \frac{y \cdot z}{t}}{\frac{y \cdot b}{t} + \left(a + 1\right)}\\
t_3 := \frac{y}{t} \cdot \frac{z}{1 + \left(a + y \cdot \frac{b}{t}\right)}\\
\mathbf{if}\;t_2 \leq -\infty:\\
\;\;\;\;t_3\\
\mathbf{elif}\;t_2 \leq -2 \cdot 10^{-322}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t_2 \leq 0:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t_2 \leq 5 \cdot 10^{+302}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t_2 \leq \infty:\\
\;\;\;\;t_3\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\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 5e302 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < +inf.0Initial program 36.4%
*-commutative36.4%
associate-*l/59.0%
*-commutative59.0%
associate-*l/58.9%
Simplified58.9%
Taylor expanded in x around 0 61.5%
times-frac87.0%
associate-*l/87.0%
*-commutative87.0%
Simplified87.0%
if -inf.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < -1.97626e-322 or -0.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < 5e302Initial program 99.1%
if -1.97626e-322 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < -0.0 or +inf.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) Initial program 30.4%
*-commutative30.4%
associate-*l/30.7%
*-commutative30.7%
associate-*l/54.3%
Simplified54.3%
Taylor expanded in a around 0 16.0%
Taylor expanded in y around -inf 65.6%
+-commutative65.6%
mul-1-neg65.6%
unsub-neg65.6%
fma-neg65.6%
associate-/l*69.0%
mul-1-neg69.0%
remove-double-neg69.0%
*-commutative69.0%
unpow269.0%
times-frac78.3%
Simplified78.3%
Final simplification93.1%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (+ x (/ (* y z) t)) (+ (/ (* y b) t) (+ a 1.0))))
(t_2 (* (/ y t) (/ z (+ 1.0 (+ a (* y (/ b t))))))))
(if (<= t_1 (- INFINITY))
t_2
(if (<= t_1 -1e-147)
t_1
(if (<= t_1 5e-199)
(/ (+ x (* y (/ z t))) (+ (/ y (/ t b)) (+ a 1.0)))
(if (<= t_1 5e+302) 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)) / (((y * b) / t) + (a + 1.0));
double t_2 = (y / t) * (z / (1.0 + (a + (y * (b / t)))));
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = t_2;
} else if (t_1 <= -1e-147) {
tmp = t_1;
} else if (t_1 <= 5e-199) {
tmp = (x + (y * (z / t))) / ((y / (t / b)) + (a + 1.0));
} else if (t_1 <= 5e+302) {
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)) / (((y * b) / t) + (a + 1.0));
double t_2 = (y / t) * (z / (1.0 + (a + (y * (b / t)))));
double tmp;
if (t_1 <= -Double.POSITIVE_INFINITY) {
tmp = t_2;
} else if (t_1 <= -1e-147) {
tmp = t_1;
} else if (t_1 <= 5e-199) {
tmp = (x + (y * (z / t))) / ((y / (t / b)) + (a + 1.0));
} else if (t_1 <= 5e+302) {
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)) / (((y * b) / t) + (a + 1.0)) t_2 = (y / t) * (z / (1.0 + (a + (y * (b / t))))) tmp = 0 if t_1 <= -math.inf: tmp = t_2 elif t_1 <= -1e-147: tmp = t_1 elif t_1 <= 5e-199: tmp = (x + (y * (z / t))) / ((y / (t / b)) + (a + 1.0)) elif t_1 <= 5e+302: 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(Float64(y * b) / t) + Float64(a + 1.0))) t_2 = Float64(Float64(y / t) * Float64(z / Float64(1.0 + Float64(a + Float64(y * Float64(b / t)))))) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = t_2; elseif (t_1 <= -1e-147) tmp = t_1; elseif (t_1 <= 5e-199) tmp = Float64(Float64(x + Float64(y * Float64(z / t))) / Float64(Float64(y / Float64(t / b)) + Float64(a + 1.0))); elseif (t_1 <= 5e+302) 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)) / (((y * b) / t) + (a + 1.0)); t_2 = (y / t) * (z / (1.0 + (a + (y * (b / t))))); tmp = 0.0; if (t_1 <= -Inf) tmp = t_2; elseif (t_1 <= -1e-147) tmp = t_1; elseif (t_1 <= 5e-199) tmp = (x + (y * (z / t))) / ((y / (t / b)) + (a + 1.0)); elseif (t_1 <= 5e+302) 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[(N[(y * b), $MachinePrecision] / t), $MachinePrecision] + N[(a + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(y / t), $MachinePrecision] * N[(z / N[(1.0 + N[(a + N[(y * N[(b / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], t$95$2, If[LessEqual[t$95$1, -1e-147], t$95$1, If[LessEqual[t$95$1, 5e-199], N[(N[(x + N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(y / N[(t / b), $MachinePrecision]), $MachinePrecision] + N[(a + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 5e+302], 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}}{\frac{y \cdot b}{t} + \left(a + 1\right)}\\
t_2 := \frac{y}{t} \cdot \frac{z}{1 + \left(a + y \cdot \frac{b}{t}\right)}\\
\mathbf{if}\;t_1 \leq -\infty:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t_1 \leq -1 \cdot 10^{-147}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t_1 \leq 5 \cdot 10^{-199}:\\
\;\;\;\;\frac{x + y \cdot \frac{z}{t}}{\frac{y}{\frac{t}{b}} + \left(a + 1\right)}\\
\mathbf{elif}\;t_1 \leq 5 \cdot 10^{+302}:\\
\;\;\;\;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 5e302 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < +inf.0Initial program 36.4%
*-commutative36.4%
associate-*l/59.0%
*-commutative59.0%
associate-*l/58.9%
Simplified58.9%
Taylor expanded in x around 0 61.5%
times-frac87.0%
associate-*l/87.0%
*-commutative87.0%
Simplified87.0%
if -inf.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < -9.9999999999999997e-148 or 4.9999999999999996e-199 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < 5e302Initial program 99.7%
if -9.9999999999999997e-148 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < 4.9999999999999996e-199Initial program 68.0%
*-commutative68.0%
associate-*l/69.3%
*-commutative69.3%
associate-*l/80.1%
Simplified80.1%
Taylor expanded in b around 0 69.3%
*-commutative69.3%
associate-/l*80.1%
Simplified80.1%
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/1.1%
*-commutative1.1%
associate-*l/33.2%
Simplified33.2%
Taylor expanded in t around 0 85.0%
Final simplification91.7%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ 1.0 (+ a (* y (/ b t))))) (t_2 (* (/ y t) (/ z t_1))))
(if (<= z -9.8e+45)
t_2
(if (<= z 4.9e-88)
(/ x t_1)
(if (<= z 3.5e+196) (/ (+ x (/ z (/ t y))) (+ a 1.0)) t_2)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = 1.0 + (a + (y * (b / t)));
double t_2 = (y / t) * (z / t_1);
double tmp;
if (z <= -9.8e+45) {
tmp = t_2;
} else if (z <= 4.9e-88) {
tmp = x / t_1;
} else if (z <= 3.5e+196) {
tmp = (x + (z / (t / y))) / (a + 1.0);
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = 1.0d0 + (a + (y * (b / t)))
t_2 = (y / t) * (z / t_1)
if (z <= (-9.8d+45)) then
tmp = t_2
else if (z <= 4.9d-88) then
tmp = x / t_1
else if (z <= 3.5d+196) then
tmp = (x + (z / (t / y))) / (a + 1.0d0)
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = 1.0 + (a + (y * (b / t)));
double t_2 = (y / t) * (z / t_1);
double tmp;
if (z <= -9.8e+45) {
tmp = t_2;
} else if (z <= 4.9e-88) {
tmp = x / t_1;
} else if (z <= 3.5e+196) {
tmp = (x + (z / (t / y))) / (a + 1.0);
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = 1.0 + (a + (y * (b / t))) t_2 = (y / t) * (z / t_1) tmp = 0 if z <= -9.8e+45: tmp = t_2 elif z <= 4.9e-88: tmp = x / t_1 elif z <= 3.5e+196: tmp = (x + (z / (t / y))) / (a + 1.0) else: tmp = t_2 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(1.0 + Float64(a + Float64(y * Float64(b / t)))) t_2 = Float64(Float64(y / t) * Float64(z / t_1)) tmp = 0.0 if (z <= -9.8e+45) tmp = t_2; elseif (z <= 4.9e-88) tmp = Float64(x / t_1); elseif (z <= 3.5e+196) tmp = Float64(Float64(x + Float64(z / Float64(t / y))) / Float64(a + 1.0)); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = 1.0 + (a + (y * (b / t))); t_2 = (y / t) * (z / t_1); tmp = 0.0; if (z <= -9.8e+45) tmp = t_2; elseif (z <= 4.9e-88) tmp = x / t_1; elseif (z <= 3.5e+196) tmp = (x + (z / (t / y))) / (a + 1.0); else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(1.0 + N[(a + N[(y * N[(b / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(y / t), $MachinePrecision] * N[(z / t$95$1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -9.8e+45], t$95$2, If[LessEqual[z, 4.9e-88], N[(x / t$95$1), $MachinePrecision], If[LessEqual[z, 3.5e+196], N[(N[(x + N[(z / N[(t / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(a + 1.0), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 1 + \left(a + y \cdot \frac{b}{t}\right)\\
t_2 := \frac{y}{t} \cdot \frac{z}{t_1}\\
\mathbf{if}\;z \leq -9.8 \cdot 10^{+45}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq 4.9 \cdot 10^{-88}:\\
\;\;\;\;\frac{x}{t_1}\\
\mathbf{elif}\;z \leq 3.5 \cdot 10^{+196}:\\
\;\;\;\;\frac{x + \frac{z}{\frac{t}{y}}}{a + 1}\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if z < -9.8000000000000004e45 or 3.4999999999999998e196 < z Initial program 60.2%
*-commutative60.2%
associate-*l/60.8%
*-commutative60.8%
associate-*l/70.2%
Simplified70.2%
Taylor expanded in x around 0 48.1%
times-frac57.8%
associate-*l/63.7%
*-commutative63.7%
Simplified63.7%
if -9.8000000000000004e45 < z < 4.90000000000000028e-88Initial program 86.6%
*-commutative86.6%
associate-*l/86.5%
*-commutative86.5%
associate-*l/88.3%
Simplified88.3%
Taylor expanded in x around inf 76.6%
associate-*l/78.3%
*-commutative78.3%
Simplified78.3%
if 4.90000000000000028e-88 < z < 3.4999999999999998e196Initial program 79.2%
*-commutative79.2%
associate-*l/77.6%
*-commutative77.6%
associate-*l/72.9%
Simplified72.9%
Taylor expanded in b around 0 61.0%
clear-num61.0%
inv-pow61.0%
*-commutative61.0%
associate-/r*62.3%
Applied egg-rr62.3%
unpow-162.3%
associate-/l/61.0%
associate-/r*64.1%
Simplified64.1%
Taylor expanded in t around 0 61.0%
associate-*r/62.4%
*-commutative62.4%
associate-/r/64.1%
Simplified64.1%
Final simplification70.3%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ x (+ 1.0 (+ a (* y (/ b t)))))))
(if (<= t -3.05e-49)
t_1
(if (<= t -1.15e-88)
(/ z b)
(if (<= t -3.5e-123)
(* z (/ y (+ t (* t a))))
(if (<= t 3.2e-93) (/ z b) t_1))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x / (1.0 + (a + (y * (b / t))));
double tmp;
if (t <= -3.05e-49) {
tmp = t_1;
} else if (t <= -1.15e-88) {
tmp = z / b;
} else if (t <= -3.5e-123) {
tmp = z * (y / (t + (t * a)));
} else if (t <= 3.2e-93) {
tmp = z / b;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = x / (1.0d0 + (a + (y * (b / t))))
if (t <= (-3.05d-49)) then
tmp = t_1
else if (t <= (-1.15d-88)) then
tmp = z / b
else if (t <= (-3.5d-123)) then
tmp = z * (y / (t + (t * a)))
else if (t <= 3.2d-93) then
tmp = z / b
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x / (1.0 + (a + (y * (b / t))));
double tmp;
if (t <= -3.05e-49) {
tmp = t_1;
} else if (t <= -1.15e-88) {
tmp = z / b;
} else if (t <= -3.5e-123) {
tmp = z * (y / (t + (t * a)));
} else if (t <= 3.2e-93) {
tmp = z / b;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x / (1.0 + (a + (y * (b / t)))) tmp = 0 if t <= -3.05e-49: tmp = t_1 elif t <= -1.15e-88: tmp = z / b elif t <= -3.5e-123: tmp = z * (y / (t + (t * a))) elif t <= 3.2e-93: tmp = z / b else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x / Float64(1.0 + Float64(a + Float64(y * Float64(b / t))))) tmp = 0.0 if (t <= -3.05e-49) tmp = t_1; elseif (t <= -1.15e-88) tmp = Float64(z / b); elseif (t <= -3.5e-123) tmp = Float64(z * Float64(y / Float64(t + Float64(t * a)))); elseif (t <= 3.2e-93) tmp = Float64(z / b); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x / (1.0 + (a + (y * (b / t)))); tmp = 0.0; if (t <= -3.05e-49) tmp = t_1; elseif (t <= -1.15e-88) tmp = z / b; elseif (t <= -3.5e-123) tmp = z * (y / (t + (t * a))); elseif (t <= 3.2e-93) tmp = z / b; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x / N[(1.0 + N[(a + N[(y * N[(b / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -3.05e-49], t$95$1, If[LessEqual[t, -1.15e-88], N[(z / b), $MachinePrecision], If[LessEqual[t, -3.5e-123], N[(z * N[(y / N[(t + N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3.2e-93], N[(z / b), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{1 + \left(a + y \cdot \frac{b}{t}\right)}\\
\mathbf{if}\;t \leq -3.05 \cdot 10^{-49}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq -1.15 \cdot 10^{-88}:\\
\;\;\;\;\frac{z}{b}\\
\mathbf{elif}\;t \leq -3.5 \cdot 10^{-123}:\\
\;\;\;\;z \cdot \frac{y}{t + t \cdot a}\\
\mathbf{elif}\;t \leq 3.2 \cdot 10^{-93}:\\
\;\;\;\;\frac{z}{b}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if t < -3.04999999999999982e-49 or 3.1999999999999999e-93 < t Initial program 81.0%
*-commutative81.0%
associate-*l/84.2%
*-commutative84.2%
associate-*l/92.5%
Simplified92.5%
Taylor expanded in x around inf 68.4%
associate-*l/71.4%
*-commutative71.4%
Simplified71.4%
if -3.04999999999999982e-49 < t < -1.14999999999999993e-88 or -3.4999999999999999e-123 < t < 3.1999999999999999e-93Initial program 66.7%
*-commutative66.7%
associate-*l/59.8%
*-commutative59.8%
associate-*l/51.8%
Simplified51.8%
Taylor expanded in t around 0 56.8%
if -1.14999999999999993e-88 < t < -3.4999999999999999e-123Initial program 83.9%
*-commutative83.9%
associate-*l/83.7%
*-commutative83.7%
associate-*l/83.7%
Simplified83.7%
Taylor expanded in b around 0 67.5%
Taylor expanded in x around 0 59.4%
associate-/l*59.4%
Simplified59.4%
associate-/r/59.6%
distribute-rgt-in59.6%
*-un-lft-identity59.6%
Applied egg-rr59.6%
Final simplification66.1%
(FPCore (x y z t a b)
:precision binary64
(if (<= t -2.9e-49)
(/ x (+ 1.0 (+ a (* y (/ b t)))))
(if (<= t -3.8e-88)
(/ z b)
(if (<= t -1.3e-117)
(* z (/ y (+ t (* t a))))
(if (<= t 9.2e-91) (/ z b) (/ x (+ 1.0 (+ a (/ y (/ t b))))))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -2.9e-49) {
tmp = x / (1.0 + (a + (y * (b / t))));
} else if (t <= -3.8e-88) {
tmp = z / b;
} else if (t <= -1.3e-117) {
tmp = z * (y / (t + (t * a)));
} else if (t <= 9.2e-91) {
tmp = z / b;
} else {
tmp = x / (1.0 + (a + (y / (t / b))));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (t <= (-2.9d-49)) then
tmp = x / (1.0d0 + (a + (y * (b / t))))
else if (t <= (-3.8d-88)) then
tmp = z / b
else if (t <= (-1.3d-117)) then
tmp = z * (y / (t + (t * a)))
else if (t <= 9.2d-91) then
tmp = z / b
else
tmp = x / (1.0d0 + (a + (y / (t / b))))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -2.9e-49) {
tmp = x / (1.0 + (a + (y * (b / t))));
} else if (t <= -3.8e-88) {
tmp = z / b;
} else if (t <= -1.3e-117) {
tmp = z * (y / (t + (t * a)));
} else if (t <= 9.2e-91) {
tmp = z / b;
} else {
tmp = x / (1.0 + (a + (y / (t / b))));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if t <= -2.9e-49: tmp = x / (1.0 + (a + (y * (b / t)))) elif t <= -3.8e-88: tmp = z / b elif t <= -1.3e-117: tmp = z * (y / (t + (t * a))) elif t <= 9.2e-91: tmp = z / b else: tmp = x / (1.0 + (a + (y / (t / b)))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (t <= -2.9e-49) tmp = Float64(x / Float64(1.0 + Float64(a + Float64(y * Float64(b / t))))); elseif (t <= -3.8e-88) tmp = Float64(z / b); elseif (t <= -1.3e-117) tmp = Float64(z * Float64(y / Float64(t + Float64(t * a)))); elseif (t <= 9.2e-91) tmp = Float64(z / b); else tmp = Float64(x / Float64(1.0 + Float64(a + Float64(y / Float64(t / b))))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (t <= -2.9e-49) tmp = x / (1.0 + (a + (y * (b / t)))); elseif (t <= -3.8e-88) tmp = z / b; elseif (t <= -1.3e-117) tmp = z * (y / (t + (t * a))); elseif (t <= 9.2e-91) tmp = z / b; else tmp = x / (1.0 + (a + (y / (t / b)))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -2.9e-49], N[(x / N[(1.0 + N[(a + N[(y * N[(b / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -3.8e-88], N[(z / b), $MachinePrecision], If[LessEqual[t, -1.3e-117], N[(z * N[(y / N[(t + N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 9.2e-91], N[(z / b), $MachinePrecision], N[(x / N[(1.0 + N[(a + N[(y / N[(t / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.9 \cdot 10^{-49}:\\
\;\;\;\;\frac{x}{1 + \left(a + y \cdot \frac{b}{t}\right)}\\
\mathbf{elif}\;t \leq -3.8 \cdot 10^{-88}:\\
\;\;\;\;\frac{z}{b}\\
\mathbf{elif}\;t \leq -1.3 \cdot 10^{-117}:\\
\;\;\;\;z \cdot \frac{y}{t + t \cdot a}\\
\mathbf{elif}\;t \leq 9.2 \cdot 10^{-91}:\\
\;\;\;\;\frac{z}{b}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{1 + \left(a + \frac{y}{\frac{t}{b}}\right)}\\
\end{array}
\end{array}
if t < -2.9e-49Initial program 74.4%
*-commutative74.4%
associate-*l/78.6%
*-commutative78.6%
associate-*l/90.6%
Simplified90.6%
Taylor expanded in x around inf 56.1%
associate-*l/60.1%
*-commutative60.1%
Simplified60.1%
if -2.9e-49 < t < -3.80000000000000011e-88 or -1.29999999999999992e-117 < t < 9.19999999999999982e-91Initial program 66.7%
*-commutative66.7%
associate-*l/59.8%
*-commutative59.8%
associate-*l/51.8%
Simplified51.8%
Taylor expanded in t around 0 56.8%
if -3.80000000000000011e-88 < t < -1.29999999999999992e-117Initial program 83.9%
*-commutative83.9%
associate-*l/83.7%
*-commutative83.7%
associate-*l/83.7%
Simplified83.7%
Taylor expanded in b around 0 67.5%
Taylor expanded in x around 0 59.4%
associate-/l*59.4%
Simplified59.4%
associate-/r/59.6%
distribute-rgt-in59.6%
*-un-lft-identity59.6%
Applied egg-rr59.6%
if 9.19999999999999982e-91 < t Initial program 86.3%
*-commutative86.3%
associate-*l/88.7%
*-commutative88.7%
associate-*l/94.1%
Simplified94.1%
Taylor expanded in x around inf 78.2%
associate-*l/80.4%
*-commutative80.4%
Simplified80.4%
clear-num80.4%
div-inv80.4%
Applied egg-rr80.4%
Final simplification66.1%
(FPCore (x y z t a b)
:precision binary64
(if (<= a -2.75e-11)
(/ (+ x (/ z (/ t y))) (+ a 1.0))
(if (<= a 650000.0)
(/ (+ x (* y (/ z t))) (+ 1.0 (/ (* y b) t)))
(/ (+ x (/ y (/ t z))) (+ a 1.0)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -2.75e-11) {
tmp = (x + (z / (t / y))) / (a + 1.0);
} else if (a <= 650000.0) {
tmp = (x + (y * (z / t))) / (1.0 + ((y * b) / t));
} else {
tmp = (x + (y / (t / z))) / (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 (a <= (-2.75d-11)) then
tmp = (x + (z / (t / y))) / (a + 1.0d0)
else if (a <= 650000.0d0) then
tmp = (x + (y * (z / t))) / (1.0d0 + ((y * b) / t))
else
tmp = (x + (y / (t / z))) / (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 (a <= -2.75e-11) {
tmp = (x + (z / (t / y))) / (a + 1.0);
} else if (a <= 650000.0) {
tmp = (x + (y * (z / t))) / (1.0 + ((y * b) / t));
} else {
tmp = (x + (y / (t / z))) / (a + 1.0);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if a <= -2.75e-11: tmp = (x + (z / (t / y))) / (a + 1.0) elif a <= 650000.0: tmp = (x + (y * (z / t))) / (1.0 + ((y * b) / t)) else: tmp = (x + (y / (t / z))) / (a + 1.0) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (a <= -2.75e-11) tmp = Float64(Float64(x + Float64(z / Float64(t / y))) / Float64(a + 1.0)); elseif (a <= 650000.0) tmp = Float64(Float64(x + Float64(y * Float64(z / t))) / Float64(1.0 + Float64(Float64(y * b) / t))); else tmp = Float64(Float64(x + Float64(y / Float64(t / z))) / Float64(a + 1.0)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (a <= -2.75e-11) tmp = (x + (z / (t / y))) / (a + 1.0); elseif (a <= 650000.0) tmp = (x + (y * (z / t))) / (1.0 + ((y * b) / t)); else tmp = (x + (y / (t / z))) / (a + 1.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, -2.75e-11], N[(N[(x + N[(z / N[(t / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(a + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 650000.0], N[(N[(x + N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(1.0 + N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x + N[(y / N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(a + 1.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.75 \cdot 10^{-11}:\\
\;\;\;\;\frac{x + \frac{z}{\frac{t}{y}}}{a + 1}\\
\mathbf{elif}\;a \leq 650000:\\
\;\;\;\;\frac{x + y \cdot \frac{z}{t}}{1 + \frac{y \cdot b}{t}}\\
\mathbf{else}:\\
\;\;\;\;\frac{x + \frac{y}{\frac{t}{z}}}{a + 1}\\
\end{array}
\end{array}
if a < -2.74999999999999987e-11Initial program 73.9%
*-commutative73.9%
associate-*l/78.6%
*-commutative78.6%
associate-*l/78.7%
Simplified78.7%
Taylor expanded in b around 0 66.2%
clear-num66.1%
inv-pow66.1%
*-commutative66.1%
associate-/r*68.0%
Applied egg-rr68.0%
unpow-168.0%
associate-/l/66.1%
associate-/r*70.3%
Simplified70.3%
Taylor expanded in t around 0 66.2%
associate-*r/68.0%
*-commutative68.0%
associate-/r/70.3%
Simplified70.3%
if -2.74999999999999987e-11 < a < 6.5e5Initial program 80.0%
*-commutative80.0%
associate-*l/77.0%
*-commutative77.0%
associate-*l/81.0%
Simplified81.0%
Taylor expanded in a around 0 76.9%
if 6.5e5 < a Initial program 72.9%
*-commutative72.9%
associate-*l/73.0%
*-commutative73.0%
associate-*l/75.6%
Simplified75.6%
Taylor expanded in b around 0 61.7%
associate-*l/59.0%
*-commutative59.0%
associate-/l*61.7%
Applied egg-rr61.7%
Final simplification70.9%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ y (/ t b))))
(if (<= y -4e-77)
(/ (+ x (* y (/ z t))) (+ t_1 (+ a 1.0)))
(/ (+ x (/ z (/ t y))) (+ a (+ 1.0 t_1))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = y / (t / b);
double tmp;
if (y <= -4e-77) {
tmp = (x + (y * (z / t))) / (t_1 + (a + 1.0));
} else {
tmp = (x + (z / (t / y))) / (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 = y / (t / b)
if (y <= (-4d-77)) then
tmp = (x + (y * (z / t))) / (t_1 + (a + 1.0d0))
else
tmp = (x + (z / (t / y))) / (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 = y / (t / b);
double tmp;
if (y <= -4e-77) {
tmp = (x + (y * (z / t))) / (t_1 + (a + 1.0));
} else {
tmp = (x + (z / (t / y))) / (a + (1.0 + t_1));
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = y / (t / b) tmp = 0 if y <= -4e-77: tmp = (x + (y * (z / t))) / (t_1 + (a + 1.0)) else: tmp = (x + (z / (t / y))) / (a + (1.0 + t_1)) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(y / Float64(t / b)) tmp = 0.0 if (y <= -4e-77) tmp = Float64(Float64(x + Float64(y * Float64(z / t))) / Float64(t_1 + Float64(a + 1.0))); else tmp = Float64(Float64(x + Float64(z / Float64(t / y))) / Float64(a + Float64(1.0 + t_1))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = y / (t / b); tmp = 0.0; if (y <= -4e-77) tmp = (x + (y * (z / t))) / (t_1 + (a + 1.0)); else tmp = (x + (z / (t / y))) / (a + (1.0 + t_1)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(y / N[(t / b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -4e-77], N[(N[(x + N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(t$95$1 + N[(a + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x + N[(z / N[(t / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(a + N[(1.0 + t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y}{\frac{t}{b}}\\
\mathbf{if}\;y \leq -4 \cdot 10^{-77}:\\
\;\;\;\;\frac{x + y \cdot \frac{z}{t}}{t_1 + \left(a + 1\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{x + \frac{z}{\frac{t}{y}}}{a + \left(1 + t_1\right)}\\
\end{array}
\end{array}
if y < -3.9999999999999997e-77Initial program 62.0%
*-commutative62.0%
associate-*l/64.9%
*-commutative64.9%
associate-*l/74.4%
Simplified74.4%
Taylor expanded in b around 0 64.9%
*-commutative64.9%
associate-/l*74.5%
Simplified74.5%
if -3.9999999999999997e-77 < y Initial program 81.9%
*-commutative81.9%
associate-/l*83.5%
associate-*l/86.5%
*-commutative86.5%
cancel-sign-sub86.5%
*-commutative86.5%
associate-*l/83.5%
associate-+r-83.5%
associate-*l/86.5%
*-commutative86.5%
cancel-sign-sub86.5%
*-commutative86.5%
associate-/r/83.4%
Simplified83.4%
Final simplification81.0%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ x (+ 1.0 (* y (/ b t))))) (t_2 (/ (+ x (* y (/ z t))) a)))
(if (<= a -2100000000000.0)
t_2
(if (<= a 4.4e-191)
t_1
(if (<= a 2.7e-155) (/ z b) (if (<= a 9000.0) t_1 t_2))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x / (1.0 + (y * (b / t)));
double t_2 = (x + (y * (z / t))) / a;
double tmp;
if (a <= -2100000000000.0) {
tmp = t_2;
} else if (a <= 4.4e-191) {
tmp = t_1;
} else if (a <= 2.7e-155) {
tmp = z / b;
} else if (a <= 9000.0) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = x / (1.0d0 + (y * (b / t)))
t_2 = (x + (y * (z / t))) / a
if (a <= (-2100000000000.0d0)) then
tmp = t_2
else if (a <= 4.4d-191) then
tmp = t_1
else if (a <= 2.7d-155) then
tmp = z / b
else if (a <= 9000.0d0) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x / (1.0 + (y * (b / t)));
double t_2 = (x + (y * (z / t))) / a;
double tmp;
if (a <= -2100000000000.0) {
tmp = t_2;
} else if (a <= 4.4e-191) {
tmp = t_1;
} else if (a <= 2.7e-155) {
tmp = z / b;
} else if (a <= 9000.0) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x / (1.0 + (y * (b / t))) t_2 = (x + (y * (z / t))) / a tmp = 0 if a <= -2100000000000.0: tmp = t_2 elif a <= 4.4e-191: tmp = t_1 elif a <= 2.7e-155: tmp = z / b elif a <= 9000.0: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x / Float64(1.0 + Float64(y * Float64(b / t)))) t_2 = Float64(Float64(x + Float64(y * Float64(z / t))) / a) tmp = 0.0 if (a <= -2100000000000.0) tmp = t_2; elseif (a <= 4.4e-191) tmp = t_1; elseif (a <= 2.7e-155) tmp = Float64(z / b); elseif (a <= 9000.0) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x / (1.0 + (y * (b / t))); t_2 = (x + (y * (z / t))) / a; tmp = 0.0; if (a <= -2100000000000.0) tmp = t_2; elseif (a <= 4.4e-191) tmp = t_1; elseif (a <= 2.7e-155) tmp = z / b; elseif (a <= 9000.0) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x / N[(1.0 + N[(y * N[(b / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x + N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]}, If[LessEqual[a, -2100000000000.0], t$95$2, If[LessEqual[a, 4.4e-191], t$95$1, If[LessEqual[a, 2.7e-155], N[(z / b), $MachinePrecision], If[LessEqual[a, 9000.0], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{1 + y \cdot \frac{b}{t}}\\
t_2 := \frac{x + y \cdot \frac{z}{t}}{a}\\
\mathbf{if}\;a \leq -2100000000000:\\
\;\;\;\;t_2\\
\mathbf{elif}\;a \leq 4.4 \cdot 10^{-191}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \leq 2.7 \cdot 10^{-155}:\\
\;\;\;\;\frac{z}{b}\\
\mathbf{elif}\;a \leq 9000:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if a < -2.1e12 or 9e3 < a Initial program 73.6%
*-commutative73.6%
associate-*l/76.0%
*-commutative76.0%
associate-*l/76.7%
Simplified76.7%
Taylor expanded in a around inf 66.0%
if -2.1e12 < a < 4.39999999999999996e-191 or 2.69999999999999981e-155 < a < 9e3Initial program 79.5%
*-commutative79.5%
associate-*l/77.4%
*-commutative77.4%
associate-*l/82.9%
Simplified82.9%
Taylor expanded in x around inf 58.0%
associate-*l/59.6%
*-commutative59.6%
Simplified59.6%
Taylor expanded in a around 0 56.4%
*-commutative56.4%
associate-*r/58.0%
Simplified58.0%
if 4.39999999999999996e-191 < a < 2.69999999999999981e-155Initial program 75.5%
*-commutative75.5%
associate-*l/63.6%
*-commutative63.6%
associate-*l/51.8%
Simplified51.8%
Taylor expanded in t around 0 89.8%
Final simplification63.0%
(FPCore (x y z t a b) :precision binary64 (if (<= b -2.8e+131) (/ z b) (if (<= b 7.5e+157) (/ (+ x (/ 1.0 (/ (/ t y) z))) (+ a 1.0)) (/ z b))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= -2.8e+131) {
tmp = z / b;
} else if (b <= 7.5e+157) {
tmp = (x + (1.0 / ((t / y) / z))) / (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 (b <= (-2.8d+131)) then
tmp = z / b
else if (b <= 7.5d+157) then
tmp = (x + (1.0d0 / ((t / y) / z))) / (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 (b <= -2.8e+131) {
tmp = z / b;
} else if (b <= 7.5e+157) {
tmp = (x + (1.0 / ((t / y) / z))) / (a + 1.0);
} else {
tmp = z / b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if b <= -2.8e+131: tmp = z / b elif b <= 7.5e+157: tmp = (x + (1.0 / ((t / y) / z))) / (a + 1.0) else: tmp = z / b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (b <= -2.8e+131) tmp = Float64(z / b); elseif (b <= 7.5e+157) tmp = Float64(Float64(x + Float64(1.0 / Float64(Float64(t / y) / z))) / 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 (b <= -2.8e+131) tmp = z / b; elseif (b <= 7.5e+157) tmp = (x + (1.0 / ((t / y) / z))) / (a + 1.0); else tmp = z / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[b, -2.8e+131], N[(z / b), $MachinePrecision], If[LessEqual[b, 7.5e+157], N[(N[(x + N[(1.0 / N[(N[(t / y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(a + 1.0), $MachinePrecision]), $MachinePrecision], N[(z / b), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -2.8 \cdot 10^{+131}:\\
\;\;\;\;\frac{z}{b}\\
\mathbf{elif}\;b \leq 7.5 \cdot 10^{+157}:\\
\;\;\;\;\frac{x + \frac{1}{\frac{\frac{t}{y}}{z}}}{a + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{b}\\
\end{array}
\end{array}
if b < -2.8000000000000001e131 or 7.5e157 < b Initial program 54.2%
*-commutative54.2%
associate-*l/51.8%
*-commutative51.8%
associate-*l/64.4%
Simplified64.4%
Taylor expanded in t around 0 56.1%
if -2.8000000000000001e131 < b < 7.5e157Initial program 84.5%
*-commutative84.5%
associate-*l/85.1%
*-commutative85.1%
associate-*l/84.1%
Simplified84.1%
Taylor expanded in b around 0 69.5%
clear-num69.5%
inv-pow69.5%
*-commutative69.5%
associate-/r*70.0%
Applied egg-rr70.0%
unpow-170.0%
associate-/l/69.5%
associate-/r*72.2%
Simplified72.2%
Final simplification68.0%
(FPCore (x y z t a b) :precision binary64 (/ (+ x (* y (/ z t))) (+ (* y (/ b t)) (+ a 1.0))))
double code(double x, double y, double z, double t, double a, double b) {
return (x + (y * (z / t))) / ((y * (b / t)) + (a + 1.0));
}
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))) / ((y * (b / t)) + (a + 1.0d0))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return (x + (y * (z / t))) / ((y * (b / t)) + (a + 1.0));
}
def code(x, y, z, t, a, b): return (x + (y * (z / t))) / ((y * (b / t)) + (a + 1.0))
function code(x, y, z, t, a, b) return Float64(Float64(x + Float64(y * Float64(z / t))) / Float64(Float64(y * Float64(b / t)) + Float64(a + 1.0))) end
function tmp = code(x, y, z, t, a, b) tmp = (x + (y * (z / t))) / ((y * (b / t)) + (a + 1.0)); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(x + N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(y * N[(b / t), $MachinePrecision]), $MachinePrecision] + N[(a + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x + y \cdot \frac{z}{t}}{y \cdot \frac{b}{t} + \left(a + 1\right)}
\end{array}
Initial program 76.5%
*-commutative76.5%
associate-*l/76.3%
*-commutative76.3%
associate-*l/78.9%
Simplified78.9%
Final simplification78.9%
(FPCore (x y z t a b) :precision binary64 (/ (+ x (* y (/ z t))) (+ (/ y (/ t b)) (+ a 1.0))))
double code(double x, double y, double z, double t, double a, double b) {
return (x + (y * (z / t))) / ((y / (t / b)) + (a + 1.0));
}
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))) / ((y / (t / b)) + (a + 1.0d0))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return (x + (y * (z / t))) / ((y / (t / b)) + (a + 1.0));
}
def code(x, y, z, t, a, b): return (x + (y * (z / t))) / ((y / (t / b)) + (a + 1.0))
function code(x, y, z, t, a, b) return Float64(Float64(x + Float64(y * Float64(z / t))) / Float64(Float64(y / Float64(t / b)) + Float64(a + 1.0))) end
function tmp = code(x, y, z, t, a, b) tmp = (x + (y * (z / t))) / ((y / (t / b)) + (a + 1.0)); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(x + N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(y / N[(t / b), $MachinePrecision]), $MachinePrecision] + N[(a + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x + y \cdot \frac{z}{t}}{\frac{y}{\frac{t}{b}} + \left(a + 1\right)}
\end{array}
Initial program 76.5%
*-commutative76.5%
associate-*l/76.3%
*-commutative76.3%
associate-*l/78.9%
Simplified78.9%
Taylor expanded in b around 0 76.3%
*-commutative76.3%
associate-/l*79.1%
Simplified79.1%
Final simplification79.1%
(FPCore (x y z t a b) :precision binary64 (if (or (<= b -5.6e+131) (not (<= b 1e+158))) (/ z b) (/ (+ x (/ z (/ t y))) (+ a 1.0))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((b <= -5.6e+131) || !(b <= 1e+158)) {
tmp = z / b;
} else {
tmp = (x + (z / (t / y))) / (a + 1.0);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((b <= (-5.6d+131)) .or. (.not. (b <= 1d+158))) then
tmp = z / b
else
tmp = (x + (z / (t / y))) / (a + 1.0d0)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((b <= -5.6e+131) || !(b <= 1e+158)) {
tmp = z / b;
} else {
tmp = (x + (z / (t / y))) / (a + 1.0);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (b <= -5.6e+131) or not (b <= 1e+158): tmp = z / b else: tmp = (x + (z / (t / y))) / (a + 1.0) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((b <= -5.6e+131) || !(b <= 1e+158)) tmp = Float64(z / b); else tmp = Float64(Float64(x + Float64(z / Float64(t / y))) / Float64(a + 1.0)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((b <= -5.6e+131) || ~((b <= 1e+158))) tmp = z / b; else tmp = (x + (z / (t / y))) / (a + 1.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[b, -5.6e+131], N[Not[LessEqual[b, 1e+158]], $MachinePrecision]], N[(z / b), $MachinePrecision], N[(N[(x + N[(z / N[(t / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(a + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -5.6 \cdot 10^{+131} \lor \neg \left(b \leq 10^{+158}\right):\\
\;\;\;\;\frac{z}{b}\\
\mathbf{else}:\\
\;\;\;\;\frac{x + \frac{z}{\frac{t}{y}}}{a + 1}\\
\end{array}
\end{array}
if b < -5.6000000000000001e131 or 9.99999999999999953e157 < b Initial program 54.2%
*-commutative54.2%
associate-*l/51.8%
*-commutative51.8%
associate-*l/64.4%
Simplified64.4%
Taylor expanded in t around 0 56.1%
if -5.6000000000000001e131 < b < 9.99999999999999953e157Initial program 84.5%
*-commutative84.5%
associate-*l/85.1%
*-commutative85.1%
associate-*l/84.1%
Simplified84.1%
Taylor expanded in b around 0 69.5%
clear-num69.5%
inv-pow69.5%
*-commutative69.5%
associate-/r*70.0%
Applied egg-rr70.0%
unpow-170.0%
associate-/l/69.5%
associate-/r*72.2%
Simplified72.2%
Taylor expanded in t around 0 69.5%
associate-*r/70.0%
*-commutative70.0%
associate-/r/72.2%
Simplified72.2%
Final simplification68.0%
(FPCore (x y z t a b) :precision binary64 (if (<= b -3.1e+131) (/ z b) (if (<= b 3.5e+157) (/ (+ x (* y (/ z t))) (+ a 1.0)) (/ z b))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= -3.1e+131) {
tmp = z / b;
} else if (b <= 3.5e+157) {
tmp = (x + (y * (z / t))) / (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 (b <= (-3.1d+131)) then
tmp = z / b
else if (b <= 3.5d+157) then
tmp = (x + (y * (z / t))) / (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 (b <= -3.1e+131) {
tmp = z / b;
} else if (b <= 3.5e+157) {
tmp = (x + (y * (z / t))) / (a + 1.0);
} else {
tmp = z / b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if b <= -3.1e+131: tmp = z / b elif b <= 3.5e+157: tmp = (x + (y * (z / t))) / (a + 1.0) else: tmp = z / b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (b <= -3.1e+131) tmp = Float64(z / b); elseif (b <= 3.5e+157) tmp = Float64(Float64(x + Float64(y * Float64(z / t))) / 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 (b <= -3.1e+131) tmp = z / b; elseif (b <= 3.5e+157) tmp = (x + (y * (z / t))) / (a + 1.0); else tmp = z / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[b, -3.1e+131], N[(z / b), $MachinePrecision], If[LessEqual[b, 3.5e+157], N[(N[(x + N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(a + 1.0), $MachinePrecision]), $MachinePrecision], N[(z / b), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -3.1 \cdot 10^{+131}:\\
\;\;\;\;\frac{z}{b}\\
\mathbf{elif}\;b \leq 3.5 \cdot 10^{+157}:\\
\;\;\;\;\frac{x + y \cdot \frac{z}{t}}{a + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{b}\\
\end{array}
\end{array}
if b < -3.10000000000000016e131 or 3.50000000000000002e157 < b Initial program 54.2%
*-commutative54.2%
associate-*l/51.8%
*-commutative51.8%
associate-*l/64.4%
Simplified64.4%
Taylor expanded in t around 0 56.1%
if -3.10000000000000016e131 < b < 3.50000000000000002e157Initial program 84.5%
*-commutative84.5%
associate-*l/85.1%
*-commutative85.1%
associate-*l/84.1%
Simplified84.1%
Taylor expanded in b around 0 70.0%
Final simplification66.3%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (- x (* x a))))
(if (<= a -1.0)
(/ x a)
(if (<= a 1.5e-191)
t_1
(if (<= a 2.05e-155)
(/ z b)
(if (<= a 7.8e-26) t_1 (if (<= a 1.4e+127) (/ z b) (/ x a))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x - (x * a);
double tmp;
if (a <= -1.0) {
tmp = x / a;
} else if (a <= 1.5e-191) {
tmp = t_1;
} else if (a <= 2.05e-155) {
tmp = z / b;
} else if (a <= 7.8e-26) {
tmp = t_1;
} else if (a <= 1.4e+127) {
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) :: t_1
real(8) :: tmp
t_1 = x - (x * a)
if (a <= (-1.0d0)) then
tmp = x / a
else if (a <= 1.5d-191) then
tmp = t_1
else if (a <= 2.05d-155) then
tmp = z / b
else if (a <= 7.8d-26) then
tmp = t_1
else if (a <= 1.4d+127) 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 t_1 = x - (x * a);
double tmp;
if (a <= -1.0) {
tmp = x / a;
} else if (a <= 1.5e-191) {
tmp = t_1;
} else if (a <= 2.05e-155) {
tmp = z / b;
} else if (a <= 7.8e-26) {
tmp = t_1;
} else if (a <= 1.4e+127) {
tmp = z / b;
} else {
tmp = x / a;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x - (x * a) tmp = 0 if a <= -1.0: tmp = x / a elif a <= 1.5e-191: tmp = t_1 elif a <= 2.05e-155: tmp = z / b elif a <= 7.8e-26: tmp = t_1 elif a <= 1.4e+127: tmp = z / b else: tmp = x / a return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x - Float64(x * a)) tmp = 0.0 if (a <= -1.0) tmp = Float64(x / a); elseif (a <= 1.5e-191) tmp = t_1; elseif (a <= 2.05e-155) tmp = Float64(z / b); elseif (a <= 7.8e-26) tmp = t_1; elseif (a <= 1.4e+127) tmp = Float64(z / b); else tmp = Float64(x / a); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x - (x * a); tmp = 0.0; if (a <= -1.0) tmp = x / a; elseif (a <= 1.5e-191) tmp = t_1; elseif (a <= 2.05e-155) tmp = z / b; elseif (a <= 7.8e-26) tmp = t_1; elseif (a <= 1.4e+127) tmp = z / b; else tmp = x / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x - N[(x * a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -1.0], N[(x / a), $MachinePrecision], If[LessEqual[a, 1.5e-191], t$95$1, If[LessEqual[a, 2.05e-155], N[(z / b), $MachinePrecision], If[LessEqual[a, 7.8e-26], t$95$1, If[LessEqual[a, 1.4e+127], N[(z / b), $MachinePrecision], N[(x / a), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x - x \cdot a\\
\mathbf{if}\;a \leq -1:\\
\;\;\;\;\frac{x}{a}\\
\mathbf{elif}\;a \leq 1.5 \cdot 10^{-191}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \leq 2.05 \cdot 10^{-155}:\\
\;\;\;\;\frac{z}{b}\\
\mathbf{elif}\;a \leq 7.8 \cdot 10^{-26}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \leq 1.4 \cdot 10^{+127}:\\
\;\;\;\;\frac{z}{b}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{a}\\
\end{array}
\end{array}
if a < -1 or 1.4000000000000001e127 < a Initial program 77.3%
*-commutative77.3%
associate-*l/81.4%
*-commutative81.4%
associate-*l/79.4%
Simplified79.4%
Taylor expanded in x around inf 59.9%
associate-*l/58.0%
*-commutative58.0%
Simplified58.0%
Taylor expanded in a around inf 55.1%
if -1 < a < 1.5e-191 or 2.0499999999999999e-155 < a < 7.79999999999999973e-26Initial program 79.9%
*-commutative79.9%
associate-*l/77.6%
*-commutative77.6%
associate-*l/83.4%
Simplified83.4%
Taylor expanded in t around inf 49.2%
Taylor expanded in a around 0 48.3%
mul-1-neg48.3%
unsub-neg48.3%
Simplified48.3%
if 1.5e-191 < a < 2.0499999999999999e-155 or 7.79999999999999973e-26 < a < 1.4000000000000001e127Initial program 65.7%
*-commutative65.7%
associate-*l/61.6%
*-commutative61.6%
associate-*l/66.0%
Simplified66.0%
Taylor expanded in t around 0 52.4%
Final simplification51.6%
(FPCore (x y z t a b) :precision binary64 (if (<= y -1.35e-31) (/ z b) (if (<= y 2.8e+142) (/ x (+ a 1.0)) (/ z b))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -1.35e-31) {
tmp = z / b;
} else if (y <= 2.8e+142) {
tmp = x / (a + 1.0);
} else {
tmp = z / b;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (y <= (-1.35d-31)) then
tmp = z / b
else if (y <= 2.8d+142) then
tmp = x / (a + 1.0d0)
else
tmp = z / b
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -1.35e-31) {
tmp = z / b;
} else if (y <= 2.8e+142) {
tmp = x / (a + 1.0);
} else {
tmp = z / b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -1.35e-31: tmp = z / b elif y <= 2.8e+142: tmp = x / (a + 1.0) else: tmp = z / b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -1.35e-31) tmp = Float64(z / b); elseif (y <= 2.8e+142) tmp = Float64(x / Float64(a + 1.0)); else tmp = Float64(z / b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= -1.35e-31) tmp = z / b; elseif (y <= 2.8e+142) tmp = x / (a + 1.0); else tmp = z / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -1.35e-31], N[(z / b), $MachinePrecision], If[LessEqual[y, 2.8e+142], N[(x / N[(a + 1.0), $MachinePrecision]), $MachinePrecision], N[(z / b), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.35 \cdot 10^{-31}:\\
\;\;\;\;\frac{z}{b}\\
\mathbf{elif}\;y \leq 2.8 \cdot 10^{+142}:\\
\;\;\;\;\frac{x}{a + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{b}\\
\end{array}
\end{array}
if y < -1.35000000000000007e-31 or 2.8e142 < y Initial program 55.0%
*-commutative55.0%
associate-*l/60.1%
*-commutative60.1%
associate-*l/72.7%
Simplified72.7%
Taylor expanded in t around 0 52.2%
if -1.35000000000000007e-31 < y < 2.8e142Initial program 90.0%
*-commutative90.0%
associate-*l/86.5%
*-commutative86.5%
associate-*l/82.8%
Simplified82.8%
Taylor expanded in t around inf 62.0%
Final simplification58.2%
(FPCore (x y z t a b) :precision binary64 (if (<= a -8.2e+54) (/ x a) (if (<= a 1.9e+127) (/ z b) (/ x a))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -8.2e+54) {
tmp = x / a;
} else if (a <= 1.9e+127) {
tmp = z / b;
} else {
tmp = x / a;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (a <= (-8.2d+54)) then
tmp = x / a
else if (a <= 1.9d+127) then
tmp = z / b
else
tmp = x / a
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -8.2e+54) {
tmp = x / a;
} else if (a <= 1.9e+127) {
tmp = z / b;
} else {
tmp = x / a;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if a <= -8.2e+54: tmp = x / a elif a <= 1.9e+127: tmp = z / b else: tmp = x / a return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (a <= -8.2e+54) tmp = Float64(x / a); elseif (a <= 1.9e+127) tmp = Float64(z / b); else tmp = Float64(x / a); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (a <= -8.2e+54) tmp = x / a; elseif (a <= 1.9e+127) tmp = z / b; else tmp = x / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, -8.2e+54], N[(x / a), $MachinePrecision], If[LessEqual[a, 1.9e+127], N[(z / b), $MachinePrecision], N[(x / a), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -8.2 \cdot 10^{+54}:\\
\;\;\;\;\frac{x}{a}\\
\mathbf{elif}\;a \leq 1.9 \cdot 10^{+127}:\\
\;\;\;\;\frac{z}{b}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{a}\\
\end{array}
\end{array}
if a < -8.19999999999999935e54 or 1.8999999999999999e127 < a Initial program 78.1%
*-commutative78.1%
associate-*l/82.6%
*-commutative82.6%
associate-*l/80.4%
Simplified80.4%
Taylor expanded in x around inf 61.9%
associate-*l/59.8%
*-commutative59.8%
Simplified59.8%
Taylor expanded in a around inf 58.6%
if -8.19999999999999935e54 < a < 1.8999999999999999e127Initial program 75.6%
*-commutative75.6%
associate-*l/73.0%
*-commutative73.0%
associate-*l/78.1%
Simplified78.1%
Taylor expanded in t around 0 39.1%
Final simplification45.8%
(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 76.5%
*-commutative76.5%
associate-*l/76.3%
*-commutative76.3%
associate-*l/78.9%
Simplified78.9%
Taylor expanded in x around inf 54.3%
associate-*l/55.4%
*-commutative55.4%
Simplified55.4%
Taylor expanded in a around inf 26.6%
Final simplification26.6%
(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 2023280
(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))))