
(FPCore (x y z t a b) :precision binary64 (/ (+ x (/ (* y z) t)) (+ (+ a 1.0) (/ (* y b) t))))
double code(double x, double y, double z, double t, double a, double b) {
return (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t));
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = (x + ((y * z) / t)) / ((a + 1.0d0) + ((y * b) / t))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t));
}
def code(x, y, z, t, a, b): return (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t))
function code(x, y, z, t, a, b) return Float64(Float64(x + Float64(Float64(y * z) / t)) / Float64(Float64(a + 1.0) + Float64(Float64(y * b) / t))) end
function tmp = code(x, y, z, t, a, b) tmp = (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t)); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] / N[(N[(a + 1.0), $MachinePrecision] + N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 14 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b) :precision binary64 (/ (+ x (/ (* y z) t)) (+ (+ a 1.0) (/ (* y b) t))))
double code(double x, double y, double z, double t, double a, double b) {
return (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t));
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = (x + ((y * z) / t)) / ((a + 1.0d0) + ((y * b) / t))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t));
}
def code(x, y, z, t, a, b): return (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t))
function code(x, y, z, t, a, b) return Float64(Float64(x + Float64(Float64(y * z) / t)) / Float64(Float64(a + 1.0) + Float64(Float64(y * b) / t))) end
function tmp = code(x, y, z, t, a, b) tmp = (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t)); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] / N[(N[(a + 1.0), $MachinePrecision] + N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}}
\end{array}
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (+ x (/ (* y z) t)) (+ (+ a 1.0) (/ (* y b) t)))))
(if (<= t_1 -1e-307)
(/ (+ x (* z (/ y t))) (+ a (+ 1.0 (/ y (/ t b)))))
(if (<= t_1 0.0)
(+ (/ (/ t (/ b x)) y) (/ z b))
(if (<= t_1 4e+294)
t_1
(if (<= t_1 INFINITY)
(* (/ y t) (/ z (+ 1.0 (+ a (* y (/ b t))))))
(/ (+ z (/ t (/ y x))) b)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t));
double tmp;
if (t_1 <= -1e-307) {
tmp = (x + (z * (y / t))) / (a + (1.0 + (y / (t / b))));
} else if (t_1 <= 0.0) {
tmp = ((t / (b / x)) / y) + (z / b);
} else if (t_1 <= 4e+294) {
tmp = t_1;
} else if (t_1 <= ((double) INFINITY)) {
tmp = (y / t) * (z / (1.0 + (a + (y * (b / t)))));
} else {
tmp = (z + (t / (y / x))) / b;
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t));
double tmp;
if (t_1 <= -1e-307) {
tmp = (x + (z * (y / t))) / (a + (1.0 + (y / (t / b))));
} else if (t_1 <= 0.0) {
tmp = ((t / (b / x)) / y) + (z / b);
} else if (t_1 <= 4e+294) {
tmp = t_1;
} else if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = (y / t) * (z / (1.0 + (a + (y * (b / t)))));
} else {
tmp = (z + (t / (y / x))) / b;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t)) tmp = 0 if t_1 <= -1e-307: tmp = (x + (z * (y / t))) / (a + (1.0 + (y / (t / b)))) elif t_1 <= 0.0: tmp = ((t / (b / x)) / y) + (z / b) elif t_1 <= 4e+294: tmp = t_1 elif t_1 <= math.inf: tmp = (y / t) * (z / (1.0 + (a + (y * (b / t))))) else: tmp = (z + (t / (y / x))) / b return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(x + Float64(Float64(y * z) / t)) / Float64(Float64(a + 1.0) + Float64(Float64(y * b) / t))) tmp = 0.0 if (t_1 <= -1e-307) tmp = Float64(Float64(x + Float64(z * Float64(y / t))) / Float64(a + Float64(1.0 + Float64(y / Float64(t / b))))); elseif (t_1 <= 0.0) tmp = Float64(Float64(Float64(t / Float64(b / x)) / y) + Float64(z / b)); elseif (t_1 <= 4e+294) tmp = t_1; elseif (t_1 <= Inf) tmp = Float64(Float64(y / t) * Float64(z / Float64(1.0 + Float64(a + Float64(y * Float64(b / t)))))); else tmp = Float64(Float64(z + Float64(t / Float64(y / x))) / b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t)); tmp = 0.0; if (t_1 <= -1e-307) tmp = (x + (z * (y / t))) / (a + (1.0 + (y / (t / b)))); elseif (t_1 <= 0.0) tmp = ((t / (b / x)) / y) + (z / b); elseif (t_1 <= 4e+294) tmp = t_1; elseif (t_1 <= Inf) tmp = (y / t) * (z / (1.0 + (a + (y * (b / t))))); else tmp = (z + (t / (y / x))) / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] / N[(N[(a + 1.0), $MachinePrecision] + N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -1e-307], N[(N[(x + N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(a + N[(1.0 + N[(y / N[(t / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 0.0], N[(N[(N[(t / N[(b / x), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision] + N[(z / b), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 4e+294], t$95$1, If[LessEqual[t$95$1, Infinity], N[(N[(y / t), $MachinePrecision] * N[(z / N[(1.0 + N[(a + N[(y * N[(b / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(z + N[(t / N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / b), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}}\\
\mathbf{if}\;t_1 \leq -1 \cdot 10^{-307}:\\
\;\;\;\;\frac{x + z \cdot \frac{y}{t}}{a + \left(1 + \frac{y}{\frac{t}{b}}\right)}\\
\mathbf{elif}\;t_1 \leq 0:\\
\;\;\;\;\frac{\frac{t}{\frac{b}{x}}}{y} + \frac{z}{b}\\
\mathbf{elif}\;t_1 \leq 4 \cdot 10^{+294}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t_1 \leq \infty:\\
\;\;\;\;\frac{y}{t} \cdot \frac{z}{1 + \left(a + y \cdot \frac{b}{t}\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{z + \frac{t}{\frac{y}{x}}}{b}\\
\end{array}
\end{array}
if (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < -9.99999999999999909e-308Initial program 89.0%
associate-/l*90.3%
associate-+l+90.3%
associate-/l*88.0%
Simplified88.0%
associate-/r/92.2%
Applied egg-rr92.2%
if -9.99999999999999909e-308 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < 0.0Initial program 46.6%
*-commutative46.6%
associate-*l/50.6%
*-commutative50.6%
associate-*l/61.5%
Simplified61.5%
Taylor expanded in y around -inf 64.1%
Taylor expanded in x around inf 69.5%
*-un-lft-identity69.5%
Applied egg-rr73.8%
if 0.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < 4.00000000000000027e294Initial program 99.7%
if 4.00000000000000027e294 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < +inf.0Initial program 31.0%
associate-/l*65.5%
associate-+l+65.5%
associate-/l*65.2%
Simplified65.2%
associate-/r/65.3%
Applied egg-rr65.3%
Taylor expanded in x around 0 47.5%
times-frac99.4%
associate-*l/90.9%
*-commutative90.9%
Simplified90.9%
if +inf.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) Initial program 0.0%
*-commutative0.0%
associate-*l/0.4%
*-commutative0.4%
associate-*l/11.2%
Simplified11.2%
Taylor expanded in y around -inf 70.9%
Taylor expanded in x around inf 93.0%
Taylor expanded in b around 0 93.0%
associate-/l*96.6%
Simplified96.6%
Final simplification91.9%
(FPCore (x y z t a b) :precision binary64 (if (or (<= t -2.3e-122) (not (<= t 4.1e-84))) (/ (+ x (* z (/ y t))) (+ a (+ 1.0 (/ y (/ t b))))) (+ (/ z b) (/ (/ (* x t) b) y))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -2.3e-122) || !(t <= 4.1e-84)) {
tmp = (x + (z * (y / t))) / (a + (1.0 + (y / (t / b))));
} else {
tmp = (z / b) + (((x * t) / b) / y);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((t <= (-2.3d-122)) .or. (.not. (t <= 4.1d-84))) then
tmp = (x + (z * (y / t))) / (a + (1.0d0 + (y / (t / b))))
else
tmp = (z / b) + (((x * t) / b) / y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -2.3e-122) || !(t <= 4.1e-84)) {
tmp = (x + (z * (y / t))) / (a + (1.0 + (y / (t / b))));
} else {
tmp = (z / b) + (((x * t) / b) / y);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (t <= -2.3e-122) or not (t <= 4.1e-84): tmp = (x + (z * (y / t))) / (a + (1.0 + (y / (t / b)))) else: tmp = (z / b) + (((x * t) / b) / y) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((t <= -2.3e-122) || !(t <= 4.1e-84)) tmp = Float64(Float64(x + Float64(z * Float64(y / t))) / Float64(a + Float64(1.0 + Float64(y / Float64(t / b))))); else tmp = Float64(Float64(z / b) + Float64(Float64(Float64(x * t) / b) / y)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((t <= -2.3e-122) || ~((t <= 4.1e-84))) tmp = (x + (z * (y / t))) / (a + (1.0 + (y / (t / b)))); else tmp = (z / b) + (((x * t) / b) / y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[t, -2.3e-122], N[Not[LessEqual[t, 4.1e-84]], $MachinePrecision]], N[(N[(x + N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(a + N[(1.0 + N[(y / N[(t / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(z / b), $MachinePrecision] + N[(N[(N[(x * t), $MachinePrecision] / b), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.3 \cdot 10^{-122} \lor \neg \left(t \leq 4.1 \cdot 10^{-84}\right):\\
\;\;\;\;\frac{x + z \cdot \frac{y}{t}}{a + \left(1 + \frac{y}{\frac{t}{b}}\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{b} + \frac{\frac{x \cdot t}{b}}{y}\\
\end{array}
\end{array}
if t < -2.30000000000000007e-122 or 4.10000000000000005e-84 < t Initial program 84.0%
associate-/l*87.9%
associate-+l+87.9%
associate-/l*91.8%
Simplified91.8%
associate-/r/92.5%
Applied egg-rr92.5%
if -2.30000000000000007e-122 < t < 4.10000000000000005e-84Initial program 52.1%
*-commutative52.1%
associate-*l/43.0%
*-commutative43.0%
associate-*l/37.3%
Simplified37.3%
Taylor expanded in y around -inf 73.9%
Taylor expanded in x around inf 80.9%
Final simplification88.6%
(FPCore (x y z t a b)
:precision binary64
(if (<= t -1.9e-122)
(/ (+ x (* y (/ z t))) (+ (+ a 1.0) (* y (/ b t))))
(if (<= t 2e-81)
(+ (/ z b) (/ (/ (* x t) b) y))
(/ (+ x (* z (/ y t))) (+ a (+ 1.0 (/ y (/ t b))))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -1.9e-122) {
tmp = (x + (y * (z / t))) / ((a + 1.0) + (y * (b / t)));
} else if (t <= 2e-81) {
tmp = (z / b) + (((x * t) / b) / y);
} else {
tmp = (x + (z * (y / t))) / (a + (1.0 + (y / (t / b))));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (t <= (-1.9d-122)) then
tmp = (x + (y * (z / t))) / ((a + 1.0d0) + (y * (b / t)))
else if (t <= 2d-81) then
tmp = (z / b) + (((x * t) / b) / y)
else
tmp = (x + (z * (y / t))) / (a + (1.0d0 + (y / (t / b))))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -1.9e-122) {
tmp = (x + (y * (z / t))) / ((a + 1.0) + (y * (b / t)));
} else if (t <= 2e-81) {
tmp = (z / b) + (((x * t) / b) / y);
} else {
tmp = (x + (z * (y / t))) / (a + (1.0 + (y / (t / b))));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if t <= -1.9e-122: tmp = (x + (y * (z / t))) / ((a + 1.0) + (y * (b / t))) elif t <= 2e-81: tmp = (z / b) + (((x * t) / b) / y) else: tmp = (x + (z * (y / t))) / (a + (1.0 + (y / (t / b)))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (t <= -1.9e-122) tmp = Float64(Float64(x + Float64(y * Float64(z / t))) / Float64(Float64(a + 1.0) + Float64(y * Float64(b / t)))); elseif (t <= 2e-81) tmp = Float64(Float64(z / b) + Float64(Float64(Float64(x * t) / b) / y)); else tmp = Float64(Float64(x + Float64(z * Float64(y / t))) / Float64(a + Float64(1.0 + Float64(y / Float64(t / b))))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (t <= -1.9e-122) tmp = (x + (y * (z / t))) / ((a + 1.0) + (y * (b / t))); elseif (t <= 2e-81) tmp = (z / b) + (((x * t) / b) / y); else tmp = (x + (z * (y / t))) / (a + (1.0 + (y / (t / b)))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -1.9e-122], N[(N[(x + N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(a + 1.0), $MachinePrecision] + N[(y * N[(b / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2e-81], N[(N[(z / b), $MachinePrecision] + N[(N[(N[(x * t), $MachinePrecision] / b), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], N[(N[(x + N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(a + N[(1.0 + N[(y / N[(t / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.9 \cdot 10^{-122}:\\
\;\;\;\;\frac{x + y \cdot \frac{z}{t}}{\left(a + 1\right) + y \cdot \frac{b}{t}}\\
\mathbf{elif}\;t \leq 2 \cdot 10^{-81}:\\
\;\;\;\;\frac{z}{b} + \frac{\frac{x \cdot t}{b}}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x + z \cdot \frac{y}{t}}{a + \left(1 + \frac{y}{\frac{t}{b}}\right)}\\
\end{array}
\end{array}
if t < -1.9e-122Initial program 85.1%
*-commutative85.1%
associate-*l/88.1%
*-commutative88.1%
associate-*l/92.0%
Simplified92.0%
if -1.9e-122 < t < 1.9999999999999999e-81Initial program 52.1%
*-commutative52.1%
associate-*l/43.0%
*-commutative43.0%
associate-*l/37.3%
Simplified37.3%
Taylor expanded in y around -inf 73.9%
Taylor expanded in x around inf 80.9%
if 1.9999999999999999e-81 < t Initial program 82.5%
associate-/l*87.5%
associate-+l+87.5%
associate-/l*91.5%
Simplified91.5%
associate-/r/93.3%
Applied egg-rr93.3%
Final simplification88.7%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ a (+ 1.0 (/ y (/ t b))))))
(if (<= t -3.5e-122)
(/ (+ x (/ y (/ t z))) t_1)
(if (<= t 3.6e-84)
(+ (/ z b) (/ (/ (* x t) b) y))
(/ (+ x (* z (/ y t))) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = a + (1.0 + (y / (t / b)));
double tmp;
if (t <= -3.5e-122) {
tmp = (x + (y / (t / z))) / t_1;
} else if (t <= 3.6e-84) {
tmp = (z / b) + (((x * t) / b) / y);
} else {
tmp = (x + (z * (y / t))) / t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = a + (1.0d0 + (y / (t / b)))
if (t <= (-3.5d-122)) then
tmp = (x + (y / (t / z))) / t_1
else if (t <= 3.6d-84) then
tmp = (z / b) + (((x * t) / b) / y)
else
tmp = (x + (z * (y / t))) / t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = a + (1.0 + (y / (t / b)));
double tmp;
if (t <= -3.5e-122) {
tmp = (x + (y / (t / z))) / t_1;
} else if (t <= 3.6e-84) {
tmp = (z / b) + (((x * t) / b) / y);
} else {
tmp = (x + (z * (y / t))) / t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = a + (1.0 + (y / (t / b))) tmp = 0 if t <= -3.5e-122: tmp = (x + (y / (t / z))) / t_1 elif t <= 3.6e-84: tmp = (z / b) + (((x * t) / b) / y) else: tmp = (x + (z * (y / t))) / t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(a + Float64(1.0 + Float64(y / Float64(t / b)))) tmp = 0.0 if (t <= -3.5e-122) tmp = Float64(Float64(x + Float64(y / Float64(t / z))) / t_1); elseif (t <= 3.6e-84) tmp = Float64(Float64(z / b) + Float64(Float64(Float64(x * t) / b) / y)); else tmp = Float64(Float64(x + Float64(z * Float64(y / t))) / t_1); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = a + (1.0 + (y / (t / b))); tmp = 0.0; if (t <= -3.5e-122) tmp = (x + (y / (t / z))) / t_1; elseif (t <= 3.6e-84) tmp = (z / b) + (((x * t) / b) / y); else tmp = (x + (z * (y / t))) / t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(a + N[(1.0 + N[(y / N[(t / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -3.5e-122], N[(N[(x + N[(y / N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision], If[LessEqual[t, 3.6e-84], N[(N[(z / b), $MachinePrecision] + N[(N[(N[(x * t), $MachinePrecision] / b), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], N[(N[(x + N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a + \left(1 + \frac{y}{\frac{t}{b}}\right)\\
\mathbf{if}\;t \leq -3.5 \cdot 10^{-122}:\\
\;\;\;\;\frac{x + \frac{y}{\frac{t}{z}}}{t_1}\\
\mathbf{elif}\;t \leq 3.6 \cdot 10^{-84}:\\
\;\;\;\;\frac{z}{b} + \frac{\frac{x \cdot t}{b}}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x + z \cdot \frac{y}{t}}{t_1}\\
\end{array}
\end{array}
if t < -3.5000000000000001e-122Initial program 85.1%
associate-/l*88.1%
associate-+l+88.1%
associate-/l*92.0%
Simplified92.0%
if -3.5000000000000001e-122 < t < 3.60000000000000003e-84Initial program 52.1%
*-commutative52.1%
associate-*l/43.0%
*-commutative43.0%
associate-*l/37.3%
Simplified37.3%
Taylor expanded in y around -inf 73.9%
Taylor expanded in x around inf 80.9%
if 3.60000000000000003e-84 < t Initial program 82.5%
associate-/l*87.5%
associate-+l+87.5%
associate-/l*91.5%
Simplified91.5%
associate-/r/93.3%
Applied egg-rr93.3%
Final simplification88.7%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ x (+ a 1.0))))
(if (<= t -6e-122)
t_1
(if (<= t 7.5e+38)
(/ (+ z (/ t (/ y x))) b)
(if (<= t 4.3e+98)
(/ (+ x (/ (* y z) t)) a)
(if (<= t 4.6e+109) (/ z b) t_1))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x / (a + 1.0);
double tmp;
if (t <= -6e-122) {
tmp = t_1;
} else if (t <= 7.5e+38) {
tmp = (z + (t / (y / x))) / b;
} else if (t <= 4.3e+98) {
tmp = (x + ((y * z) / t)) / a;
} else if (t <= 4.6e+109) {
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 / (a + 1.0d0)
if (t <= (-6d-122)) then
tmp = t_1
else if (t <= 7.5d+38) then
tmp = (z + (t / (y / x))) / b
else if (t <= 4.3d+98) then
tmp = (x + ((y * z) / t)) / a
else if (t <= 4.6d+109) 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 / (a + 1.0);
double tmp;
if (t <= -6e-122) {
tmp = t_1;
} else if (t <= 7.5e+38) {
tmp = (z + (t / (y / x))) / b;
} else if (t <= 4.3e+98) {
tmp = (x + ((y * z) / t)) / a;
} else if (t <= 4.6e+109) {
tmp = z / b;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x / (a + 1.0) tmp = 0 if t <= -6e-122: tmp = t_1 elif t <= 7.5e+38: tmp = (z + (t / (y / x))) / b elif t <= 4.3e+98: tmp = (x + ((y * z) / t)) / a elif t <= 4.6e+109: tmp = z / b else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x / Float64(a + 1.0)) tmp = 0.0 if (t <= -6e-122) tmp = t_1; elseif (t <= 7.5e+38) tmp = Float64(Float64(z + Float64(t / Float64(y / x))) / b); elseif (t <= 4.3e+98) tmp = Float64(Float64(x + Float64(Float64(y * z) / t)) / a); elseif (t <= 4.6e+109) 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 / (a + 1.0); tmp = 0.0; if (t <= -6e-122) tmp = t_1; elseif (t <= 7.5e+38) tmp = (z + (t / (y / x))) / b; elseif (t <= 4.3e+98) tmp = (x + ((y * z) / t)) / a; elseif (t <= 4.6e+109) 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[(a + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -6e-122], t$95$1, If[LessEqual[t, 7.5e+38], N[(N[(z + N[(t / N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / b), $MachinePrecision], If[LessEqual[t, 4.3e+98], N[(N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision], If[LessEqual[t, 4.6e+109], N[(z / b), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{a + 1}\\
\mathbf{if}\;t \leq -6 \cdot 10^{-122}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 7.5 \cdot 10^{+38}:\\
\;\;\;\;\frac{z + \frac{t}{\frac{y}{x}}}{b}\\
\mathbf{elif}\;t \leq 4.3 \cdot 10^{+98}:\\
\;\;\;\;\frac{x + \frac{y \cdot z}{t}}{a}\\
\mathbf{elif}\;t \leq 4.6 \cdot 10^{+109}:\\
\;\;\;\;\frac{z}{b}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if t < -6.00000000000000009e-122 or 4.60000000000000021e109 < t Initial program 83.4%
*-commutative83.4%
associate-*l/89.0%
*-commutative89.0%
associate-*l/93.2%
Simplified93.2%
Taylor expanded in t around inf 63.1%
if -6.00000000000000009e-122 < t < 7.4999999999999999e38Initial program 59.9%
*-commutative59.9%
associate-*l/51.6%
*-commutative51.6%
associate-*l/46.0%
Simplified46.0%
Taylor expanded in y around -inf 70.6%
Taylor expanded in x around inf 77.2%
Taylor expanded in b around 0 77.2%
associate-/l*75.2%
Simplified75.2%
if 7.4999999999999999e38 < t < 4.3000000000000001e98Initial program 85.8%
*-commutative85.8%
associate-*l/85.5%
*-commutative85.5%
associate-*l/92.5%
Simplified92.5%
Taylor expanded in a around inf 64.2%
if 4.3000000000000001e98 < t < 4.60000000000000021e109Initial program 7.4%
*-commutative7.4%
associate-*l/7.4%
*-commutative7.4%
associate-*l/54.3%
Simplified54.3%
Taylor expanded in t around 0 100.0%
Final simplification68.4%
(FPCore (x y z t a b)
:precision binary64
(if (<= t -7.8e-122)
(/ x (+ 1.0 (+ a (/ (* y b) t))))
(if (<= t 8e+38)
(/ (+ z (/ t (/ y x))) b)
(if (<= t 6.4e+98)
(/ (+ x (/ (* y z) t)) a)
(if (<= t 4.6e+109) (/ z b) (/ x (+ a 1.0)))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -7.8e-122) {
tmp = x / (1.0 + (a + ((y * b) / t)));
} else if (t <= 8e+38) {
tmp = (z + (t / (y / x))) / b;
} else if (t <= 6.4e+98) {
tmp = (x + ((y * z) / t)) / a;
} else if (t <= 4.6e+109) {
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 (t <= (-7.8d-122)) then
tmp = x / (1.0d0 + (a + ((y * b) / t)))
else if (t <= 8d+38) then
tmp = (z + (t / (y / x))) / b
else if (t <= 6.4d+98) then
tmp = (x + ((y * z) / t)) / a
else if (t <= 4.6d+109) 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 (t <= -7.8e-122) {
tmp = x / (1.0 + (a + ((y * b) / t)));
} else if (t <= 8e+38) {
tmp = (z + (t / (y / x))) / b;
} else if (t <= 6.4e+98) {
tmp = (x + ((y * z) / t)) / a;
} else if (t <= 4.6e+109) {
tmp = z / b;
} else {
tmp = x / (a + 1.0);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if t <= -7.8e-122: tmp = x / (1.0 + (a + ((y * b) / t))) elif t <= 8e+38: tmp = (z + (t / (y / x))) / b elif t <= 6.4e+98: tmp = (x + ((y * z) / t)) / a elif t <= 4.6e+109: tmp = z / b else: tmp = x / (a + 1.0) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (t <= -7.8e-122) tmp = Float64(x / Float64(1.0 + Float64(a + Float64(Float64(y * b) / t)))); elseif (t <= 8e+38) tmp = Float64(Float64(z + Float64(t / Float64(y / x))) / b); elseif (t <= 6.4e+98) tmp = Float64(Float64(x + Float64(Float64(y * z) / t)) / a); elseif (t <= 4.6e+109) 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 (t <= -7.8e-122) tmp = x / (1.0 + (a + ((y * b) / t))); elseif (t <= 8e+38) tmp = (z + (t / (y / x))) / b; elseif (t <= 6.4e+98) tmp = (x + ((y * z) / t)) / a; elseif (t <= 4.6e+109) tmp = z / b; else tmp = x / (a + 1.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -7.8e-122], N[(x / N[(1.0 + N[(a + N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 8e+38], N[(N[(z + N[(t / N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / b), $MachinePrecision], If[LessEqual[t, 6.4e+98], N[(N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision], If[LessEqual[t, 4.6e+109], N[(z / b), $MachinePrecision], N[(x / N[(a + 1.0), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -7.8 \cdot 10^{-122}:\\
\;\;\;\;\frac{x}{1 + \left(a + \frac{y \cdot b}{t}\right)}\\
\mathbf{elif}\;t \leq 8 \cdot 10^{+38}:\\
\;\;\;\;\frac{z + \frac{t}{\frac{y}{x}}}{b}\\
\mathbf{elif}\;t \leq 6.4 \cdot 10^{+98}:\\
\;\;\;\;\frac{x + \frac{y \cdot z}{t}}{a}\\
\mathbf{elif}\;t \leq 4.6 \cdot 10^{+109}:\\
\;\;\;\;\frac{z}{b}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{a + 1}\\
\end{array}
\end{array}
if t < -7.79999999999999979e-122Initial program 85.1%
*-commutative85.1%
associate-*l/88.1%
*-commutative88.1%
associate-*l/92.0%
Simplified92.0%
Taylor expanded in x around inf 62.0%
if -7.79999999999999979e-122 < t < 7.99999999999999982e38Initial program 59.9%
*-commutative59.9%
associate-*l/51.6%
*-commutative51.6%
associate-*l/46.0%
Simplified46.0%
Taylor expanded in y around -inf 70.6%
Taylor expanded in x around inf 77.2%
Taylor expanded in b around 0 77.2%
associate-/l*75.2%
Simplified75.2%
if 7.99999999999999982e38 < t < 6.4000000000000005e98Initial program 85.8%
*-commutative85.8%
associate-*l/85.5%
*-commutative85.5%
associate-*l/92.5%
Simplified92.5%
Taylor expanded in a around inf 64.2%
if 6.4000000000000005e98 < t < 4.60000000000000021e109Initial program 7.4%
*-commutative7.4%
associate-*l/7.4%
*-commutative7.4%
associate-*l/54.3%
Simplified54.3%
Taylor expanded in t around 0 100.0%
if 4.60000000000000021e109 < t Initial program 79.2%
*-commutative79.2%
associate-*l/91.2%
*-commutative91.2%
associate-*l/96.3%
Simplified96.3%
Taylor expanded in t around inf 76.0%
Final simplification69.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ x (+ a 1.0))))
(if (<= t -7.8e-122)
t_1
(if (<= t 6.2e+35)
(/ z b)
(if (<= t 8.4e+101) (/ (+ x (/ (* y z) t)) a) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x / (a + 1.0);
double tmp;
if (t <= -7.8e-122) {
tmp = t_1;
} else if (t <= 6.2e+35) {
tmp = z / b;
} else if (t <= 8.4e+101) {
tmp = (x + ((y * z) / t)) / a;
} 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 / (a + 1.0d0)
if (t <= (-7.8d-122)) then
tmp = t_1
else if (t <= 6.2d+35) then
tmp = z / b
else if (t <= 8.4d+101) then
tmp = (x + ((y * z) / t)) / a
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 / (a + 1.0);
double tmp;
if (t <= -7.8e-122) {
tmp = t_1;
} else if (t <= 6.2e+35) {
tmp = z / b;
} else if (t <= 8.4e+101) {
tmp = (x + ((y * z) / t)) / a;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x / (a + 1.0) tmp = 0 if t <= -7.8e-122: tmp = t_1 elif t <= 6.2e+35: tmp = z / b elif t <= 8.4e+101: tmp = (x + ((y * z) / t)) / a else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x / Float64(a + 1.0)) tmp = 0.0 if (t <= -7.8e-122) tmp = t_1; elseif (t <= 6.2e+35) tmp = Float64(z / b); elseif (t <= 8.4e+101) tmp = Float64(Float64(x + Float64(Float64(y * z) / t)) / a); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x / (a + 1.0); tmp = 0.0; if (t <= -7.8e-122) tmp = t_1; elseif (t <= 6.2e+35) tmp = z / b; elseif (t <= 8.4e+101) tmp = (x + ((y * z) / t)) / a; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x / N[(a + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -7.8e-122], t$95$1, If[LessEqual[t, 6.2e+35], N[(z / b), $MachinePrecision], If[LessEqual[t, 8.4e+101], N[(N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{a + 1}\\
\mathbf{if}\;t \leq -7.8 \cdot 10^{-122}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 6.2 \cdot 10^{+35}:\\
\;\;\;\;\frac{z}{b}\\
\mathbf{elif}\;t \leq 8.4 \cdot 10^{+101}:\\
\;\;\;\;\frac{x + \frac{y \cdot z}{t}}{a}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if t < -7.79999999999999979e-122 or 8.4000000000000001e101 < t Initial program 82.9%
*-commutative82.9%
associate-*l/88.4%
*-commutative88.4%
associate-*l/93.2%
Simplified93.2%
Taylor expanded in t around inf 62.8%
if -7.79999999999999979e-122 < t < 6.19999999999999973e35Initial program 59.1%
*-commutative59.1%
associate-*l/50.6%
*-commutative50.6%
associate-*l/44.9%
Simplified44.9%
Taylor expanded in t around 0 67.2%
if 6.19999999999999973e35 < t < 8.4000000000000001e101Initial program 82.8%
*-commutative82.8%
associate-*l/82.7%
*-commutative82.7%
associate-*l/88.4%
Simplified88.4%
Taylor expanded in a around inf 53.7%
Final simplification63.9%
(FPCore (x y z t a b) :precision binary64 (if (or (<= t -3.1e-67) (not (<= t 1.6e-19))) (/ x (+ (+ a 1.0) (* y (/ b t)))) (/ (+ z (/ t (/ y x))) b)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -3.1e-67) || !(t <= 1.6e-19)) {
tmp = x / ((a + 1.0) + (y * (b / t)));
} else {
tmp = (z + (t / (y / x))) / b;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((t <= (-3.1d-67)) .or. (.not. (t <= 1.6d-19))) then
tmp = x / ((a + 1.0d0) + (y * (b / t)))
else
tmp = (z + (t / (y / x))) / b
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -3.1e-67) || !(t <= 1.6e-19)) {
tmp = x / ((a + 1.0) + (y * (b / t)));
} else {
tmp = (z + (t / (y / x))) / b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (t <= -3.1e-67) or not (t <= 1.6e-19): tmp = x / ((a + 1.0) + (y * (b / t))) else: tmp = (z + (t / (y / x))) / b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((t <= -3.1e-67) || !(t <= 1.6e-19)) tmp = Float64(x / Float64(Float64(a + 1.0) + Float64(y * Float64(b / t)))); else tmp = Float64(Float64(z + Float64(t / Float64(y / x))) / b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((t <= -3.1e-67) || ~((t <= 1.6e-19))) tmp = x / ((a + 1.0) + (y * (b / t))); else tmp = (z + (t / (y / x))) / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[t, -3.1e-67], N[Not[LessEqual[t, 1.6e-19]], $MachinePrecision]], N[(x / N[(N[(a + 1.0), $MachinePrecision] + N[(y * N[(b / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(z + N[(t / N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.1 \cdot 10^{-67} \lor \neg \left(t \leq 1.6 \cdot 10^{-19}\right):\\
\;\;\;\;\frac{x}{\left(a + 1\right) + y \cdot \frac{b}{t}}\\
\mathbf{else}:\\
\;\;\;\;\frac{z + \frac{t}{\frac{y}{x}}}{b}\\
\end{array}
\end{array}
if t < -3.1000000000000003e-67 or 1.59999999999999991e-19 < t Initial program 84.6%
*-commutative84.6%
associate-*l/89.6%
*-commutative89.6%
associate-*l/95.2%
Simplified95.2%
Taylor expanded in x around inf 66.5%
if -3.1000000000000003e-67 < t < 1.59999999999999991e-19Initial program 56.7%
*-commutative56.7%
associate-*l/48.2%
*-commutative48.2%
associate-*l/41.7%
Simplified41.7%
Taylor expanded in y around -inf 68.9%
Taylor expanded in x around inf 76.7%
Taylor expanded in b around 0 77.6%
associate-/l*75.5%
Simplified75.5%
Final simplification70.1%
(FPCore (x y z t a b) :precision binary64 (if (or (<= t -6e-122) (not (<= t 5.5e-17))) (/ (+ x (/ (* y z) t)) (+ a 1.0)) (/ (+ z (/ t (/ y x))) b)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -6e-122) || !(t <= 5.5e-17)) {
tmp = (x + ((y * z) / t)) / (a + 1.0);
} else {
tmp = (z + (t / (y / x))) / b;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((t <= (-6d-122)) .or. (.not. (t <= 5.5d-17))) then
tmp = (x + ((y * z) / t)) / (a + 1.0d0)
else
tmp = (z + (t / (y / x))) / b
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -6e-122) || !(t <= 5.5e-17)) {
tmp = (x + ((y * z) / t)) / (a + 1.0);
} else {
tmp = (z + (t / (y / x))) / b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (t <= -6e-122) or not (t <= 5.5e-17): tmp = (x + ((y * z) / t)) / (a + 1.0) else: tmp = (z + (t / (y / x))) / b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((t <= -6e-122) || !(t <= 5.5e-17)) tmp = Float64(Float64(x + Float64(Float64(y * z) / t)) / Float64(a + 1.0)); else tmp = Float64(Float64(z + Float64(t / Float64(y / x))) / b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((t <= -6e-122) || ~((t <= 5.5e-17))) tmp = (x + ((y * z) / t)) / (a + 1.0); else tmp = (z + (t / (y / x))) / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[t, -6e-122], N[Not[LessEqual[t, 5.5e-17]], $MachinePrecision]], N[(N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] / N[(a + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(z + N[(t / N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -6 \cdot 10^{-122} \lor \neg \left(t \leq 5.5 \cdot 10^{-17}\right):\\
\;\;\;\;\frac{x + \frac{y \cdot z}{t}}{a + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{z + \frac{t}{\frac{y}{x}}}{b}\\
\end{array}
\end{array}
if t < -6.00000000000000009e-122 or 5.50000000000000001e-17 < t Initial program 83.5%
*-commutative83.5%
associate-*l/88.2%
*-commutative88.2%
associate-*l/93.0%
Simplified93.0%
Taylor expanded in b around 0 72.0%
if -6.00000000000000009e-122 < t < 5.50000000000000001e-17Initial program 56.6%
*-commutative56.6%
associate-*l/47.5%
*-commutative47.5%
associate-*l/41.5%
Simplified41.5%
Taylor expanded in y around -inf 72.2%
Taylor expanded in x around inf 79.4%
Taylor expanded in b around 0 80.4%
associate-/l*78.1%
Simplified78.1%
Final simplification74.3%
(FPCore (x y z t a b) :precision binary64 (if (or (<= t -7.8e-122) (not (<= t 2.6e+38))) (/ (+ x (/ (* y z) t)) (+ a 1.0)) (+ (/ z b) (/ (/ (* x t) b) y))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -7.8e-122) || !(t <= 2.6e+38)) {
tmp = (x + ((y * z) / t)) / (a + 1.0);
} else {
tmp = (z / b) + (((x * t) / b) / y);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((t <= (-7.8d-122)) .or. (.not. (t <= 2.6d+38))) then
tmp = (x + ((y * z) / t)) / (a + 1.0d0)
else
tmp = (z / b) + (((x * t) / b) / y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -7.8e-122) || !(t <= 2.6e+38)) {
tmp = (x + ((y * z) / t)) / (a + 1.0);
} else {
tmp = (z / b) + (((x * t) / b) / y);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (t <= -7.8e-122) or not (t <= 2.6e+38): tmp = (x + ((y * z) / t)) / (a + 1.0) else: tmp = (z / b) + (((x * t) / b) / y) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((t <= -7.8e-122) || !(t <= 2.6e+38)) tmp = Float64(Float64(x + Float64(Float64(y * z) / t)) / Float64(a + 1.0)); else tmp = Float64(Float64(z / b) + Float64(Float64(Float64(x * t) / b) / y)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((t <= -7.8e-122) || ~((t <= 2.6e+38))) tmp = (x + ((y * z) / t)) / (a + 1.0); else tmp = (z / b) + (((x * t) / b) / y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[t, -7.8e-122], N[Not[LessEqual[t, 2.6e+38]], $MachinePrecision]], N[(N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] / N[(a + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(z / b), $MachinePrecision] + N[(N[(N[(x * t), $MachinePrecision] / b), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -7.8 \cdot 10^{-122} \lor \neg \left(t \leq 2.6 \cdot 10^{+38}\right):\\
\;\;\;\;\frac{x + \frac{y \cdot z}{t}}{a + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{b} + \frac{\frac{x \cdot t}{b}}{y}\\
\end{array}
\end{array}
if t < -7.79999999999999979e-122 or 2.5999999999999999e38 < t Initial program 82.6%
*-commutative82.6%
associate-*l/87.6%
*-commutative87.6%
associate-*l/92.6%
Simplified92.6%
Taylor expanded in b around 0 73.1%
if -7.79999999999999979e-122 < t < 2.5999999999999999e38Initial program 59.9%
*-commutative59.9%
associate-*l/51.6%
*-commutative51.6%
associate-*l/46.0%
Simplified46.0%
Taylor expanded in y around -inf 70.6%
Taylor expanded in x around inf 77.2%
Final simplification74.8%
(FPCore (x y z t a b) :precision binary64 (if (<= a -9.5e-114) (/ z b) (if (<= a -1e-224) x (if (<= a 4.1e+99) (/ z b) (/ x a)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -9.5e-114) {
tmp = z / b;
} else if (a <= -1e-224) {
tmp = x;
} else if (a <= 4.1e+99) {
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 <= (-9.5d-114)) then
tmp = z / b
else if (a <= (-1d-224)) then
tmp = x
else if (a <= 4.1d+99) 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 <= -9.5e-114) {
tmp = z / b;
} else if (a <= -1e-224) {
tmp = x;
} else if (a <= 4.1e+99) {
tmp = z / b;
} else {
tmp = x / a;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if a <= -9.5e-114: tmp = z / b elif a <= -1e-224: tmp = x elif a <= 4.1e+99: tmp = z / b else: tmp = x / a return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (a <= -9.5e-114) tmp = Float64(z / b); elseif (a <= -1e-224) tmp = x; elseif (a <= 4.1e+99) 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 <= -9.5e-114) tmp = z / b; elseif (a <= -1e-224) tmp = x; elseif (a <= 4.1e+99) tmp = z / b; else tmp = x / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, -9.5e-114], N[(z / b), $MachinePrecision], If[LessEqual[a, -1e-224], x, If[LessEqual[a, 4.1e+99], N[(z / b), $MachinePrecision], N[(x / a), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -9.5 \cdot 10^{-114}:\\
\;\;\;\;\frac{z}{b}\\
\mathbf{elif}\;a \leq -1 \cdot 10^{-224}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 4.1 \cdot 10^{+99}:\\
\;\;\;\;\frac{z}{b}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{a}\\
\end{array}
\end{array}
if a < -9.49999999999999958e-114 or -1e-224 < a < 4.09999999999999979e99Initial program 72.2%
*-commutative72.2%
associate-*l/69.6%
*-commutative69.6%
associate-*l/71.0%
Simplified71.0%
Taylor expanded in t around 0 43.3%
if -9.49999999999999958e-114 < a < -1e-224Initial program 75.0%
*-commutative75.0%
associate-*l/85.0%
*-commutative85.0%
associate-*l/80.1%
Simplified80.1%
Taylor expanded in x around inf 63.2%
Taylor expanded in a around 0 68.1%
Taylor expanded in b around 0 62.7%
if 4.09999999999999979e99 < a Initial program 78.1%
*-commutative78.1%
associate-*l/82.7%
*-commutative82.7%
associate-*l/82.7%
Simplified82.7%
Taylor expanded in x around inf 69.7%
Taylor expanded in a around inf 67.4%
Final simplification48.8%
(FPCore (x y z t a b) :precision binary64 (if (or (<= t -7.8e-122) (not (<= t 1.1e-16))) (/ x (+ a 1.0)) (/ z b)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -7.8e-122) || !(t <= 1.1e-16)) {
tmp = x / (a + 1.0);
} else {
tmp = z / b;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((t <= (-7.8d-122)) .or. (.not. (t <= 1.1d-16))) then
tmp = x / (a + 1.0d0)
else
tmp = z / b
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -7.8e-122) || !(t <= 1.1e-16)) {
tmp = x / (a + 1.0);
} else {
tmp = z / b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (t <= -7.8e-122) or not (t <= 1.1e-16): tmp = x / (a + 1.0) else: tmp = z / b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((t <= -7.8e-122) || !(t <= 1.1e-16)) tmp = Float64(x / Float64(a + 1.0)); else tmp = Float64(z / b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((t <= -7.8e-122) || ~((t <= 1.1e-16))) tmp = x / (a + 1.0); else tmp = z / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[t, -7.8e-122], N[Not[LessEqual[t, 1.1e-16]], $MachinePrecision]], N[(x / N[(a + 1.0), $MachinePrecision]), $MachinePrecision], N[(z / b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -7.8 \cdot 10^{-122} \lor \neg \left(t \leq 1.1 \cdot 10^{-16}\right):\\
\;\;\;\;\frac{x}{a + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{b}\\
\end{array}
\end{array}
if t < -7.79999999999999979e-122 or 1.1e-16 < t Initial program 83.5%
*-commutative83.5%
associate-*l/88.2%
*-commutative88.2%
associate-*l/93.0%
Simplified93.0%
Taylor expanded in t around inf 58.5%
if -7.79999999999999979e-122 < t < 1.1e-16Initial program 56.6%
*-commutative56.6%
associate-*l/47.5%
*-commutative47.5%
associate-*l/41.5%
Simplified41.5%
Taylor expanded in t around 0 68.6%
Final simplification62.3%
(FPCore (x y z t a b) :precision binary64 (if (or (<= a -1.0) (not (<= a 1.0))) (/ x a) x))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -1.0) || !(a <= 1.0)) {
tmp = x / a;
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((a <= (-1.0d0)) .or. (.not. (a <= 1.0d0))) then
tmp = x / a
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -1.0) || !(a <= 1.0)) {
tmp = x / a;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (a <= -1.0) or not (a <= 1.0): tmp = x / a else: tmp = x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((a <= -1.0) || !(a <= 1.0)) tmp = Float64(x / a); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((a <= -1.0) || ~((a <= 1.0))) tmp = x / a; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[a, -1.0], N[Not[LessEqual[a, 1.0]], $MachinePrecision]], N[(x / a), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1 \lor \neg \left(a \leq 1\right):\\
\;\;\;\;\frac{x}{a}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < -1 or 1 < a Initial program 71.2%
*-commutative71.2%
associate-*l/71.3%
*-commutative71.3%
associate-*l/74.1%
Simplified74.1%
Taylor expanded in x around inf 49.3%
Taylor expanded in a around inf 43.0%
if -1 < a < 1Initial program 75.8%
*-commutative75.8%
associate-*l/74.7%
*-commutative74.7%
associate-*l/73.2%
Simplified73.2%
Taylor expanded in x around inf 51.2%
Taylor expanded in a around 0 50.2%
Taylor expanded in b around 0 37.1%
Final simplification40.2%
(FPCore (x y z t a b) :precision binary64 x)
double code(double x, double y, double z, double t, double a, double b) {
return x;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = x
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return x;
}
def code(x, y, z, t, a, b): return x
function code(x, y, z, t, a, b) return x end
function tmp = code(x, y, z, t, a, b) tmp = x; end
code[x_, y_, z_, t_, a_, b_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 73.4%
*-commutative73.4%
associate-*l/72.9%
*-commutative72.9%
associate-*l/73.7%
Simplified73.7%
Taylor expanded in x around inf 50.2%
Taylor expanded in a around 0 29.9%
Taylor expanded in b around 0 19.9%
Final simplification19.9%
(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 2024018
(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))))